/* shell.css — the app window.
 *
 * One stylesheet for every authed page, so the shell cannot drift between the feed,
 * settings and security. Page-specific rules stay in each template; anything that
 * defines the app's silhouette lives here.
 *
 * The silhouette: a translucent window floating on a desktop (-—wallpaper), with a
 * macOS title bar, a frosted sidebar, and a scrolling main column. Colour comes from
 * the theme registry (cmd/srv/themes.go) — nothing in this file hard-codes a palette
 * value except the three traffic lights, which are a platform detail, not a theme.
 */

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

html, body { height: 100%; }

/* Anchors fall back to the browser's blue — and its visited purple — which fights every
 * palette in the registry. Inherit by default; anything that wants a link colour says so
 * itself (note markdown, the footer, the Free View paper). */
a { color: inherit; text-decoration: none; }

/* Self-hosted faces. The CSP forbids third-party origins, so these ship from
   /static/fonts — Latin-subset woff2 (see fonts/SOURCES.md), 400 and 700 each.
   A face costs nothing until a stack names it, so only the family a reader picks
   is ever downloaded. */
/* JetBrains Mono and Fira Code ship as variable fonts, so one file covers the
   whole weight axis. The range in font-weight is what makes the browser use the
   axis; declaring a single weight against a variable file pins every heading to
   that one instance and gets faux-bold instead. */
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/static/fonts/jetbrains-mono-var.woff2") format("woff2"); }
@font-face { font-family: "Fira Code"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("/static/fonts/fira-code-var.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/ibm-plex-mono-700.woff2") format("woff2"); }
@font-face { font-family: "Monaspace Neon"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/monaspace-neon-400.woff2") format("woff2"); }
@font-face { font-family: "Monaspace Neon"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/monaspace-neon-700.woff2") format("woff2"); }

/* Fira Code and Monaspace carry programming ligatures. Turning them on only for
   those families keeps a typed `->` from becoming an arrow in System or Courier,
   where the reader did not ask for it. */
.font-fira-code, .font-monaspace-neon { font-variant-ligatures: contextual common-ligatures; }

body {
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--wallpaper);
  background-attachment: fixed;
  background-size: cover;
  /* --font-ui comes from the registry in fonts.go, per account. The fallback
     stack is the one the app used before fonts were selectable, so a missing
     woff2 degrades to the platform's own face rather than to Times. */
  font-family: var(--font-ui, system-ui, -apple-system, "Segoe UI", sans-serif);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  /* The window floats, so the body is a desk: centre it, and leave room to breathe. */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow: hidden;
}

/* ── the window ─────────────────────────────────────────────────────────── */

.window {
  width: min(1180px, 100%);
  height: min(calc(100dvh - 44px), 100%);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgb(255 255 255 / 0.11);
  background-color: var(--bg);
  background-image: linear-gradient(var(--bg-a), var(--bg-a));
  box-shadow:
    0 40px 90px rgb(0 0 0 / 0.55),
    0 2px 6px rgb(0 0 0 / 0.35);
  overflow: hidden;
  /* The frosted pane. Without support the flat --bg fallback above still reads. */
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
}

.titlebar {
  height: 42px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* Three lights, in the platform's colours. Purely decorative — the window is a web
 * page and cannot be closed from here, so they are not buttons. */
.lights { display: flex; gap: 8px; }
.lights i {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.25);
}
.lights .l-red { background: #ff5f57; }
.lights .l-yellow { background: #febc2e; }
.lights .l-green { background: #28c840; }

.titlebar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text2);
  pointer-events: none;
}

.titlebar-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* A circular icon button, the reference's unit of interface. */
.icon-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border2); }
.icon-btn svg { width: 14px; height: 14px; }

.window-body { flex: 1; display: flex; min-height: 0; }

/* ── sidebar ────────────────────────────────────────────────────────────── */

.sidebar {
  width: 226px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background-color: var(--bg2);
  background-image: linear-gradient(var(--bg2-a), var(--bg2-a));
}

.side-head { padding: 6px 8px 10px; }
.side-head img { display: block; height: 20px; width: auto; filter: var(--logo-filter); }

.side-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text2);
  font-size: 13px;
  text-decoration: none;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s, color 0.12s;
}
.side-item:hover { background: var(--bg3); color: var(--text); }
.side-item.active {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
}
.side-item svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: 0.9; }

