.db-mount:empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--card, #fff);
  box-shadow: var(--soft, 0 3px 10px rgba(63, 55, 48, 0.1));
}

.db-mount:empty::before {
  content: "opening the shared board…";
  padding: 18px;
  color: var(--sub, #8a7566);
  font: 700 11px/1.5 "Quicksand", sans-serif;
  text-align: center;
}

.db-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  color: var(--ink, #3f3730);
}

.db-board-tab {
  color: var(--ink, #3f3730);
  background: transparent;
}

.db-board-tab[aria-pressed="true"] {
  color: var(--card, #fff);
  background: var(--ink, #3f3730);
}

.db-chalk-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 6px solid #c19a66;
  border-radius: 16px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 38%, rgba(242, 236, 223, 0.055), transparent 62%),
    #2f3a33;
  box-shadow:
    inset 0 0 28px rgba(10, 18, 12, 0.35),
    var(--soft, 0 3px 10px rgba(63, 55, 48, 0.1));
}

.db-chalk-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 18px;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.08), transparent);
}

.db-chalk-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.db-chalk-live {
  z-index: 1;
  touch-action: pan-y;
}

.db-chalk-panel.is-drawing .db-chalk-live {
  cursor: crosshair;
  touch-action: none;
}

.db-status-row,
.db-identity,
.db-sticker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px 14px;
  flex-wrap: wrap;
}

