:root {
  color-scheme: light;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  --ui-base: #c0c0c0;
  --ui-panel: #c0c0c0;
  --ui-panel-soft: #dfdfdf;
  --ui-border: #808080;
  --ui-text: #000000;
  --ui-text-muted: #000000;
  --ui-text-dim: #404040;
  --ui-field: #ffffff;
  --ui-chip: #dfdfdf;
  --ui-primary: #c0c0c0;
  --ui-primary-ink: #000000;
  background: #c0c0c0;
  color: #000000;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #c0c0c0;
}

body {
  margin: 0;
  min-width: 0;
  background: #c0c0c0;
}

button,
input,
select,
textarea {
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  font-size: 12px;
}

.app-shell {
  grid-template-columns: minmax(0, 1fr) 280px;
  height: 100%;
  min-height: 0;
  background: #c0c0c0;
  overflow: hidden;
}

.workspace {
  height: 100%;
  padding: 8px;
  background: #c0c0c0;
}

.sidebar {
  height: 100%;
  min-height: 0;
  padding: 8px;
  background: #c0c0c0;
  border-left: 2px solid #808080;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow-y: scroll !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar {
  width: 16px;
}

.sidebar::-webkit-scrollbar-corner {
  background: #dfdfdf;
}

.sidebar::-webkit-scrollbar-track {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='2' height='2' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1 0H0v1h1v1h1V1H1V0z' fill='silver'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 0H1v1H0v1h1V1h1V0z' fill='%23fff'/%3E%3C/svg%3E");
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: #dfdfdf;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #ffffff,
    inset -2px -2px #808080,
    inset 2px 2px #dfdfdf;
}

.sidebar::-webkit-scrollbar-button:vertical:start {
  height: 17px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 0H0v16h1V1h14V0z' fill='%23DFDFDF'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 1H1v14h1V2h12V1H2z' fill='%23fff'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M16 17H0v-1h15V0h1v17z' fill='%23000'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 1h-1v14H1v1h14V1z' fill='gray'/%3E%3Cpath fill='silver' d='M2 2h12v13H2z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8 6H7v1H6v1H5v1H4v1h7V9h-1V8H9V7H8V6z' fill='%23000'/%3E%3C/svg%3E");
}

.sidebar::-webkit-scrollbar-button:vertical:end {
  height: 17px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 0H0v16h1V1h14V0z' fill='%23DFDFDF'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 1H1v14h1V2h12V1H2z' fill='%23fff'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M16 17H0v-1h15V0h1v17z' fill='%23000'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 1h-1v14H1v1h14V1z' fill='gray'/%3E%3Cpath fill='silver' d='M2 2h12v13H2z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11 6H4v1h1v1h1v1h1v1h1V9h1V8h1V7h1V6z' fill='%23000'/%3E%3C/svg%3E");
}

.sidebar::-webkit-scrollbar-button:vertical:start:increment,
.sidebar::-webkit-scrollbar-button:vertical:end:decrement {
  display: none;
  height: 0;
}

.sidebar__header {
  display: none;
}

.panel-stack {
  gap: 8px;
  padding-bottom: 24px;
}

.panel,
.control-group {
  border-radius: 0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  background: #c0c0c0;
  padding: 6px;
  transition: none;
}

.panel h2,
.panel h3,
.control__label,
.readout-grid div,
.readout-grid span,
.readout-grid strong,
.sidebar__subcopy,
.sidebar__eyebrow {
  color: #000000;
  letter-spacing: 0;
  text-transform: none;
}

.panel h2 {
  font-size: 12px;
  font-weight: 700;
}

.panel__toggle:focus-visible {
  outline: 1px dotted #000000;
  outline-offset: 1px;
  border-radius: 0;
}

input[type="file"],
input[type="text"],
input[type="number"],
select,
textarea {
  border-radius: 0;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background: #ffffff;
  color: #000000;
  padding: 3px 4px;
}

input[type="range"] {
  accent-color: #000080;
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #000080;
}

.ghost-button,
.primary-button,
.preview-stage__zoom-reset,
.color-swatch {
  border-radius: 0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  background: #c0c0c0;
  color: #000000;
  box-shadow: none;
  padding: 4px 8px;
}

.ghost-button:active,
.primary-button:active,
.preview-stage__zoom-reset:active {
  border-top-color: #404040;
  border-left-color: #404040;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  padding: 5px 7px 3px 9px;
}

.primary-button {
  font-weight: 400;
}

.preview-stage {
  height: 100%;
  min-height: 0;
  padding: 10px;
  background: #808080;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.preview-stage__canvas {
  background: #ffffff;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-stage__placeholder {
  inset: 10px;
  border-radius: 0;
  border: 1px dotted #000000;
  background: #ffffff;
  color: #000000;
  letter-spacing: 0;
  text-transform: none;
}

.preview-stage__placeholder::before {
  content: "Drop image here";
  font-size: 13px;
}

.preview-stage__placeholder[hidden],
body.dith-has-source .preview-stage__placeholder {
  display: none !important;
}

.preview-stage__zoom-controls {
  display: none !important;
}

.preview-stage__zoom-head,
.preview-stage__zoom-controls input[type="range"] {
  width: 100%;
}

.color-swatch-grid {
  gap: 4px;
}

.color-swatch {
  min-height: 20px;
}

.color-swatch--active {
  outline: 1px dotted #000000;
  outline-offset: 1px;
}

.readout-grid {
  gap: 4px;
}

body.dith-drop-active .preview-stage {
  outline: 2px dotted #000000;
  outline-offset: -8px;
}

body.dith-drop-active .preview-stage::after {
  content: "Drop image here";
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  z-index: 10;
  background: rgba(255, 255, 255, 0.82);
  border: 1px dotted #000000;
  color: #000000;
  pointer-events: none;
}

@media (max-width: 760px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }

  .sidebar {
    order: 1;
    height: 240px;
    min-height: 180px;
    overflow-y: auto;
    border-left: 0;
    border-bottom: 2px solid #808080;
  }

  .workspace {
    order: 2;
    min-height: 0;
    flex: 1 1 auto;
  }

  .preview-stage {
    min-height: 0;
    height: 100%;
  }
}
