.boards-page {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.boards-page > * {
  min-width: 0;
}

.boards-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.boards-head h3 {
  margin: 0;
}

.boards-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
  min-width: 0;
}

.boards-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.boards-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.boards-tools-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.boards-tools-panel__head {
  font-weight: 700;
  font-size: 13px;
}

.boards-tools-panel__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.boards-page .field,
.boards-page .select,
.boards-page .textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 158, 11, 0.12), transparent 58%),
    var(--panel-soft);
  color: var(--text);
  margin: 0;
}

.boards-modal .field,
.boards-modal .select,
.boards-modal .textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 158, 11, 0.12), transparent 58%),
    var(--panel-soft);
  color: var(--text);
  margin: 0;
}

.boards-modal .field::placeholder {
  color: var(--muted);
}

.boards-modal input[type="url"],
.boards-modal input[type="email"],
.boards-modal input[type="text"] {
  appearance: none;
  -webkit-appearance: none;
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 158, 11, 0.12), transparent 58%),
    var(--panel-soft);
  color: var(--text);
}

.boards-modal .field:focus,
.boards-modal .select:focus,
.boards-modal .textarea:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.16);
}

.boards-modal input:-webkit-autofill,
.boards-modal input:-webkit-autofill:hover,
.boards-modal input:-webkit-autofill:focus,
.boards-modal textarea:-webkit-autofill,
.boards-modal textarea:-webkit-autofill:hover,
.boards-modal textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: 0 0 0 1000px var(--panel-soft) inset;
}

.boards-page .field::placeholder {
  color: var(--muted);
}

.boards-page .field:focus,
.boards-page .select:focus,
.boards-page .textarea:focus {
  outline: none;
  border-color: rgba(138, 180, 248, 0.6);
  box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.16);
}

.boards-tools-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.boards-toolbar .btn-sm {
  min-height: 36px;
}

.boards-shape-select {
  min-width: 150px;
  min-height: 36px;
}

.boards-page input.boards-draw-color,
.boards-modal input.boards-draw-color {
  width: 78px;
  min-width: 78px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  appearance: auto;
  -webkit-appearance: auto;
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
}

.boards-page input.boards-draw-color::-webkit-color-swatch-wrapper,
.boards-modal input.boards-draw-color::-webkit-color-swatch-wrapper {
  padding: 6px;
  border-radius: 999px;
}

.boards-page input.boards-draw-color::-webkit-color-swatch,
.boards-modal input.boards-draw-color::-webkit-color-swatch {
  border: 0;
  border-radius: 999px;
}

.boards-page input.boards-draw-color::-moz-color-swatch,
.boards-modal input.boards-draw-color::-moz-color-swatch {
  border: 0;
  border-radius: 999px;
}

.boards-color-presets {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.boards-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: var(--dot, #ff9f1c);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(0, 0, 0, 0.26);
  cursor: pointer;
  padding: 0;
}

.boards-color-dot:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.2),
    0 0 0 2px rgba(245, 158, 11, 0.2);
}

.boards-color-picker {
  display: grid;
  gap: 8px;
}

.boards-color-preview {
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.boards-color-rgb__inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.boards-draw-width {
  width: 150px;
  min-height: 36px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.boards-draw-width::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.4), rgba(138, 180, 248, 0.35));
}

.boards-draw-width::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 35% 30%, #ffd08a, #f59e0b 65%);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.boards-draw-width::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.4), rgba(138, 180, 248, 0.35));
}

.boards-draw-width::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 35% 30%, #ffd08a, #f59e0b 65%);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.boards-share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.boards-members {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.boards-members__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.boards-members__add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 8px;
  align-items: center;
}

.boards-members__list {
  display: grid;
  gap: 6px;
}

.boards-members .field,
.boards-members .select {
  width: 100%;
}

.boards-share-row .field {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}

.boards-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 8px;
  align-items: center;
}

.boards-member-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boards-upload-btn {
  position: relative;
  overflow: hidden;
}

.boards-stage {
  border: 0;
  border-radius: 14px;
  padding: 8px;
  background: radial-gradient(circle at 20% 10%, rgba(245, 158, 11, 0.08), transparent 45%), var(--panel-soft);
  min-height: 420px;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}

#board-canvas {
  display: block;
  border: 1px solid rgba(138, 180, 248, 0.35);
  border-radius: 12px;
  max-width: 100%;
  box-sizing: border-box;
}

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

.boards-cursor {
  position: absolute;
  transform: translate(-2px, -2px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.boards-cursor__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.boards-cursor__label {
  font-size: 11px;
  line-height: 1;
  color: #fef3c7;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(20, 10, 2, 0.9);
  border-radius: 999px;
  padding: 3px 7px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boards-fs-toolbar {
  display: none;
}

.boards-stage:fullscreen .boards-fs-toolbar,
.boards-stage:-webkit-full-screen .boards-fs-toolbar {
  position: absolute;
  left: 14px;
  top: 14px;
  bottom: 14px;
  width: 280px;
  z-index: 20;
  display: grid;
  gap: 8px;
  align-content: start;
}

.boards-fs-toolbar__content {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 10, 14, 0.9);
  backdrop-filter: blur(4px);
  overflow: auto;
}

.boards-fs-toggle-btn {
  padding: 4px 8px;
  font-size: 11px;
  min-height: 26px;
  justify-self: start;
}

.boards-fs-toolbar.is-collapsed .boards-fs-toolbar__content {
  display: none;
}

.boards-stage:fullscreen,
.boards-stage:-webkit-full-screen {
  padding: 0;
  border: 0;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
}

.boards-stage:fullscreen #board-canvas,
.boards-stage:-webkit-full-screen #board-canvas {
  border-radius: 0;
  border: 0;
}

.boards-stage:fullscreen .boards-fs-toolbar .btn,
.boards-stage:fullscreen .boards-fs-toolbar .select,
.boards-stage:fullscreen .boards-fs-toolbar .field,
.boards-stage:-webkit-full-screen .boards-fs-toolbar .btn,
.boards-stage:-webkit-full-screen .boards-fs-toolbar .select,
.boards-stage:-webkit-full-screen .boards-fs-toolbar .field {
  width: 100%;
}

@media (max-width: 640px) {
  .boards-head {
    align-items: stretch;
  }
  .boards-actions {
    width: 100%;
    justify-content: stretch;
  }
  .boards-actions .btn {
    flex: 1 1 auto;
  }
  .boards-share-row {
    grid-template-columns: 1fr;
  }
  .boards-tools-panel__grid {
    display: grid;
    grid-template-columns: 1fr;
  }
  .boards-tools-inline {
    width: 100%;
    border-radius: 10px;
    justify-content: space-between;
  }
  .boards-members__add,
  .boards-member-row {
    grid-template-columns: 1fr;
  }
  .boards-shape-select,
  .boards-draw-width {
    width: 100%;
  }
}

.boards-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
}

.boards-modal.is-open {
  display: block;
}

.boards-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.boards-modal__dialog {
  position: relative;
  width: min(460px, calc(100% - 24px));
  margin: 18vh auto 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.boards-modal__dialog h4 {
  margin: 0;
}

.boards-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.boards-modal__textarea {
  resize: vertical;
}

.boards-modal__row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.boards-modal__label {
  color: var(--muted);
  font-size: 13px;
}

.boards-modal__color {
  padding: 4px;
  min-height: 36px;
}
