/* Moodboards — Alamo Hub's neutral graphite theme. Flat surfaces, 1px borders, no tints or glows. */
:root {
  --bg: #141414;          /* page */
  --chrome: #1c1c1c;      /* header */
  --surface: #242424;     /* cards */
  --hover: #303030;       /* hover states */
  --border: #383838;      /* borders */
  --border-strong: #474747;
  --text: #e8e8e8;        /* primary text */
  --text-2: #a3a3a3;      /* secondary text */
  --text-3: #737373;      /* tertiary / placeholders */
  --primary: #ededed;     /* off-white buttons */
  --primary-hover: #ffffff;
  --on-primary: #141414;
  --focus: rgba(232, 232, 232, .28);
  --blue: #0a63e0;        /* Alamo blue: selection on the canvas */
  --red: #f2555a;
  --red-soft: rgba(242, 85, 90, .1);
  --overlay: rgba(0, 0, 0, .6);
  --radius: 8px;
  --radius-sm: 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.5 "Geist", "Inter", system-ui, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "ss01", "cv11";
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(232, 232, 232, .2); }
[hidden] { display: none !important; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text-2); }
:focus-visible { outline: 2px solid var(--text-2); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.02em; font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
svg { flex: none; }
button { font: inherit; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }
@keyframes pop { from { opacity: 0; transform: translateY(3px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
.page-enter { animation: page-in .26s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- app shell: the Hub's black rail + framed page with header ---------- */
.layout { display: flex; min-height: 100vh; background: var(--chrome); }
.rail {
  position: sticky; top: 0; height: 100vh; width: 76px; flex: none; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0;
  background: #000; border-right: 1px solid #262626; /* black, so the Alamo Studios logo sits seamlessly in it */
}
.rail-logo { display: grid; place-items: center; height: 56px; margin-bottom: 20px; text-decoration: none; }
.rail-logo img { display: block; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; }
.rail-link {
  position: relative; width: 60px; height: 58px; border-radius: var(--radius); border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--text-2); font-size: 11.5px; font-weight: 500; text-decoration: none;
  transition: background .12s, color .12s;
}
.rail-link:hover { background: #1a1a1a; color: var(--text); }
.rail-link.active { background: #1c1c1c; border-color: #2e2e2e; color: var(--text); }
.rail-hub { margin-top: auto; }

.frame { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--chrome); border-bottom: 1px solid var(--border); }
/* Three columns with equal sides, so the search sits in the true center of the header. */
.topbar-inner { height: 60px; padding: 0 20px; display: grid; grid-template-columns: 1fr minmax(0, 560px) 1fr; align-items: center; gap: 16px; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.brand { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; text-decoration: none; }
.brand:hover { color: var(--primary-hover); }
.wordmark { display: block; flex: none; }
.top-search { position: relative; width: 100%; }
.top-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.top-search input { height: 36px; padding: 0 12px 0 34px; background: var(--bg); }
.top-search input::-webkit-search-cancel-button { cursor: pointer; filter: invert(1) opacity(.5); }
.hdr-btn {
  position: relative; width: 36px; height: 36px; border-radius: var(--radius); display: grid; place-items: center;
  background: none; border: 1px solid transparent; color: var(--text-2); cursor: pointer; padding: 0;
}
.hdr-btn:hover { background: var(--hover); color: var(--text); }
.avatar-btn { border-radius: 50%; }
.avatar-btn:hover { background: none; }
.avatar-btn:hover .avatar { border-color: var(--text-3); }

.dd-wrap { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); width: 280px; max-width: calc(100vw - 24px); z-index: 35;
  padding: 4px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4); animation: pop .12s ease-out;
}
.dd-me { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.dd-me > div { min-width: 0; }
.dd-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-link {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); text-align: left;
  color: var(--text-2); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.dd-link:hover, .dd-link:focus-visible { background: var(--hover); color: var(--text); }
.dd-link.danger { color: var(--red); }
.dd-link.danger:hover { background: var(--red-soft); color: var(--red); }
.dd-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* Pop-up menu (the ⋯ on a card), placed next to its button */
.menu {
  position: fixed; z-index: 55; min-width: 190px; padding: 4px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, .4); animation: pop .12s ease-out;
}

main.page { width: 100%; max-width: 1160px; margin: 0 auto; padding: 40px 32px 72px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; }
.page-head p { margin-top: 4px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section + .section { margin-top: 44px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 16px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 20px; color: var(--text-2); text-decoration: none; }
.back-link:hover { color: var(--text); }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    flex-direction: row; justify-content: center; border-right: 0; border-top: 1px solid #262626;
  }
  .rail-logo { display: none; }
  .rail-nav { flex-direction: row; gap: 4px; flex: 2; justify-content: space-around; }
  .rail-link { width: auto; flex: 1; max-width: 120px; height: 52px; gap: 3px; }
  .rail-hub { margin-top: 0; }
  .frame { padding-bottom: 68px; }
  .topbar-inner { padding: 0 10px 0 16px; gap: 10px; height: 56px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .brand { max-width: 30vw; }
  main.page { padding: 24px 16px 40px; }
  .page-head h1 { font-size: 22px; }
}

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: rgba(242, 85, 90, .35); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger.solid:hover { filter: brightness(1.08); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: var(--radius-sm);
  background: none; border: 0; color: var(--text-3); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

input, select, textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius-sm); font: inherit;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); outline: 0;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px var(--focus); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
label.field, div.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text); }
.hint { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); white-space: nowrap;
  font-size: 12px; font-weight: 500; background: transparent; color: var(--text-2); border: 1px solid var(--border);
}
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 48px 20px;
  color: var(--text-2); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty strong { color: var(--text); font-weight: 500; }
