:root {
  color: #1c2430;
  background: #e7ebf0;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f7f8fa;
  border-bottom: 1px solid #d5dbe3;
}

.button,
.toolbar button {
  border: 1px solid #c5ced8;
  background: #fff;
  color: inherit;
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}

.button {
  display: inline-flex;
}

.toolbar button:disabled {
  opacity: 0.45;
  cursor: default;
}

.modes {
  display: inline-flex;
  border: 1px solid #c5ced8;
  border-radius: 6px;
  overflow: hidden;
}

.modes button {
  border: 0;
  border-radius: 0;
  background: #fff;
}

.modes button[aria-pressed="true"] {
  background: #1f6feb;
  color: #fff;
}

.status {
  margin: 0 0 0 auto;
  color: #526070;
  font-size: 14px;
}

.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
}

.selection-panel {
  width: 280px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: #f7f8fa;
  border-left: 1px solid #d5dbe3;
  min-height: 0;
}

.selection-panel[hidden] {
  display: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #d5dbe3;
}

.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.panel-head button,
.selection-item button {
  border: 1px solid #c5ced8;
  background: #fff;
  color: inherit;
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.panel-head button:disabled {
  opacity: 0.45;
  cursor: default;
}

.selection-item .danger,
.panel-head button {
  color: #9f1239;
}

.panel-empty {
  margin: 0;
  padding: 16px 12px;
  color: #526070;
}

.panel-empty[hidden] {
  display: none;
}

#selection-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow: auto;
}

.selection-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-rows: auto auto;
  gap: 6px 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #d5dbe3;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 8px;
}

.selection-item .preview {
  grid-row: 1 / span 2;
  width: 64px;
  height: 48px;
  background:
    linear-gradient(45deg, #e7ebf0 25%, transparent 25%),
    linear-gradient(-45deg, #e7ebf0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e7ebf0 75%),
    linear-gradient(-45deg, transparent 75%, #e7ebf0 75%);
  background-size: 12px 12px;
  background-position:
    0 0,
    0 6px,
    6px -6px,
    -6px 0;
  background-color: #fff;
  border: 1px solid #d5dbe3;
  border-radius: 4px;
}

.selection-label {
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.item-actions {
  display: flex;
  gap: 6px;
}

.viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  outline: none;
  touch-action: none;
  background:
    linear-gradient(45deg, #dde3ea 25%, transparent 25%),
    linear-gradient(-45deg, #dde3ea 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dde3ea 75%),
    linear-gradient(-45deg, transparent 75%, #dde3ea 75%);
  background-size: 24px 24px;
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
  background-color: #eef2f6;
}

.camera {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.sheet {
  background: #fff;
  box-shadow: 0 8px 28px rgba(28, 36, 48, 0.12);
}

.sheet > svg {
  display: block;
  width: 100%;
  height: 100%;
}

.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.selection-box,
.marquee {
  fill: none;
  stroke: #1f6feb;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.marquee {
  fill: rgba(31, 111, 235, 0.12);
}

.gradient-handle {
  pointer-events: stroke;
  fill: rgba(31, 111, 235, 0.15);
  stroke: #1f6feb;
  stroke-width: 10;
  stroke-linecap: round;
}

.gradient-handle.selected {
  stroke: #0b4fb3;
  stroke-width: 14;
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: #526070;
}

.empty[hidden] {
  display: none;
}
