:root {
  --bg0: #050814;
  --bg1: #081426;
  --glass: rgba(9, 22, 42, .72);
  --glass2: rgba(13, 31, 56, .86);
  --stroke: rgba(91, 164, 255, .22);
  --blue: #3b89ff;
  --blue2: #22d3ff;
  --orange: #ff8a1f;
  --text: #eaf3ff;
  --muted: #8da5c5;
  --danger: #ff4d5e;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 10%, rgba(59, 137, 255, .22), transparent 24%),
    radial-gradient(circle at 76% 18%, rgba(255, 138, 31, .18), transparent 22%),
    radial-gradient(circle at 52% 88%, rgba(34, 211, 255, .10), transparent 34%),
    linear-gradient(135deg, var(--bg0), var(--bg1) 48%, #090b12);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 78%);
  pointer-events: none;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: 0 22px 80px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(18px);
}

.app-shell { height: 100%; display: flex; gap: 16px; padding: 16px; }
.leftbar {
  width: 310px;
  border-radius: 24px;
  padding: 16px;
  overflow: auto;
}
.brand { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-icon, .brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 900; letter-spacing: -.08em;
  background: linear-gradient(135deg, var(--blue), var(--orange));
  color: #07111f;
  box-shadow: 0 0 24px rgba(59,137,255,.28);
}
.brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.tool-section { margin-top: 16px; }
label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; text-transform: uppercase; letter-spacing: .08em; }
input[type="text"], input[type="password"], .title-input {
  width: 100%; border: 1px solid rgba(91,164,255,.22); outline: none;
  background: rgba(0,0,0,.22); color: var(--text); border-radius: 12px;
  padding: 11px 12px; font-weight: 700;
}
input + label { margin-top: 10px; }
button {
  border: 1px solid rgba(91,164,255,.24);
  background: rgba(14, 33, 62, .82);
  color: var(--text); border-radius: 12px;
  padding: 10px 12px; cursor: pointer; font-weight: 800;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
button:hover { transform: translateY(-1px); border-color: rgba(255,138,31,.72); }
button.primary { width: 100%; margin-top: 10px; background: linear-gradient(135deg, rgba(59,137,255,.96), rgba(255,138,31,.92)); color: #06101d; }
button.danger { border-color: rgba(255,77,94,.42); }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-grid.compact { grid-template-columns: repeat(4, 1fr); }
.tool.active, .preset.active { border-color: var(--orange); box-shadow: 0 0 0 1px rgba(255,138,31,.3) inset; }
.inline-controls input[type="color"] { width: 100%; height: 40px; border: none; background: transparent; }
.inline-controls input[type="range"] { width: 100%; }
.actions { display: grid; gap: 8px; }
#bgInput { width: 100%; color: var(--muted); }
#clearBgBtn { width: 100%; margin-top: 8px; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.topbar { border-radius: 24px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.title-input { max-width: 620px; font-size: 20px; padding: 8px 10px; border-color: transparent; background: transparent; }
.title-input:focus { border-color: rgba(91,164,255,.28); background: rgba(0,0,0,.18); }
.meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; margin-left: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.online { background: #4dff9b; box-shadow: 0 0 14px rgba(77,255,155,.7); }
.dot.offline { background: #ff4d5e; }
.presence { min-width: 210px; }
.presence strong { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
#peopleList { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.person { padding: 5px 8px; border-radius: 999px; background: rgba(59,137,255,.16); border: 1px solid rgba(59,137,255,.24); font-size: 12px; }

.board-frame { position: relative; flex: 1; border-radius: 26px; overflow: hidden; }
#board { width: 100%; height: 100%; display: block; cursor: crosshair; background: rgba(3, 9, 19, .78); }
.hint {
  position: absolute; left: 18px; bottom: 18px; padding: 9px 12px; border-radius: 14px;
  color: var(--muted); background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.08);
  font-size: 13px; pointer-events: none;
}
#cursors { position: absolute; inset: 0; pointer-events: none; }
.cursor {
  position: absolute; transform: translate(-2px, -2px); font-size: 11px; color: var(--text);
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.cursor::before {
  content: ""; display: block; width: 10px; height: 10px; border-left: 2px solid var(--orange); border-top: 2px solid var(--orange); transform: rotate(-45deg);
}
.cursor span { display: inline-block; padding: 3px 6px; border-radius: 999px; background: rgba(255,138,31,.92); color: #07111f; font-weight: 900; margin-left: 8px; }

.gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(2,6,14,.84); backdrop-filter: blur(16px); }
.gate.hidden { display: none; }
.gate-card { width: min(420px, 92vw); border-radius: 28px; padding: 28px; background: var(--glass2); border: 1px solid var(--stroke); box-shadow: 0 30px 120px rgba(0,0,0,.55); }
.gate-card h1 { margin: 16px 0 6px; }
.gate-card p { color: var(--muted); }
.gate-card button { width: 100%; margin-top: 12px; background: linear-gradient(135deg, var(--blue), var(--orange)); color: #06101d; }
.gate-card small { color: var(--muted); display: block; margin-top: 12px; }
code { color: var(--orange); }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; overflow: auto; }
  .leftbar { width: 100%; max-height: 320px; }
  .workspace { min-height: 70vh; }
  .topbar { flex-direction: column; align-items: stretch; }
}

/* EdgeFX v2: icon tools, trading preset icons, selection state, collapsible sidebar */
.brand-copy { min-width: 0; flex: 1; }
.collapse-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
  margin-left: auto;
  background: rgba(0,0,0,.18);
}

.leftbar { transition: width .18s ease, padding .18s ease; }
.app-shell.sidebar-collapsed .leftbar { width: 82px; padding: 12px; overflow: visible; }
.app-shell.sidebar-collapsed .brand { justify-content: center; padding-bottom: 12px; }
.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .tool-section label,
.app-shell.sidebar-collapsed .tool-label,
.app-shell.sidebar-collapsed .tool-section input,
.app-shell.sidebar-collapsed .tool-section .primary,
.app-shell.sidebar-collapsed .tool-section.inline-controls,
.app-shell.sidebar-collapsed .tool-section.actions,
.app-shell.sidebar-collapsed #bgInput,
.app-shell.sidebar-collapsed #clearBgBtn { display: none; }
.app-shell.sidebar-collapsed .collapse-btn { position: absolute; left: 58px; top: 20px; z-index: 3; }
.app-shell.sidebar-collapsed .collapse-btn span { transform: rotate(180deg); display: inline-block; }
.app-shell.sidebar-collapsed .tool-grid { grid-template-columns: 1fr; }
.app-shell.sidebar-collapsed .preset-grid { grid-template-columns: 1fr; }
.app-shell.sidebar-collapsed .tool,
.app-shell.sidebar-collapsed .preset { justify-content: center; padding: 10px; }
.app-shell.sidebar-collapsed .preset span:not(.preset-ico) { display: none; }

.tool {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 48px;
  text-align: left;
}
.tool-ico {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(59,137,255,.14), rgba(255,138,31,.12));
  border: 1px solid rgba(91,164,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  color: #dcecff;
}
.tool-ico svg { width: 18px; height: 18px; display: block; }
.tool-label { font-size: 13px; font-weight: 800; letter-spacing: .01em; }
.tool:hover .tool-ico {
  border-color: rgba(255,138,31,.5);
  box-shadow: 0 0 16px rgba(255,138,31,.12), inset 0 1px 0 rgba(255,255,255,.05);
}
.tool.active {
  background: linear-gradient(135deg, rgba(22,42,72,.95), rgba(18,34,58,.95));
}
.tool.active .tool-ico {
  background: linear-gradient(135deg, rgba(59,137,255,.22), rgba(255,138,31,.20));
  border-color: rgba(255,138,31,.55);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(255,138,31,.14), inset 0 1px 0 rgba(255,255,255,.08);
}

.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 58px;
  padding: 8px 6px;
  font-size: 11px;
  letter-spacing: .02em;
}
.preset-ico {
  width: 30px;
  height: 20px;
  display: block;
  position: relative;
  border-radius: 7px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
}
.preset-ico.zone-lvn { border-color: rgba(34,211,255,.68); background: rgba(34,211,255,.10); }
.preset-ico.zone-lvn::after {
  content: ""; position: absolute; left: 7px; right: 7px; top: 8px; height: 3px; border-radius: 99px; background: var(--blue2);
}
.preset-ico.zone-hvn { border-color: rgba(255,138,31,.70); background: rgba(255,138,31,.12); }
.preset-ico.zone-hvn::after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 6px; height: 7px; border-radius: 99px; background: rgba(255,138,31,.88);
}
.preset-ico.line-poc,
.preset-ico.line-vah,
.preset-ico.line-val { border-color: transparent; background: transparent; }
.preset-ico.line-poc::before,
.preset-ico.line-vah::before,
.preset-ico.line-val::before {
  content: ""; position: absolute; left: 2px; right: 2px; top: 9px; height: 3px; border-radius: 99px;
}
.preset-ico.line-poc::before { background: var(--orange); box-shadow: 0 0 12px rgba(255,138,31,.35); }
.preset-ico.line-vah::before { background: var(--blue); }
.preset-ico.line-val::before { background: var(--blue); }
.preset-ico.line-vah::after,
.preset-ico.line-val::after {
  position: absolute; right: 0; top: -2px; color: var(--blue); font-size: 10px; font-weight: 900;
}
.preset-ico.line-vah::after { content: "H"; }
.preset-ico.line-val::after { content: "L"; }
.preset-ico.marker-entry,
.preset-ico.marker-sl,
.preset-ico.marker-tp { border: 0; background: transparent; }
.preset-ico.marker-entry::before {
  content: ""; position: absolute; left: 4px; top: 9px; width: 22px; height: 3px; border-radius: 99px; background: #4dff9b; transform: rotate(-24deg);
}
.preset-ico.marker-entry::after {
  content: ""; position: absolute; right: 3px; top: 5px; width: 8px; height: 8px; border-top: 3px solid #4dff9b; border-right: 3px solid #4dff9b; transform: rotate(21deg);
}
.preset-ico.marker-sl::before,
.preset-ico.marker-sl::after {
  content: ""; position: absolute; left: 5px; right: 5px; top: 9px; height: 3px; border-radius: 99px; background: var(--danger);
}
.preset-ico.marker-sl::before { transform: rotate(38deg); }
.preset-ico.marker-sl::after { transform: rotate(-38deg); }
.preset-ico.marker-tp::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: 4px; height: 12px; border: 2px solid #ffd166; border-left: 0; border-radius: 0 8px 8px 0;
}
.preset.active .preset-ico { filter: drop-shadow(0 0 10px rgba(255,138,31,.25)); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--text);
  background: rgba(6, 18, 35, .92);
  border: 1px solid rgba(91,164,255,.26);
  box-shadow: 0 18px 60px rgba(0,0,0,.42);
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

