/* ============================================================
   boringbroad — style.css
   Flat. Paper. Boring on purpose.
   ============================================================ */

:root {
  --paper: #f7f6f3;
  --surface: #ffffff;
  --ink: #171715;
  --muted: #8a887f;
  --line: #e3e1db;
  --line-soft: #eeece7;
  --accent: #e5484d;           /* marker-cap red */
  --accent-soft: #fdeced;
  --radius: 8px;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-mono: 'Space Mono', monospace;
  --shadow: 0 1px 2px rgba(23,23,21,.05), 0 4px 16px rgba(23,23,21,.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: 52px; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.tb-l, .tb-r { display: flex; align-items: center; gap: 8px; min-width: 0; }

.logo {
  font-family: var(--font-mono); font-weight: 700; font-size: 16px;
  color: var(--ink); text-decoration: none; white-space: nowrap; letter-spacing: -0.02em;
}
.logo-dim { color: var(--muted); font-weight: 400; }
.logo-dot { color: var(--accent); }

.tb-sep { width: 1px; height: 20px; background: var(--line); display: inline-block; }

.board-title {
  font-family: var(--font-mono); font-size: 13px; color: var(--ink);
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: 5px 8px; width: 180px; min-width: 60px;
}
.board-title:hover { border-color: var(--line); }
.board-title:focus { border-color: var(--ink); outline: none; background: var(--surface); }

.tb-icon {
  width: 32px; height: 32px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.tb-icon svg { width: 16px; height: 16px; }
.tb-icon:hover { background: var(--line-soft); color: var(--ink); }
.tb-icon.active { background: var(--accent-soft); color: var(--accent); }

.tb-btn {
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 7px 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); white-space: nowrap;
}
.tb-btn:hover { border-color: var(--ink); }
.tb-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tb-primary:hover { background: #000; }

/* Pro button injected by pro.js gets restyled flat */
.bbp-upbtn {
  font-family: var(--font-mono) !important; font-size: 12.5px !important;
  background: var(--accent) !important; color: #fff !important;
  border: none !important; border-radius: 6px !important;
  padding: 7px 12px !important; cursor: pointer;
}

/* ── Boards popover ──────────────────────────────────── */
.boards-pop {
  position: fixed; top: 58px; right: 14px; z-index: 50;
  width: 260px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.boards-pop.hidden { display: none; }
.bp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.bp-new {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px;
}
.bp-new:hover { border-color: var(--ink); }
.bp-list { max-height: 300px; overflow-y: auto; }
.bp-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; cursor: pointer; gap: 8px;
}
.bp-item:hover { background: var(--paper); }
.bp-item.current { background: var(--accent-soft); }
.bp-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-date { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.bp-del { color: var(--muted); font-size: 14px; padding: 2px 4px; border-radius: 4px; flex-shrink: 0; }
.bp-del:hover { color: var(--accent); background: var(--accent-soft); }
.bp-empty { padding: 20px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }
.bp-foot {
  padding: 8px 12px; border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}

/* ── Tool tray ───────────────────────────────────────── */
.tray {
  position: fixed; left: 14px; top: 50%; transform: translateY(-50%); z-index: 40;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow);
}
.tool {
  width: 38px; height: 38px; border-radius: 8px; position: relative;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.tool svg { width: 19px; height: 19px; }
.tool:hover { background: var(--line-soft); color: var(--ink); }
.tool.active { color: var(--ink); background: var(--line-soft); }
.tool.active::after {
  content: ''; position: absolute; left: 9px; right: 9px; bottom: 4px; height: 2.5px;
  background: var(--accent); border-radius: 2px;
  transform: rotate(-1.2deg);            /* the marker stroke */
}
.tray-sep { width: 22px; height: 1px; background: var(--line); margin: 4px 0; }

/* ── Options bar ─────────────────────────────────────── */
.opts {
  position: fixed; left: 72px; top: 50%; transform: translateY(-50%); z-index: 39;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow);
  width: 168px;
}
.opts.hidden { display: none; }
.opt-label {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sw {
  width: 100%; aspect-ratio: 1; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; position: relative;
}
.sw.sel { border-color: var(--ink); }
.sw.sw-custom {
  background: conic-gradient(#e5484d, #f59e0b, #1f9d55, #2f6fed, #8b5cf6, #e5484d);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.opt-row { display: flex; align-items: center; gap: 8px; }
.opt-row input[type=range] { flex: 1; accent-color: var(--ink); min-width: 0; }
.opt-val { font-family: var(--font-mono); font-size: 11px; color: var(--muted); width: 34px; text-align: right; flex-shrink: 0; }
.opt-toggle {
  font-family: var(--font-mono); font-size: 11.5px;
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 10px;
}
.opt-toggle.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ── Stage / canvas ──────────────────────────────────── */
.stage {
  position: fixed; inset: 52px 0 0 0;
  background: var(--paper);
}
.stage.grid-on {
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
}
.stage canvas { touch-action: none; }

/* ── Zoom ────────────────────────────────────────────── */
.zoom {
  position: fixed; right: 14px; bottom: 14px; z-index: 40;
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); overflow: hidden;
}
.z-btn { width: 32px; height: 32px; font-size: 16px; color: var(--muted); }
.z-btn:hover { background: var(--line-soft); color: var(--ink); }
.z-val { font-family: var(--font-mono); font-size: 11.5px; padding: 0 8px; color: var(--muted); height: 32px; }
.z-val:hover { color: var(--ink); }

/* ── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 12px);
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 9px 16px; border-radius: 8px; z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Pro modal restyle (overrides pro.js injected css) ── */
.bbp-card {
  background: var(--surface) !important; color: var(--ink) !important;
  border: 1px solid var(--line) !important; border-radius: 12px !important;
  font-family: var(--font-ui) !important;
  box-shadow: var(--shadow) !important;
}
.bbp-card h2 { font-family: var(--font-mono) !important; font-size: 18px !important; }
.bbp-card p { opacity: 1 !important; color: var(--muted) !important; }
.bbp-feats li:before { color: var(--accent) !important; }
.bbp-cta {
  background: var(--ink) !important; border-radius: 8px !important;
  font-family: var(--font-mono) !important;
}
.bbp-cta:hover { filter: none !important; background: #000 !important; }
.bbp-sub { opacity: 1 !important; color: var(--muted) !important; }
.bbp-restore input {
  background: var(--paper) !important; border: 1px solid var(--line) !important;
  color: var(--ink) !important;
}
.bbp-restore button {
  background: var(--surface) !important; border: 1px solid var(--line) !important;
  color: var(--ink) !important;
}

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