:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  --ink: #182033;
  --muted: #64748b;
  --line: #d9e2ef;
  --panel: #f8fafc;
  --accent: #0f8b8d;
  --accent-dark: #0b6466;
  --danger: #c2410c;
  --paper: #fffdf7;
  --page-width: 794px;
  --page-height: 1123px;
  --page-display-height: 1123px;
  --grid-size: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #edf2f7;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  min-height: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 12px 18px;
  border-bottom: 1px solid #cbd5e1;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.room-control,
.palette-control,
.size-control {
  display: grid;
  gap: 5px;
}

.room-control input {
  width: 150px;
  height: 36px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
}

.tool-group,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eraser-picker,
.palette-control {
  position: relative;
}

.brand,
.room-control,
.figure-picker,
.palette-control,
.size-control {
  flex-shrink: 0;
}

.tool-button,
.icon-button,
.secondary-button,
.danger-button {
  height: 38px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.tool-button,
.icon-button {
  width: 42px;
  font-size: 20px;
}

.tool-button.active {
  border-color: var(--accent);
  background: #dff5f3;
  color: var(--accent-dark);
}

.eraser-picker {
  display: flex;
  align-items: center;
  gap: 4px;
}

.split-toggle,
.palette-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 38px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: white;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.eraser-panel,
.color-panel {
  position: absolute;
  top: calc(100% + 10px);
  z-index: 9;
  display: none;
  padding: 10px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
}

.eraser-panel {
  left: 0;
  min-width: 128px;
  gap: 6px;
}

.eraser-panel.open {
  display: grid;
}

.eraser-option {
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.eraser-option.active {
  border-color: var(--accent);
  background: #dff5f3;
  color: var(--accent-dark);
}

.danger-button {
  padding: 0 14px;
  color: var(--danger);
  font-weight: 700;
}

.secondary-button {
  padding: 0 14px;
  color: var(--teal);
  font-weight: 700;
}

.nav-link {
  display: inline-flex;
  align-items: center;
}

.pages-button {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: white;
  color: var(--accent-dark);
  font-weight: 700;
  cursor: pointer;
}

.figure-picker {
  position: relative;
}

.line-button {
  font-size: 24px;
  line-height: 1;
}

.line-button.dashed {
  letter-spacing: 2px;
}

.figure-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 8;
  display: none;
  grid-template-columns: repeat(4, 64px);
  gap: 8px;
  width: max-content;
  max-width: min(420px, 70vw);
  max-height: 320px;
  padding: 10px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
  overflow: auto;
}

.figure-panel.open {
  display: grid;
}

.figure-thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  overflow: hidden;
}

.figure-thumb img {
  max-width: 56px;
  max-height: 56px;
  object-fit: contain;
}

.color-palette {
  display: flex;
  align-items: center;
  gap: 6px;
}

.palette-quick {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-panel {
  left: 0;
  width: max-content;
  max-width: min(280px, 72vw);
  gap: 10px;
}

.color-panel.open {
  display: flex;
  align-items: center;
}

.panel-palette {
  max-width: 204px;
  flex-wrap: wrap;
}

.color-swatch,
.add-color {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #bfccd9;
  cursor: pointer;
}

.color-swatch {
  background: var(--swatch-color);
}

.color-swatch.active {
  box-shadow: 0 0 0 2px var(--accent);
}

.add-color {
  position: relative;
  background: white;
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1;
}

.add-color input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.size-control input {
  width: 130px;
  accent-color: var(--accent);
}

.board-wrap {
  position: relative;
  min-height: 0;
  overflow: auto;
  background: #d7e0ea;
}

.page-map-toggle {
  position: fixed;
  top: 96px;
  left: 12px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: white;
  color: var(--accent-dark);
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  cursor: pointer;
}

.panel-toggle {
  position: fixed;
  top: 96px;
  z-index: 6;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: white;
  color: var(--accent-dark);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  cursor: pointer;
}

.participants-toggle {
  right: 16px;
}

.page-map {
  position: fixed;
  top: 144px;
  left: 318px;
  z-index: 5;
  width: 140px;
  max-height: calc(100vh - 160px);
  padding: 10px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.94);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
  overflow: auto;
  transform: translateX(-520px);
  transition: transform 160ms ease;
  pointer-events: none;
}