#board.selecting { cursor: default; }
#board.eraser { cursor: not-allowed; }

@media (max-width: 900px) {
  .preset-grid { grid-template-columns: repeat(4, 1fr); }
  .app-shell.sidebar-collapsed .leftbar { width: 100%; }
}


/* ===== EdgeFX v3 premium UI overrides ===== */
:root {
  --edge-blue: #2f83ff;
  --edge-cyan: #28d6ff;
  --edge-orange: #ff8a1f;
  --edge-deep: #07101f;
  --edge-panel: rgba(7, 18, 35, .82);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,138,31,.78) rgba(10,24,45,.58);
}

*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(7,18,35,.72), rgba(5,10,22,.82));
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(47,131,255,.95), rgba(255,138,31,.92));
  border-radius: 999px;
  border: 2px solid rgba(7,18,35,.92);
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(40,214,255,1), rgba(255,138,31,1));
}

::selection {
  background: rgba(255,138,31,.32);
  color: #fff;
}

body,
button,
input,
select,
textarea {
  font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.leftbar {
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .22s ease, padding .22s ease, border-radius .22s ease;
}

button.ghost {
  background: rgba(6, 16, 32, .45);
  border-color: rgba(91,164,255,.18);
  color: rgba(234,243,255,.72);
}

button.ghost:hover {
  color: #fff;
  border-color: rgba(40,214,255,.45);
}

.tool-grid {
  gap: 9px;
}

.tool,
.preset {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(91,164,255,.18);
  background:
    linear-gradient(135deg, rgba(20,45,82,.82), rgba(8,18,34,.92)),
    radial-gradient(circle at 20% 0%, rgba(40,214,255,.12), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.055),
    0 10px 28px rgba(0,0,0,.14);
}

.tool::before,
.preset::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  opacity: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(40,214,255,.22), transparent 36%),
    radial-gradient(circle at 88% 85%, rgba(255,138,31,.18), transparent 42%);
  transition: opacity .16s ease;
}