.empty .btn { margin-top: 10px; }

.avatar {
  --size: 30px; width: var(--size); height: var(--size); flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--text); font-weight: 500; font-size: calc(var(--size) * .38); line-height: 1;
  background: var(--hover); border: 1px solid var(--border-strong); transition: border-color .12s;
}
img.avatar { object-fit: cover; padding: 0; }
/* A few overlapping avatars: who a moodboard is shared with */
.faces { display: inline-flex; align-items: center; }
.faces .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); border-color: transparent; }
.faces .avatar:first-child { margin-left: 0; }
.faces .more { margin-left: 6px; font-size: 12px; color: var(--text-2); }

/* ---------- home: projects and moodboards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tile {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  transition: background .12s, border-color .12s;
}
.tile:hover { background: var(--hover); border-color: var(--border-strong); }
.tile:focus-visible { outline: 2px solid var(--text-2); outline-offset: 2px; }
.tile-art { aspect-ratio: 16 / 10; background: var(--chrome); border-bottom: 1px solid var(--border); display: grid; place-items: center; color: var(--text-3); overflow: hidden; }
.tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* A project shows up to three of its moodboards side by side */
.tile-art.trio { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; background: var(--border); place-items: stretch; }
.tile-art.trio > * { background: var(--chrome); display: grid; place-items: center; min-height: 0; min-width: 0; overflow: hidden; }
.tile-art.trio > :first-child { grid-row: 1 / 3; }
.tile-body { display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 14px; min-height: 60px; }
.tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tile-name { font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .icon-btn { color: var(--text-2); }
.tile.new {
  align-items: center; justify-content: center; gap: 8px; min-height: 120px; background: transparent; border-style: dashed;
  color: var(--text-2); font: inherit; font-weight: 500;
}
.tile.new:hover { color: var(--text); background: var(--surface); }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; } }

/* ---------- modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal {
  width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .5); animation: pop .15s ease-out;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 0; margin-bottom: 16px; }
.modal-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 0 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin: 6px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--chrome); }
.error { color: var(--red); font-size: 13px; margin: 0; }
.error:empty { display: none; }
.ok-msg { color: var(--text); font-size: 13px; margin: 0; }
.ok-msg:empty { display: none; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); opacity: 0; pointer-events: none; z-index: 60;
  padding: 9px 14px; border-radius: var(--radius); font-weight: 500; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  transition: opacity .15s, transform .15s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Share: people with access, and adding someone from the Hub */