/* The row whose tag the next capture will use: a mint ring on its dot, not a filled
 * chip, because the sidebar stays quiet and this is a hint, not a button state. */
.side-item.selected .side-dot { box-shadow: 0 0 0 2px var(--accent); }
.side-item.selected { color: var(--text); }

.side-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}

.side-sep { height: 1px; background: var(--border); margin: 9px 6px; }

.side-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 4px 9px 2px;
}

/* A tag is a sidebar row with its colour as a dot, not the chip it used to be:
 * forty coloured chips in a column shout, and the reference is quiet. */
.side-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  background: #9ca3af;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22);
}
/* CardColors in db.go — the six the app will store. An unset or unknown colour gets
 * the grey above rather than a hollow ring, which reads as an empty radio button. */
.side-dot.dot-blue { background: #60a5fa; }
.side-dot.dot-green { background: #4ade80; }
.side-dot.dot-amber { background: #fbbf24; }
.side-dot.dot-red { background: #f87171; }
.side-dot.dot-purple { background: #c084fc; }
.side-dot.dot-gray { background: #9ca3af; }

/* Adding a tag happens inline in the sidebar: no modal, no second trip to a page. */
.side-add { width: 100%; text-align: left; background: none; cursor: pointer; font-family: inherit; }
.side-add svg { opacity: 0.7; }
.tag-form { display: flex; flex-direction: column; gap: 6px; padding: 6px 9px 8px; }
.tag-form[hidden], #new-tag-form[hidden] { display: none; }
.tag-form input, .tag-form select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.tag-form input:focus, .tag-form select:focus { border-color: var(--border2); }
.tag-form-row { display: flex; gap: 6px; }
.tag-form-row .btn-primary, .tag-form-row .btn-secondary { flex: 1; padding: 6px 8px; font-size: 11.5px; }

.side-foot { margin-top: auto; padding-top: 10px; }

/* The account chip is a menu: <details> so it needs no script to open, close or be
 * reached by keyboard, and it opens upward from the corner like the reference's. */
.acct { position: relative; }
.acct > summary { list-style: none; cursor: pointer; }
.acct > summary::-webkit-details-marker { display: none; }

.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg3);
  text-decoration: none;
  color: var(--text2);
}
.side-user:hover, .acct[open] > .side-user { color: var(--text); border-color: var(--border2); }
.side-user .chev { width: 13px; height: 13px; margin-left: auto; opacity: 0.6; flex: 0 0 auto; transition: transform 0.15s; }
.acct[open] .chev { transform: rotate(180deg); }

.acct-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  padding: 5px;
  border-radius: 11px;
  border: 1px solid var(--border2);
  background-color: var(--bg2);
  background-image: var(--card-grad);
  box-shadow: 0 16px 36px rgb(0 0 0 / 0.45);
  z-index: 30;
}
.acct-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--text2);
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.acct-item:hover { background: var(--bg3); color: var(--text); }
.acct-item svg { width: 14px; height: 14px; opacity: 0.8; flex: 0 0 auto; }
.acct-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.acct-signout:hover { color: #fca5a5; }
.acct form { margin: 0; }
.avatar-img { object-fit: cover; border: 1px solid rgba(255,255,255,0.14); padding: 0; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--accent-ink);
  background: var(--accent-grad);
  flex: 0 0 auto;
}
.side-user .who { min-width: 0; }
.side-user .who b {
  display: block; font-size: 12px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-user .who span {
  display: block; font-size: 11px; color: var(--text3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── main column ────────────────────────────────────────────────────────── */

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px 12px;
}
.main-head h1 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
.main-head .sub { font-size: 12px; color: var(--text3); margin-left: 2px; }
.main-head .head-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.main-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 26px 30px;
  /* Hint of the pane's edge, like the reference's scroller inset. */
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.main-scroll::-webkit-scrollbar { width: 10px; }
.main-scroll::-webkit-scrollbar-thumb {
  background: var(--border2); border-radius: 999px; border: 3px solid transparent;
  background-clip: content-box;
}

/* ── compose ────────────────────────────────────────────────────────────── */

.capture-bar {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
/* The capture box is a textarea, not a one-line input: a note is usually a paragraph,
 * a list or a heading, and an <input> silently swallowed every newline out of typed or
 * pasted text — which made markdown rendering unreachable from the one place a note is
 * actually written. It grows to eight lines, then scrolls. */
.capture-bar textarea {
  flex: 1;
  padding: 12px 52px 12px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  overflow-y: hidden;
  min-height: 44px;
  max-height: 40vh;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.capture-bar textarea::placeholder { color: var(--text3); }
.capture-bar textarea:focus {
  border-color: var(--border2);
  box-shadow: 0 0 0 3px rgb(255 255 255 / 0.05);
}

/* The one filled control in the app: the accent circle from the reference. */
.capture-bar .btn-capture {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 30px; height: 30px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: none;
  background: var(--accent-grad);
  color: var(--accent-ink);
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
}
.capture-bar .btn-capture:hover { filter: brightness(1.06); transform: scale(1.05); }
.capture-bar .btn-capture svg { width: 15px; height: 15px; }

.capture-bar .btn-voice {
  position: absolute;
  right: 44px;
  bottom: 8px;
  width: 30px; height: 30px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}
.capture-bar .btn-voice:hover { color: var(--text); border-color: var(--border2); }
.capture-bar .btn-voice.recording {
  background: #ef4444; border-color: #ef4444; color: #fff;
  animation: pulse 1s ease-in-out infinite;
}

/* ── search ─────────────────────────────────────────────────────────────── */

.search-bar { display: flex; gap: 8px; margin: 0 0 12px; }
/* display:flex beats the [hidden] attribute, which is the trap this app has hit
 * before: the rule has to be explicit or the bar never closes. */
.search-bar[hidden] { display: none; }
.search-bar input {
  flex: 1;
  padding: 9px 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  outline: none;
  font-size: 12.5px;
}
.search-bar input::placeholder { color: var(--text3); }
.search-bar input:focus { border-color: var(--border2); }

/* ── notes ──────────────────────────────────────────────────────────────── */

/* Elevation here is lightness, not shadow: the card is a slightly brighter pane of
 * the same glass, exactly as in the reference. */
.card {
  background: var(--card-grad);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 9px;
  transition: border-color 0.15s, background 0.15s;
}
.card:hover { border-color: var(--border2); }

.card-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; }
.card-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card-time { font-size: 11px; color: var(--text3); }

.card-text-wrap { max-height: 3.1em; overflow: hidden; }
/* The reference sets note body in muted grey and reserves white for structure; that
 * single decision is most of why its cards read as calm rather than as a wall. */
.card-text { font-size: 13px; line-height: 1.58; color: var(--text2); word-break: break-word; }
.card-text strong, .card-text b, .card-text h1, .card-text h2, .card-text h3 { color: var(--text); }
.card.is-clamped .card-text-wrap { cursor: pointer; }
.card.expanded .card-text-wrap { max-height: none; overflow: visible; }

.card-more {
  background: none; border: none; color: var(--text3);
  font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0; margin: 3px 0 0; cursor: pointer; border-radius: 3px;
}
.card-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-more:hover { color: var(--text); }

.card-actions { display: flex; gap: 4px; align-items: center; opacity: 0.45; transition: opacity 0.12s; }
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; }
.card-actions button {
  background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 11px; padding: 3px 6px; border-radius: 5px;
  line-height: 1;
}
.card-actions button:hover { color: var(--text); background: var(--bg3); }
.card-actions svg { width: 13px; height: 13px; display: block; }
.card-color summary svg { width: 13px; height: 13px; display: block; }

/* ── footer odds and ends ───────────────────────────────────────────────── */

.empty-state { text-align: center; padding: 56px 24px; color: var(--text3); }
.empty-state h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text2); }
.empty-state p { font-size: 13px; }

/* Buttons are sometimes anchors; the browser's underline has no place on either. */
a.btn-primary, a.btn-secondary { text-decoration: none; }

.btn-primary {
  padding: 9px 18px;
  border-radius: 9px;
  border: none;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.btn-secondary {
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ── narrow screens ─────────────────────────────────────────────────────── */

/* Below a phone's width the window would be a letterbox with two scrollbars. Drop the
 * chrome, let the app fill the screen, and turn the sidebar into a bottom bar. */
@media (max-width: 860px) {
  body { padding: 0; display: block; }
  .window {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .titlebar { display: none; }
  .window-body { flex-direction: column-reverse; }
  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-top: 1px solid var(--border);
  }
  .side-head, .side-label, .side-sep, .side-count, .side-user .who { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .side-user { border: none; background: none; padding: 4px; }
  .side-item { padding: 7px 9px; }
  .side-item span.label { display: none; }
  /* Tag rows are a column affordance: as icons they would be a row of identical dots.
   * Keep the way to add one, drop the list. */
  #tag-area { display: flex; flex-direction: row; align-items: center; gap: 4px; }
  #tag-area .side-item:not(.side-add) { display: none; }
  #tag-area .side-label { display: none; }
  .side-add span.label { display: inline; }
  .main-head { padding: 12px 16px 8px; }
  .main-scroll { padding: 0 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── The small window ────────────────────────────────────────────────────────
 * Sign-in, verification, password reset, checkout and the legal pages are the
 * same object: one window on the desktop with one thing to do in it. They share
 * these rules so seven pages cannot drift into six designs — which is exactly
 * what happened before the shell existed. */
.win-sm { width: min(420px, 100%); height: auto; }
.win-md { width: min(540px, 100%); height: auto; }
/* Tall enough for two plan cards, but it should stop growing when the content
 * does rather than sitting as a half-empty pane — and scroll if it is taller. */
.win-lg { width: min(900px, 100%); height: auto; max-height: calc(100dvh - 44px); overflow-y: auto; }
.win-doc { width: min(760px, 100%); }

/* Windows with no sidebar — sign-in, verification, reset, checkout, the legal pages,
 * the landing page — keep their title bar on phones: it is the only navigation they
 * have. In the app itself the bottom bar covers that job, so the bar goes. */
@media (max-width: 860px) {
  .win-standalone .titlebar { display: flex; }
  .win-standalone .lights { display: none; }
}

/* A wordmark set into the title bar, for windows whose own heading carries the
 * page name (the legal pages). */
.titlebar-title .bar-mark { height: 15px; width: auto; vertical-align: middle; filter: var(--logo-filter); }

.win-back { margin-left: auto; font-size: 11.5px; color: var(--text3); }
.win-back:hover { color: var(--text); }

.win-form { padding: 26px 26px 24px; }
.win-form .mark { display: block; line-height: 0; margin-bottom: 16px; }
.win-form .mark img { width: 104px; height: auto; filter: var(--logo-filter); }
.win-form h1 { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 5px; }
.win-form .sub { color: var(--text3); font-size: 12.5px; line-height: 1.55; margin-bottom: 20px; }
.win-form .sub b { color: var(--text2); font-weight: 600; }

.win-form label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 5px;
}
.win-form input:not([type="hidden"]) {
  width: 100%; padding: 10px 12px; border-radius: 9px; font: inherit;
  border: 1px solid var(--border); background: var(--bg2); color: var(--text);
  font-size: 13.5px; outline: none; margin-bottom: 14px;
}
.win-form input:focus { border-color: var(--border2); }
.win-form input::placeholder { color: var(--text3); }
.win-form button[type="submit"] {
  width: 100%; padding: 10px; border-radius: 9px; border: none; font: inherit;
  background: var(--accent-grad); color: var(--accent-ink);
  font-weight: 650; font-size: 13.5px; cursor: pointer; margin-top: 4px;
}
.win-form button[type="submit"]:hover { filter: brightness(1.06); }

.win-form .msg { font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; }
.win-form .msg.ok { color: #86efac; }
.win-form .msg.bad { color: #f87171; }

.win-form .alt { margin-top: 16px; font-size: 12.5px; color: var(--text3); text-align: center; }
.win-form .alt a, .win-form .alt button {
  background: none; border: none; padding: 0; font: inherit;
  color: var(--text2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.win-form .alt a:hover, .win-form .alt button:hover { color: var(--text); }

.win-form .links {
  margin-top: 16px; display: flex; flex-direction: column; gap: 7px;
  font-size: 12.5px; color: var(--text3); text-align: center;
}
.win-form .links a { color: var(--text2); }
.win-form .links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.win-form .links a.go { color: var(--accent); }

/* A document window: terms, privacy — the same desk, one readable column. */
.win-doc-body { padding: 30px 34px 34px; overflow-y: auto; }
.win-doc-body h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.win-doc-body .updated { color: var(--text3); font-size: 11.5px; margin-bottom: 26px; }
.win-doc-body h2 {
  font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text2); margin: 26px 0 8px;
}
.win-doc-body p, .win-doc-body li { color: var(--text2); font-size: 14px; line-height: 1.7; margin-bottom: 11px; }
.win-doc-body ul { margin: 0 0 11px 20px; }
.win-doc-body li { margin-bottom: 6px; }
.win-doc-body strong { color: var(--text); font-weight: 600; }
.win-doc-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.win-doc-body table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 13px; }
.win-doc-body th, .win-doc-body td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--border); color: var(--text2); vertical-align: top; }
.win-doc-body th { color: var(--text); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 650; }
.win-doc-body code { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12.5px; color: var(--text); }

/* A callout that stops the page and makes a promise — used by the legal pages. */
.win-doc-body .summary {
  border: 1px solid var(--border2); border-radius: 11px; padding: 15px 17px;
  margin-bottom: 14px; background-color: var(--bg2); background-image: var(--card-grad);
}
.win-doc-body .summary p { color: var(--text2); margin-bottom: 8px; }
.win-doc-body .summary p:last-child { margin-bottom: 0; }

.win-doc-body footer {
  margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--text3); font-size: 12px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}


/* ── three panes: list and editor ──────────────────────────────────────────
   The dashboard is a workspace: tags on the left, the notes in the middle, the
   open note on the right. Each pane owns its own scroller so opening a long
   note never moves the list out from under the pointer. */

.pane-list {
  width: 340px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--border);
  background: var(--bg2);
}

.list-head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 15px 16px 10px;
}
.list-head h1 {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
.list-count { font-size: 11.5px; color: var(--text3); }
.list-head .icon-btn { align-self: center; }

.list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.list-scroll::-webkit-scrollbar { width: 9px; }
.list-scroll::-webkit-scrollbar-thumb {
  background: var(--border2); border-radius: 999px;
  border: 3px solid transparent; background-clip: content-box;
}

.pane-list .capture-bar { margin: 4px 0 12px; }
.pane-list .capture-bar textarea { font-size: 13px; padding: 10px 44px 10px 13px; }
.pane-list .search-bar { padding: 0 16px 10px; }
.pane-list .voice-status { font-size: 11.5px; color: var(--text3); margin: -6px 6px 10px; min-height: 13px; }
.pane-list .voice-panel { margin: 0 0 12px; }

/* ── a row in the list ──────────────────────────────────────────────────── */

.note-card {
  position: relative;
  border: 1px solid transparent;
  border-radius: 9px;
  margin-bottom: 2px;
}
.note-card:hover { background: var(--bg3); }
.note-card.is-active {
  background: var(--bg3);
  border-color: var(--border2);
}
.note-card.pinned .nc-title::after {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  background: var(--accent);
}
/* The whole row is the button; the actions sit above it, not inside it, so a
   click on the pin cannot also open the note. */
.nc-hit {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 10px 11px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.nc-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.35;
  padding-right: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nc-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text2);
}
.nc-progress {
  display: block;
  height: 3px;
  margin: 9px 0 5px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.nc-progress-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.nc-tasks { display: block; font-size: 10.5px; color: var(--text3); }
.nc-foot { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.nc-time { margin-left: auto; font-size: 10.5px; color: var(--text3); }
.nc-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--text2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 7px 2px 5px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nc-tag::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--text3); flex: 0 0 auto;
}
.nc-tag.dot-blue::before { background: #60a5fa; }
.nc-tag.dot-green::before { background: #4ade80; }
.nc-tag.dot-amber::before { background: #fbbf24; }
.nc-tag.dot-red::before { background: #f87171; }
.nc-tag.dot-purple::before { background: #c084fc; }
.nc-tag.dot-gray::before { background: #9ca3af; }

.nc-actions {
  position: absolute;
  top: 6px; right: 6px;
  display: flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.12s;
}
.note-card:hover .nc-actions, .note-card.is-active .nc-actions, .note-card:focus-within .nc-actions { opacity: 1; }
.nc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 5px;
  background: none; color: var(--text3);
  cursor: pointer;
}
.nc-btn:hover { background: var(--bg3); color: var(--text); }
.nc-btn.on { color: var(--accent); }
.nc-btn svg { width: 12px; height: 12px; }
.nc-del:hover { color: #f87171; }
.nc-colour { position: relative; }
.nc-colour > summary { list-style: none; }
.nc-colour > summary::-webkit-details-marker { display: none; }
.nc-dot {
  display: block; width: 9px; height: 9px; margin: 6px; border-radius: 50%;
  border: 1px solid var(--border2);
}
.nc-colour .swatches {
  position: absolute; right: 0; top: 24px; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;
  padding: 7px; border-radius: 9px;
  background: var(--bg); border: 1px solid var(--border2);
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.34);
}

/* colour accents on a row's left edge, the way the reference marks a note */
.note-card.c-blue { box-shadow: inset 2px 0 0 #60a5fa; }
.note-card.c-green { box-shadow: inset 2px 0 0 #4ade80; }
.note-card.c-amber { box-shadow: inset 2px 0 0 #fbbf24; }
.note-card.c-red { box-shadow: inset 2px 0 0 #f87171; }
.note-card.c-purple { box-shadow: inset 2px 0 0 #c084fc; }
.note-card.c-gray { box-shadow: inset 2px 0 0 #9ca3af; }

/* ── the editor pane ────────────────────────────────────────────────────── */

.pane-editor {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--border);
}

.ed-empty {
  margin: auto;
  text-align: center;
  color: var(--text3);
  padding: 40px;
}
.ed-empty svg { width: 34px; height: 34px; opacity: 0.5; margin-bottom: 12px; }
.ed-empty p { font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.ed-empty span { font-size: 12px; }

.ed {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.ed-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.ed-crumb { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ed-dot, .ed-when, .ed-none { font-size: 11.5px; color: var(--text3); }
.ed-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.ed-views {
  display: inline-flex;
  padding: 2px;
  border-radius: 7px;
  background: var(--bg2);
  border: 1px solid var(--border);
}
.ed-views button {
  border: 0; background: none; cursor: pointer;
  font-size: 11px; color: var(--text3);
  padding: 3px 9px; border-radius: 5px;
}
.ed-views button:hover { color: var(--text); }
.ed-views button.on { background: var(--bg3); color: var(--text); }

.ed-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }

.ed-title-row {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 18px 6px;
}
.ed-title {
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}
.ed-save-state { margin-left: auto; font-size: 10.5px; color: var(--text3); }

.ed-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
}
.ed-toolbar button {
  border: 0; background: none; cursor: pointer;
  color: var(--text3); font-size: 11.5px;
  padding: 4px 7px; border-radius: 5px; line-height: 1;
}
.ed-toolbar button:hover { background: var(--bg3); color: var(--text); }
.ed-toolbar .mono { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 11px; }
.ed-toolbar .md-count { font-size: 10.5px; color: var(--text3); }

.ed-split {
  flex: 1;
  min-height: 0;
  display: flex;
}
.ed-input, .ed-preview {
  flex: 1 1 50%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 24px;
  font-size: 13.5px;
  line-height: 1.7;
}
.ed-input {
  border: 0;
  border-right: 1px solid var(--border);
  background: none;
  color: var(--text);
  resize: none;
  outline: none;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 13px;
  tab-size: 2;
}
.ed-preview { color: var(--text2); }
.ed-preview h1, .ed-preview h2, .ed-preview h3 { color: var(--text); }

/* View modes: one column, both, or the rendered note alone. */
.ed[data-view="editor"] .ed-preview { display: none; }
.ed[data-view="editor"] .ed-input { border-right: 0; }
.ed[data-view="preview"] .ed-input { display: none; }
.ed[data-view="preview"] .ed-preview { flex: 1; }

.ed-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
}
.ed-footer select {
  background: var(--bg2); color: var(--text2);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 7px; font-size: 11.5px;
}
.ed-stats { font-size: 11px; color: var(--text3); }
.ed-footer .md-hint { margin-left: auto; font-size: 11px; color: var(--text3); }

.ed-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 14px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  background: var(--bg2);
}

@media (max-width: 1180px) {
  .pane-list { width: 300px; }
}
@media (max-width: 980px) {
  /* One column at a time on a tablet: the list keeps the screen, and the
     editor takes over when a note is opened. */
  .pane-list { width: auto; flex: 1; border-left: 0; }
  .pane-editor { display: none; border-left: 0; }
  .pane-editor.has-note { display: flex; position: absolute; inset: 0; z-index: 20; background: var(--bg); }
  .pane-editor.has-note .ed { height: 100%; }
}