.tool:hover::before,
.preset:hover::before,
.tool.active::before,
.preset.active::before {
  opacity: 1;
}

.tool {
  min-height: 50px;
  gap: 11px;
}

.tool-ico,
.preset-ico {
  position: relative;
  overflow: hidden;
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.018)),
    radial-gradient(circle at 28% 18%, rgba(40,214,255,.20), transparent 44%),
    radial-gradient(circle at 78% 92%, rgba(255,138,31,.16), transparent 50%);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -14px 28px rgba(0,0,0,.18),
    0 8px 22px rgba(0,0,0,.22);
}

.tool-ico::after,
.preset-ico::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.22), transparent 36%);
  opacity: .35;
  pointer-events: none;
}

.tool-ico {
  width: 32px;
  height: 32px;
  min-width: 32px;
}

.tool-ico svg {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 7px rgba(40,214,255,.18));
}

.tool-ico.accent-orange svg { filter: drop-shadow(0 0 8px rgba(255,138,31,.20)); }
.tool-ico.accent-danger svg { filter: drop-shadow(0 0 8px rgba(255,77,94,.22)); }

.ico-stroke {
  stroke: rgba(230,242,255,.94);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-stroke.hot { stroke: var(--edge-orange); }
.ico-fill-soft { fill: rgba(59,137,255,.08); }
.ico-fill { fill: rgba(230,242,255,.92); }
.hot-fill { fill: var(--edge-orange); }

.tool-label {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .01em;
}

.tool.active,
.preset.active {
  border-color: rgba(255,138,31,.72);
  box-shadow:
    0 0 0 1px rgba(255,138,31,.26) inset,
    0 0 24px rgba(255,138,31,.10),
    0 12px 30px rgba(0,0,0,.20);
}

.tool.active .tool-ico,
.preset.active .preset-ico {
  border-color: rgba(255,138,31,.64);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    0 0 22px rgba(255,138,31,.18),
    0 8px 22px rgba(0,0,0,.28);
}

.preset-grid {
  gap: 8px;
}

.preset {
  min-height: 62px;
  padding: 8px 5px;
  font-size: 10.5px;
  font-weight: 900;
}

.premium-preset {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.premium-preset svg {
  width: 25px;
  height: 25px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(40,214,255,.16));
}

.preset-box {
  fill: rgba(40,214,255,.06);
  stroke: rgba(230,242,255,.42);
  stroke-width: 1.5;
  rx: 3;
}
.preset-box.soft { fill: rgba(59,137,255,.045); }
.preset-gridline {
  stroke: rgba(141,165,197,.46);
  stroke-width: 1.4;
  stroke-linecap: round;
}
.preset-line {
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.preset-line.cyan { stroke: var(--edge-cyan); }
.preset-line.orange { stroke: var(--edge-orange); }
.preset-line.green { stroke: #4dff9b; }
.preset-line.red { stroke: #ff4d5e; }
.preset-line.gold { stroke: #ffd166; }
.preset-line.hot { filter: drop-shadow(0 0 6px currentColor); }
.preset-dot.orange-fill { fill: var(--edge-orange); }
.preset-dot.green-fill { fill: #4dff9b; }
.preset-ring.gold {
  stroke: #ffd166;
  stroke-width: 2.2;
  fill: rgba(255,209,102,.06);
}
.preset-ring.hot { filter: drop-shadow(0 0 7px rgba(255,209,102,.35)); }

.app-shell.sidebar-collapsed {
  gap: 12px;
}

.app-shell.sidebar-collapsed .leftbar {
  width: 62px;
  padding: 10px 7px;
  border-radius: 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.app-shell.sidebar-collapsed .brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 11px;
}

.app-shell.sidebar-collapsed .brand {
  gap: 0;
  padding-bottom: 10px;
}

.app-shell.sidebar-collapsed .collapse-btn {
  left: 43px;
  top: 14px;
  width: 23px;
  height: 23px;
  border-radius: 9px;
  padding: 0;
}

.app-shell.sidebar-collapsed .tool-section {
  margin-top: 11px;
}

.app-shell.sidebar-collapsed .tool-grid,
.app-shell.sidebar-collapsed .preset-grid {
  gap: 6px;
}

.app-shell.sidebar-collapsed .tool,
.app-shell.sidebar-collapsed .preset {
  min-height: 32px;
  padding: 4px;
  border-radius: 11px;
}

.app-shell.sidebar-collapsed .tool-ico {
  width: 17px;
  height: 17px;
  min-width: 17px;
  border-radius: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.11),
    0 4px 12px rgba(0,0,0,.18);
}

.app-shell.sidebar-collapsed .tool-ico svg {
  width: 11px;
  height: 11px;
}

.app-shell.sidebar-collapsed .preset-ico {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 6px;
}

.app-shell.sidebar-collapsed .preset-ico svg {
  width: 13px;
  height: 13px;
}

.app-shell.sidebar-collapsed .preset {
  min-height: 31px;
}

.app-shell.sidebar-collapsed .tool:hover,
.app-shell.sidebar-collapsed .preset:hover {
  transform: translateX(1px);
}

.hint::after {
  content: "  Shift: linia poziom/pion, box jako kwadrat.";
  color: rgba(255,138,31,.88);
}



/* ===== EdgeFX Whiteboard v4 behaviour + radii overrides ===== */
:root {
  --radius-large: 10px;
  --radius-small: 3px;
}

.glass,
.leftbar,
.topbar,
.board-frame,
.gate-card,
button,
input[type="text"],
input[type="password"],
.title-input,
.person,
.hint,
.toast,
details,
summary {
  border-radius: var(--radius-large) !important;
}

.brand-icon,
.brand-mark,
.tool-ico,
.preset-ico,
.shortcut-input,
.dot,
.cursor span {
  border-radius: var(--radius-small) !important;
}

.tool,
.preset {
  border-radius: var(--radius-large) !important;
}

#board.pen-cursor {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='7' cy='7' r='3.2' fill='%23ff8a1f' stroke='%2328d6ff' stroke-width='1.2'/%3E%3C/svg%3E") 7 7, auto;
}

#board.draw-cursor {
  cursor: crosshair;
}

#board.hand-cursor {
  cursor: grab;
}

#board.hand-cursor.panning {
  cursor: grabbing;
}

#board.selecting {
  cursor: default;
}

#board.eraser {
  cursor: not-allowed;
}

.shortcut-settings details {
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(91,164,255,.16);
  padding: 9px;
}

.shortcut-settings summary {
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 900;
  color: var(--text);
  padding: 5px 2px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.shortcut-grid label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.shortcut-input {
  display: block;
  margin-top: 5px;
  width: 100%;
  height: 32px;
  text-align: center;
  padding: 6px;
  font-weight: 900;
  text-transform: uppercase;
}

.shortcut-settings small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 8px;
}

.shortcut-settings button {
  width: 100%;
  margin-top: 6px;
}

.app-shell.sidebar-collapsed .shortcut-settings {
  display: none;
}

.app-shell.sidebar-collapsed .leftbar {
  width: 62px !important;
}

.app-shell.sidebar-collapsed .tool-ico {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
}

.app-shell.sidebar-collapsed .tool-ico svg {
  width: 11px !important;
  height: 11px !important;
}

.app-shell.sidebar-collapsed .preset-ico {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
}

.app-shell.sidebar-collapsed .preset-ico svg {
  width: 13px !important;
  height: 13px !important;
}

/* Hide old duplicate cursor declarations from lower specificity while keeping explicit v4 classes above */