.people { display: flex; flex-direction: column; margin: 0 -8px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm); }
.prow-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.prow-text strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-text span { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow select { width: auto; height: 30px; padding: 0 6px; font-size: 13px; }
.prow .role { color: var(--text-2); font-size: 13px; padding-right: 4px; }
.add-row { display: flex; gap: 8px; }
.add-input { position: relative; flex: 1; min-width: 0; }
.add-row select { width: auto; flex: none; }
.sugg {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; padding: 4px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.sugg .prow { cursor: pointer; }
.sugg .prow.hi, .sugg .prow:hover { background: var(--hover); }
.sub-head { font-size: 12px; font-weight: 500; color: var(--text-3); margin: 18px 0 6px; }
.note-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; background: var(--bg); border: 1px solid var(--border); color: var(--text-2); }
.note-line svg { margin-top: 2px; }
.choice-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow: auto; margin: 0 -8px; }
.choice { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.choice:hover { background: var(--hover); }
.choice[aria-current="true"] { color: var(--text-2); cursor: default; background: none; }
.choice span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- sign in (only off alamostudios.org; there the Hub's page is used) ---------- */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px 16px; }
.login-card { width: min(380px, 100%); padding: 32px 28px 28px; animation: pop .2s ease-out; }
.login-card h1 { font-size: 20px; }
.login-card .btn.primary { height: 38px; margin-top: 4px; }
.login-brand { margin-bottom: 24px; }
.login-foot { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; }
.login-foot .wordmark { opacity: .55; }

/* ---------- the moodboard: a free canvas ---------- */
.board-layout { height: 100vh; min-height: 0; overflow: hidden; }
.board-layout .frame { min-height: 0; }
.board-bar { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 16px 0 12px; flex: none; background: var(--chrome); border-bottom: 1px solid var(--border); }
.board-bar .crumb { color: var(--text-2); }
.board-name {
  width: auto; min-width: 60px; max-width: 46vw; height: 34px; padding: 0 8px; border-color: transparent; background: transparent;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; field-sizing: content; text-overflow: ellipsis;
}
.board-name:hover { border-color: var(--border); }
.board-name:read-only { pointer-events: none; }
#save-state { white-space: nowrap; }
#save-state.bad { color: var(--red); }

.stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden; background-color: var(--bg); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  /* A faint dot grid that moves and scales with the canvas (set from the script) */
  background-image: radial-gradient(circle, #2c2c2c 1px, transparent 1.2px);
}
.stage.panning { cursor: grabbing; }
.stage.marquee-on { cursor: crosshair; }
.world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; --k: 1; }
.item { position: absolute; border-radius: 3px; cursor: default; }
.stage.can-edit .item { cursor: move; }
.item.selected { outline: calc(2px / var(--k)) solid var(--blue); outline-offset: calc(1px / var(--k)); }
.item.busy { opacity: .55; }

.item.image { background: #1f1f1f; overflow: hidden; }
.item.image img { width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }

.item.note { padding: 14px 16px; border-radius: 4px; background: var(--note, #2b2b2b); color: var(--ink, #e8e8e8); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); font-size: 15px; line-height: 1.45; }
.note-text { min-height: 1.45em; white-space: pre-wrap; overflow-wrap: anywhere; outline: 0; }
.note-text:empty::before { content: "Write something…"; opacity: .45; }
.item.note.editing { cursor: text; }
.item.note.editing .note-text { user-select: text; -webkit-user-select: text; cursor: text; }
.item.note.plain { background: transparent; box-shadow: none; padding: 4px 6px; font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.item.note.plain.selected, .item.note.plain.editing { background: rgba(255, 255, 255, .03); }

.item.color { display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 calc(1px / var(--k)) var(--border), 0 1px 3px rgba(0, 0, 0, .35); }
.item.color .chip { flex: 1; min-height: 0; }
.item.color .hex { flex: none; padding: 7px 10px; font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.item.link { display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 8px; background: var(--surface); box-shadow: 0 0 0 calc(1px / var(--k)) var(--border), 0 1px 3px rgba(0, 0, 0, .35); overflow: hidden; }
.item.link .link-ico { width: 34px; height: 34px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--hover); color: var(--text-2); }
.item.link .link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.item.link strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.link span { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.link a { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm); color: var(--text-2); cursor: pointer; }
.item.link a:hover { background: var(--hover); color: var(--text); }

/* Resize handles on the one selected thing; they keep their size on screen at any zoom */
.handle {
  position: absolute; width: calc(11px / var(--k)); height: calc(11px / var(--k)); border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 calc(1.5px / var(--k)) var(--blue); z-index: 2;
}
.handle.nw { left: calc(-6.5px / var(--k)); top: calc(-6.5px / var(--k)); cursor: nwse-resize; }
.handle.ne { right: calc(-6.5px / var(--k)); top: calc(-6.5px / var(--k)); cursor: nesw-resize; }
.handle.sw { left: calc(-6.5px / var(--k)); bottom: calc(-6.5px / var(--k)); cursor: nesw-resize; }
.handle.se { right: calc(-6.5px / var(--k)); bottom: calc(-6.5px / var(--k)); cursor: nwse-resize; }
.item.image .handle, .item.color .handle, .item.link .handle { overflow: visible; }
.item.image, .item.color, .item.link { overflow: visible; }
.item.image img { border-radius: 3px; }
.item.color .chip { border-radius: 6px 6px 0 0; }

.marquee { position: absolute; z-index: 5; border: 1px solid var(--blue); background: rgba(10, 99, 224, .12); pointer-events: none; }

/* Floating controls over the canvas */
.float {
  position: absolute; z-index: 10; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 10px; cursor: default;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.float .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; min-width: 34px; padding: 0 9px; border-radius: 7px;
  background: none; border: 0; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tool:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.tool:disabled { opacity: .35; cursor: default; }
.tool.danger:hover { color: var(--red); background: var(--red-soft); }
.tools { left: 50%; bottom: 18px; transform: translateX(-50%); }
.zoom { right: 16px; bottom: 18px; }
.zoom .tool { padding: 0 6px; }
#zoom-pct { min-width: 52px; font-variant-numeric: tabular-nums; }
.sel-bar { transform: translate(-50%, -100%); animation: fade .1s; }
.dot { width: 22px; height: 22px; margin: 0 3px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: var(--c); cursor: pointer; }
.dot:hover { border-color: #fff; }
.dot.plain { background: transparent; color: var(--text-2); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }
.stage-empty {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 1; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--text-2); width: min(420px, 86vw);
}
.stage-empty strong { color: var(--text); font-weight: 500; font-size: 16px; }
.stage-empty svg { color: var(--text-3); margin-bottom: 6px; }
.drop-veil { position: absolute; inset: 10px; z-index: 12; border: 2px dashed var(--text-2); border-radius: 12px; background: rgba(20, 20, 20, .7); display: grid; place-items: center; font-size: 16px; font-weight: 500; pointer-events: none; }
kbd { font: inherit; font-size: 12px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }

@media (max-width: 760px) {
  .board-layout { height: 100dvh; }
  .board-layout .frame { padding-bottom: 64px; }
  .board-bar { height: 56px; padding: 0 8px; gap: 6px; }
  .board-bar .crumb, #save-state, .board-bar .faces { display: none; }
  .tools { bottom: 12px; }
  .tool .label { display: none; }
  .zoom { right: 8px; bottom: 64px; flex-direction: column; }
  .zoom .sep { width: 20px; height: 1px; margin: 4px 0; }
}