.side-panel {
  position: fixed;
  top: 144px;
  z-index: 5;
  display: grid;
  gap: 14px;
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - 160px);
  padding: 14px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
  overflow: auto;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.side-panel.open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.structure-panel {
  left: 16px;
  width: 288px;
  transform: translateX(-328px);
}

.structure-panel.open {
  transform: translateX(0);
}

.participants-panel {
  right: 16px;
}

.side-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.side-panel-head strong {
  font-size: 16px;
}

.structure-root-link {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: white;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.structure-root-link.active {
  border-color: var(--accent);
  background: #dff5f3;
}

.structure-action {
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.inline-action {
  margin-top: 4px;
  border-style: dashed;
  background: #f8fafc;
}

.folder-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.folder-action-row .structure-action {
  flex: 0 0 auto;
}

.folder-action-row .structure-action[open] {
  flex-basis: 100%;
}

.structure-action summary {
  padding: 11px 12px;
  color: var(--accent-dark);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.icon-action {
  width: max-content;
  max-width: 100%;
}

.icon-action summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 44px;
  min-height: 36px;
  padding: 6px 9px;
  font-size: 16px;
  line-height: 1;
}

.icon-action[open] {
  width: 100%;
}

.icon-action[open] summary {
  width: 100%;
  justify-content: flex-start;
}

.structure-action summary::-webkit-details-marker {
  display: none;
}

.structure-action[open] summary {
  border-bottom: 1px solid #d7e0ea;
  background: #f8fafc;
}

.mini-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: white;
}

.mini-form label {
  display: grid;
  gap: 6px;
}

.mini-form input,
.mini-form select {
  height: 40px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.mini-form.compact {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
  width: 100%;
}

.mini-form.compact input {
  min-width: 0;
  width: 100%;
}

.structure-tree,
.participants-list {
  display: grid;
  gap: 12px;
}

.tree-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: white;
}

.folder-group {
  padding: 0;
  overflow: hidden;
}

.folder-group.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 139, 141, 0.12);
}

.folder-group details {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.folder-group details[open] > .tree-pages {
  margin-left: 10px;
  padding-left: 12px;
  border-left: 2px solid #d7e0ea;
}

.tree-folder-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.tree-folder-title::before {
  content: "▸";
  color: var(--muted);
  font-size: 12px;
  transition: transform 140ms ease;
}

.folder-group details[open] > .tree-folder-title::before {
  transform: rotate(90deg);
}

.tree-folder-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-item-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

.tree-item-main > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-icon {
  flex: 0 0 auto;
  width: 18px;
  text-align: center;
}

.tree-folder-title small {
  color: var(--muted);
  font-size: 12px;
}

.tree-folder-title.selected,
.tree-group-title.selected,
.tree-document-button.selected {
  border-color: var(--accent);
  background: #dff5f3;
  color: var(--accent-dark);
}

.tree-group-title.selected {
  padding: 8px 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
}

.folder-group .folder-group {
  margin-top: 8px;
  background: #f8fafc;
}

.tree-group-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.tree-pages {
  display: grid;
  gap: 8px;
}

.tree-empty {
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.tree-page-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
}

.tree-document-button {
  background: white;
}

.tree-document-button:hover,
.tree-folder-title:hover {
  border-color: var(--accent);
  background: #eefaf9;
}

.tree-page-button small {
  color: var(--muted);
}

.participant-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: white;
}

.invite-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: white;
}

.invite-box summary {
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.invite-list {
  display: grid;
  gap: 10px;
}

.invite-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.invite-card.disabled {
  opacity: 0.58;
}

.invite-card div {
  display: grid;
  gap: 2px;
}

.invite-card span,
.invite-disabled {
  color: var(--muted);
  font-size: 12px;
}

.invite-card input {
  width: 100%;
  height: 34px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  padding: 0 8px;
  color: var(--ink);
  font-size: 12px;
}

.invite-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.invite-copy-button {
  height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.participant-permission-form {
  display: grid;
}

.participant-empty {
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  text-align: center;
}

.participant-main {
  display: grid;
  gap: 3px;
}

.participant-main span {
  color: var(--muted);
  font-size: 12px;
}

.participant-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.full-width {
  width: 100%;
}

.hidden-form {
  display: none;
}

.page-map.open {
  transform: translateX(0);
  pointer-events: auto;
}

.page-map-head {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.page-list {
  display: grid;
  gap: 10px;
}

.page-thumb {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.page-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 139, 141, 0.18);
}

.page-thumb canvas {
  width: 100%;
  aspect-ratio: 794 / 1123;
  border: 1px solid #d6deea;
  border-radius: 4px;
  background: var(--paper);
}

.page-thumb span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.board-surface {
  position: relative;
  margin: 0 auto;
  width: var(--page-width);
  min-width: var(--page-width);
  height: calc(var(--page-height) * 4);
  background:
    linear-gradient(to bottom, transparent calc(var(--page-display-height) - 12px), rgba(15, 23, 42, 0.18) calc(var(--page-display-height) - 12px), rgba(15, 23, 42, 0.18) calc(var(--page-display-height) - 10px), transparent calc(var(--page-display-height) - 10px)),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--paper);
  background-size: 100% var(--page-display-height), var(--grid-size) var(--grid-size), var(--grid-size) var(--grid-size), auto;
  box-shadow: inset 0 18px 26px rgba(15, 23, 42, 0.08);
}

#imageBoard,
#board,
#localBoard,
#liveBoard,
#localInkSvg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#imageBoard {
  z-index: 0;
}

