/* Local-only layout editor for arranging the listening desktop. */
body.layout-editing [data-layout-key] {
  cursor: grab !important;
  outline: 2px dashed rgba(255, 222, 136, .94) !important;
  outline-offset: 5px;
  touch-action: none;
  user-select: none;
  z-index: 1100 !important;
}

body.layout-editing [data-layout-key].is-layout-dragging {
  cursor: grabbing !important;
  outline-color: #fff2bc !important;
  box-shadow: 0 0 0 6px rgba(88, 56, 18, .18), 0 14px 34px rgba(0, 0, 0, .18);
}

body.layout-editing [data-layout-key].is-layout-selected {
  outline-color: #fff7cd !important;
  box-shadow: 0 0 0 5px rgba(255, 219, 111, .18);
}

#youkanLayoutToolbar {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 12000;
  display: grid;
  gap: 8px;
  width: min(280px, calc(100vw - 36px));
  padding: 14px;
  color: #fff8e8;
  background: rgba(17, 43, 31, .92);
  border: 1px solid rgba(251, 220, 137, .62);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .32);
  backdrop-filter: blur(16px);
}

#youkanLayoutToolbar strong {
  font-size: 16px;
}

#youkanLayoutToolbar p {
  margin: 0;
  color: rgba(255, 248, 232, .82);
  font-size: 13px;
  line-height: 1.45;
}

#youkanLayoutToolbar .layout-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

#youkanLayoutToolbar .layout-size-actions {
  display: grid;
  grid-template-columns: 1fr minmax(84px, 1.35fr) 1fr;
  gap: 7px;
  align-items: stretch;
}

#youkanLayoutToolbar [data-selected-label] {
  display: grid;
  place-items: center;
  padding: 6px;
  color: rgba(255, 248, 232, .92);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 237, 177, .24);
  border-radius: 11px;
}

#youkanLayoutToolbar button {
  min-height: 40px;
  padding: 7px 8px;
  color: #fff8e8;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 237, 177, .42);
  border-radius: 11px;
}

#youkanLayoutToolbar button[data-action="save"] {
  color: #17331f;
  background: linear-gradient(135deg, #ffe292, #e7b850);
  border-color: transparent;
}

@media (max-width: 640px) {
  #youkanLayoutToolbar {
    right: 12px;
    bottom: 12px;
  }
}