.db-status,
.db-count,
.db-note,
.db-name-label {
  font: 700 10.5px/1.45 "Quicksand", sans-serif;
  color: var(--ink, #3f3730);
}

.db-status {
  min-height: 16px;
}

.db-count {
  color: var(--ink, #3f3730);
}

.db-note {
  margin: 0;
}

.db-identity {
  align-items: end;
  justify-content: flex-start;
}

.db-name-form {
  display: flex;
  flex: 1 1 330px;
  align-items: end;
  gap: 8px;
  margin: 0;
}

.db-name-label {
  display: flex;
  flex: 1 1 190px;
  flex-direction: column;
  gap: 4px;
}

.db-name-input {
  min-height: 42px;
  width: 100%;
  padding: 9px 12px;
  box-sizing: border-box;
  color: var(--ink, #3f3730);
  background: var(--card, #fff);
  border: 1.5px solid var(--edge, #3f3730);
  border-radius: 11px;
  font: 700 12px "Quicksand", sans-serif;
}

.db-primary,
.db-name-save,
.db-tool-text,
.db-color,
.db-size,
.db-tray-item {
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
  color: var(--ink, #3f3730);
  background: var(--card, #fff);
  border: 1.5px solid var(--edge, #3f3730);
  border-radius: 11px;
  box-shadow: 2px 2px 0 var(--shadow, rgba(63, 55, 48, 0.15));
  font: 800 10px/1.2 "Quicksand", sans-serif;
}

.db-primary {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 9px 14px;
  color: #6f4654;
  background: #fbe3ea;
}

.db-name-save {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 42px;
  padding: 8px 11px;
  box-sizing: border-box;
  cursor: pointer;
  color: var(--ink, #3f3730);
  background: var(--card, #fff);
  border: 1.5px solid var(--edge, #3f3730);
  border-radius: 11px;
  box-shadow: 2px 2px 0 var(--shadow, rgba(63, 55, 48, 0.15));
  font: 800 10px/1.2 "Quicksand", sans-serif;
  white-space: nowrap;
}

.db-primary[aria-pressed="true"] {
  color: #36512f;
  background: #e8f2df;
}

.db-primary:disabled,
.db-name-save:disabled,
.db-tool-text:disabled,
.db-color:disabled,
.db-size:disabled,
.db-tray-item:disabled,
.db-cutout-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.db-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 0 4px;
  flex-wrap: wrap;
}

.db-tools[hidden],
.db-name-form[hidden] {
  display: none;
}

.db-color {
  position: relative;
  flex: 0 0 44px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.db-color::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 13px;
  width: 34px;
  height: 14px;
  border-radius: 4px;
  background: var(--chalk-color);
  transform: rotate(-8deg);
  box-shadow: 0 1px 2px rgba(30, 35, 30, 0.3);
}

.db-tool-text {
  flex: 0 0 auto;
  padding: 8px 11px;
  white-space: nowrap;
}

.db-color.is-active,
.db-size.is-active,
.db-tool-text.is-active {
  outline: 2px solid var(--acc, #d4788f);
  outline-offset: 0;
}

.db-size {
  position: relative;
  flex: 0 0 44px;
  padding: 0;
}

.db-size::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.db-size-1::after {
  width: 8px;
  height: 8px;
}

.db-size-2::after {
  width: 12px;
  height: 12px;
}

@media (max-width: 879px) {
  .db-name-form,
  .db-primary {
    flex-basis: 100%;
    width: 100%;
  }

  .db-color::after {
    left: 2px;
    top: 11px;
    width: 40px;
    height: 20px;
  }
}

.db-sticker-board {
  position: relative;
  height: 300px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--edge, #3f3730) 55%, transparent);
  border-radius: 16px;
  background-color: #f7f1e3;
  background-image:
    linear-gradient(90deg, transparent 42px, rgba(201, 106, 94, 0.24) 42px 43px, transparent 43px),
    repeating-linear-gradient(180deg, transparent 0 25px, rgba(38, 48, 43, 0.075) 25px 26px);
  box-shadow:
    inset 0 0 30px rgba(38, 48, 43, 0.08),
    var(--soft, 0 3px 10px rgba(63, 55, 48, 0.1));
}

.db-sticker-board::after {
  content: "shared wall";
  position: absolute;
  right: 9px;
  top: 9px;
  z-index: 10;
  padding: 4px 7px;
  pointer-events: none;
  color: rgba(38, 48, 43, 0.72);
  background: rgba(247, 241, 227, 0.88);
  border: 1px solid rgba(38, 48, 43, 0.18);
  border-radius: 5px;
  font: 800 8px "Quicksand", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.db-sticker {
  position: absolute;
  z-index: 1;
  margin: 0;
  padding: 0;
  color: #26302b;
  border: 0;
  background: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button.db-sticker {
  cursor: grab;
  touch-action: none;
  border-radius: 9px;
}

button.db-sticker:disabled {
  cursor: wait;
}

button.db-sticker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

.db-sticker.is-held {
  z-index: 8;
  cursor: grabbing;
  filter: drop-shadow(0 6px 8px rgba(38, 48, 43, 0.28));
}

.db-sticker.is-selected {
  outline: 3px solid #d4788f;
  outline-offset: 3px;
}

.db-sticker-e {
  font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 31px;
  line-height: 1;
}

.db-sticker-t {
  width: max-content;
  max-width: 150px;
  padding: 5px 8px;
  color: rgba(159, 68, 62, 0.92);
  background: rgba(255, 253, 250, 0.68);
  border: 1.5px solid rgba(159, 68, 62, 0.65);
  border-radius: 4px;
  font: 800 9px "Quicksand", sans-serif;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.db-sticker-w,
.db-washi {
  display: inline-block;
  width: 100px;
  height: 22px;
  border-radius: 2px;
  opacity: 0.93;
  box-shadow: 0 2px 5px rgba(38, 48, 43, 0.18);
}

.db-sticker-i {
  display: grid;
  width: clamp(66px, 18vw, 92px);
  height: clamp(66px, 18vw, 92px);
  place-items: center;
}

.db-sticker-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(38, 48, 43, 0.3));
  pointer-events: none;
}

.washi--straw {
  background: repeating-linear-gradient(45deg, #edb2c0 0 8px, #f7efe2 8px 16px);
}

.washi--matcha {
  background-color: #dceacb;
  background-image: radial-gradient(rgba(95, 112, 80, 0.7) 2px, transparent 2.6px);
  background-size: 12px 12px;
}

.washi--grid {
  background-color: #f3eee2;
  background-image:
    linear-gradient(rgba(90, 95, 85, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 95, 85, 0.3) 1px, transparent 1px);
  background-size: 8px 8px;
}

.washi--milk {
  background-color: #fbe3e8;
  background-image: linear-gradient(180deg, transparent 44%, rgba(227, 165, 177, 0.55) 44% 56%, transparent 56%);
}

.washi--gold {
  background: repeating-linear-gradient(45deg, #e3c878 0 6px, #f4e6c0 6px 12px);
}

.db-sticker-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 2px 2px 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.db-tray-hint {
  align-self: flex-end;
  color: var(--ink, #3f3730);
  font: 700 9.5px/1.35 "Quicksand", sans-serif;
}

.db-tray-item {
  flex: 0 0 auto;
  padding: 5px 9px;
  font-size: 22px;
  line-height: 1;
}

.db-tray-e {
  font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

.db-tray-t {
  font-family: "Quicksand", sans-serif;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.db-tray-w {
  width: 76px;
  padding: 8px;
}

.db-tray-w .db-washi {
  width: 56px;
  height: 13px;
  box-shadow: none;
}

.db-upload-press {
  display: flex;
  align-items: center;
  gap: 9px 14px;
  margin: 0;
  padding: 11px 12px 12px;
  flex-wrap: wrap;
  color: var(--ink, #3f3730);
  background: color-mix(in srgb, var(--card, #fff) 76%, transparent);
  border: 1.5px dashed var(--acc, #d4788f);
  border-radius: 13px;
}

.db-upload-legend {
  padding: 0 5px;
  color: var(--ink, #3f3730);
  font: 800 10.5px/1.3 "Quicksand", sans-serif;
}

.db-upload-copy {
  flex: 1 1 220px;
  color: var(--ink, #3f3730);
  font: 700 10.5px/1.45 "Quicksand", sans-serif;
}

.db-cutout-option {
  display: flex;
  flex: 1 1 180px;
  min-height: 44px;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.db-cutout-checkbox {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--acc, #d4788f);
}

.db-cutout-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font: 800 10.5px/1.35 "Quicksand", sans-serif;
}

.db-cutout-copy small {
  color: var(--ink, #3f3730);
  font: 700 10px/1.35 "Quicksand", sans-serif;
}

.db-upload-button {
  min-width: 128px;
}

.db-upload-input[hidden] {
  display: none;
}

@media (min-width: 880px) {
  .db-chalk-stage {
    width: min(100%, max(360px, calc(180dvh - 740px)));
    align-self: center;
  }

  .db-sticker-board {
    height: 380px;
  }
}

@media (min-width: 1200px) {
  .db-panel {
    gap: 15px;
  }

  .db-sticker-board {
    height: 480px;
  }

  .db-status,
  .db-count,
  .db-note,
  .db-name-label {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .db-sticker,
  .db-color,
  .db-size,
  .db-tool-text,
  .db-primary {
    scroll-behavior: auto;
    transition: none;
  }
}