#board {
  z-index: 1;
  cursor: crosshair;
}

#localBoard {
  z-index: 2;
  pointer-events: none;
}

#liveBoard {
  z-index: 3;
  pointer-events: none;
}

#localInkSvg {
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.cursors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.remote-cursor {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 4px;
  transform: translate(-2px, -2px);
  transition: left 70ms linear, top 70ms linear;
  z-index: 2;
}

.remote-cursor::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 14px solid var(--cursor-color, var(--accent));
  border-right: 10px solid transparent;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.32));
}

.remote-cursor span {
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--cursor-color, var(--accent));
  color: white;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.add-page-button {
  position: absolute;
  left: 50%;
  top: calc(var(--page-height) * 4 - 82px);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid #0b6466;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  transform: translateX(-50%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  cursor: pointer;
}

.add-page-button:hover {
  background: var(--accent-dark);
}

.zoom-controls {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.zoom-value {
  min-width: 52px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.auth-body,
.dashboard-body {
  overflow: auto;
}

.auth-shell,
.dashboard-shell {
  min-height: 100vh;
  padding: 32px 20px;
}

.auth-shell {
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.auth-brand {
  margin-bottom: 22px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form input {
  height: 42px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.submit-button {
  height: 42px;
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-shell {
  display: grid;
  gap: 20px;
}

.create-board-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.section-head strong {
  display: block;
  font-size: 18px;
}

.create-board-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.create-board-form label {
  display: grid;
  gap: 7px;
}

.create-board-form input {
  height: 42px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.wide-field {
  min-width: 0;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 190px));
  gap: 16px;
  justify-content: start;
}

.board-card,
.empty-state {
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.board-card {
  aspect-ratio: 1 / 1;
  align-content: start;
}

.board-card-top,
.board-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.board-role {
  padding: 4px 8px;
  border-radius: 999px;
  background: #dff5f3;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.flash-stack {
  display: grid;
  gap: 10px;
}

.flash-message {
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 600;
}

.flash-message.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #9f1239;
}

.flash-message.success {
  border-color: #99f6e4;
  background: #ecfeff;
  color: #0f766e;
}

@media (max-width: 860px) {
  .toolbar {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(130px, 180px) auto;
    align-items: start;
    gap: 10px 12px;
  }

  .brand {
    min-width: 0;
    grid-column: 1 / 2;
  }

  .room-control {
    grid-column: 2 / 3;
  }

  .tool-group {
    grid-column: 3 / 4;
    justify-self: end;
  }

  .figure-picker,
  .palette-control,
  .size-control,
  .actions {
    grid-column: span 1;
  }

  .figure-picker {
    grid-column: 1 / 2;
  }

  .palette-control {
    grid-column: 2 / 4;
    min-width: 0;
  }

  .actions {
    justify-self: end;
  }

  .room-control input {
    width: 100%;
  }

  .size-control input {
    width: min(100%, 180px);
  }

  .color-palette {
    flex-wrap: wrap;
  }

  .create-board-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .brand {
    grid-column: 1 / -1;
  }

  .room-control,
  .tool-group,
  .figure-picker,
  .palette-control,
  .size-control,
  .actions {
    grid-column: span 1;
    justify-self: stretch;
  }

  .tool-group,
  .actions {
    justify-self: end;
  }

  .palette-control {
    grid-column: 1 / -1;
  }
}
