/* Styles for `:root`. */
:root {
  --bg-main: #161b22;
  --bg-surface: #202734;
  --bg-surface-2: #293243;
  --bg-workspace-a: #2a3342;
  --bg-workspace-b: #1e2633;
  --line-soft: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(143, 190, 255, 0.55);
  --text-main: #e7edf7;
  --text-muted: #9cacbf;
  --accent: #3f9df3;
  --accent-strong: #257ecf;
  --danger: #cf5a6d;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* Styles for `*`. */
* {
  box-sizing: border-box;
}

/* Styles for `body`. */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: "Manrope", "Trebuchet MS", "Segoe UI", sans-serif;
  overflow: hidden;
  /* Layered gradients create the app's atmospheric background depth. */
  background:
    radial-gradient(1200px 600px at -8% -12%, #374860 0%, transparent 64%),
    radial-gradient(1000px 620px at 105% 8%, #2d4054 0%, transparent 55%),
    linear-gradient(140deg, #1b212b, #131922 58%, #10151c);
}

/* Styles for `body::before`. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Subtle grid overlay to mimic a design/editor workspace. */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Styles for `.editor-shell`. */
.editor-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 58px 1fr 32px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Styles for `.topbar`. */
.topbar {
  display: flex;
  position: relative;
  z-index: 2000;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(31, 40, 53, 0.95), rgba(24, 31, 41, 0.9));
  backdrop-filter: blur(4px);
}

/* Styles for `.topbar-start`. */
.topbar-start {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Styles for `.topbar-actions`. */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Styles for `.topbar-link`. */
.topbar-link {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: linear-gradient(165deg, rgba(79, 95, 117, 0.95), rgba(52, 65, 83, 0.96));
  color: #ecf3ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 6px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.16s ease, transform 0.14s ease, background 0.16s ease;
}

/* Styles for `.topbar-link-icon`. */
.topbar-link-icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* Styles for `.topbar-link:hover`. */
.topbar-link:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

/* Styles for `.topbar-link:focus-visible`. */
.topbar-link:focus-visible {
  outline: 2px solid rgba(122, 184, 247, 0.9);
  outline-offset: 2px;
}

/* Styles for `.brand-block`. */
.brand-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Styles for `.app-title`. */
.app-title {
  font-size: 16px;
  letter-spacing: 0.03em;
}

/* Styles for `.app-subtitle`. */
.app-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Styles for `.editor-main`. */
.editor-main {
  display: grid;
  grid-template-columns: 170px 1fr 350px;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

/* Styles for `.inspector`. */
.left-dock,
.inspector {
  min-height: 0;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(35, 43, 56, 0.95), rgba(26, 32, 41, 0.92));
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* Styles for `.left-dock`. */
.left-dock {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

/* Styles for `.dock-title`. */
.dock-title {
  margin: 0;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* Styles for `#menu-buttons-group`. */
#menu-buttons-group {
  display: grid;
  gap: 8px;
}

/* Styles for `.workspace`. */
.workspace {
  min-width: 0;
  min-height: 0;
}

/* Styles for `.workspace-stage`. */
.workspace-stage {
  --ruler-size: 26px;
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(181, 209, 250, 0.18);
  border-radius: 14px;
  overflow: hidden;
  /* Checker + gradient layers simulate a transparency/work area surface. */
  background:
    linear-gradient(45deg, #2b3645 25%, transparent 25%),
    linear-gradient(-45deg, #2b3645 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2b3645 75%),
    linear-gradient(-45deg, transparent 75%, #2b3645 75%),
    linear-gradient(160deg, var(--bg-workspace-a), var(--bg-workspace-b));
  background-size: 24px 24px, 24px 24px, 24px 24px, 24px 24px, 100% 100%;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0, 0 0;
}

/* Styles for `.ruler-corner`. */
.ruler-corner {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--ruler-size);
  height: var(--ruler-size);
  border-right: 1px solid rgba(205, 224, 248, 0.22);
  border-bottom: 1px solid rgba(205, 224, 248, 0.22);
  background: linear-gradient(145deg, rgba(66, 78, 96, 0.96), rgba(45, 55, 70, 0.98));
  z-index: 26;
}

/* Styles for `.ruler`. */
.ruler {
  position: absolute;
  border-color: rgba(205, 224, 248, 0.2);
  background: linear-gradient(180deg, rgba(66, 78, 96, 0.95), rgba(45, 55, 70, 0.98));
  z-index: 26;
  overflow: hidden;
  pointer-events: none;
}

/* Styles for `.ruler-top`. */
.ruler-top {
  top: 0;
  left: var(--ruler-size);
  right: 0;
  height: var(--ruler-size);
  border-bottom: 1px solid rgba(205, 224, 248, 0.2);
}

/* Styles for `.ruler-left`. */
.ruler-left {
  top: var(--ruler-size);
  bottom: 0;
  left: 0;
  width: var(--ruler-size);
  border-right: 1px solid rgba(205, 224, 248, 0.2);
}

/* Styles for `.ruler-tick`. */
.ruler-tick {
  position: absolute;
  background: rgba(230, 240, 255, 0.48);
}

/* Styles for `.ruler-top .ruler-tick`. */
.ruler-top .ruler-tick {
  width: 1px;
  bottom: 0;
}

/* Styles for `.ruler-left .ruler-tick`. */
.ruler-left .ruler-tick {
  height: 1px;
  right: 0;
}

/* Styles for `.ruler-label`. */
.ruler-label {
  position: absolute;
  color: rgba(221, 234, 252, 0.86);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  user-select: none;
  white-space: nowrap;
}

/* Styles for `.ruler-top .ruler-label`. */
.ruler-top .ruler-label {
  top: 2px;
  transform: translateX(3px);
}

/* Styles for `.ruler-left .ruler-label`. */
.ruler-left .ruler-label {
  right: 2px;
  transform: rotate(-90deg);
  transform-origin: top right;
}

/* Styles for `.scale-readout`. */
.scale-readout {
  position: absolute;
  right: 10px;
  top: 6px;
  z-index: 27;
  border: 1px solid rgba(205, 224, 248, 0.24);
  border-radius: 6px;
  background: rgba(14, 22, 32, 0.72);
  color: #d8e7fc;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 4px 8px;
  pointer-events: none;
}

/* Styles for `#drop-area`. */
#drop-area {
  position: absolute;
  inset: calc(50% + 13px) auto auto calc(50% + 13px);
  transform: translate(-50%, -50%);
  width: calc(100% - (var(--ruler-size) + 16px));
  height: calc(100% - (var(--ruler-size) + 16px));
  max-width: 1100px;
  max-height: 820px;
  border: 1px dashed rgba(198, 218, 246, 0.48);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(13px, 1.08vw, 18px);
  color: #9fb0c4;
  letter-spacing: 0.02em;
  background: rgba(19, 26, 35, 0.78);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

/* Styles for `#drop-area.dragover`. */
#drop-area.dragover {
  border-color: var(--accent);
  color: #d9ebff;
  background: rgba(21, 39, 59, 0.84);
}

/* Styles for `input:focus-visible`. */
#drop-area:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(122, 184, 247, 0.9);
  outline-offset: 2px;
}

/* Styles for `#preview`. */
#preview {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  z-index: 10;
  box-shadow: none;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

/* Styles for `.inspector`. */
.inspector {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

/* Styles for `.inspector`. */
.left-dock,
.inspector {
  scrollbar-width: thin;
  scrollbar-color: rgba(117, 158, 214, 0.78) rgba(16, 22, 30, 0.55);
}

/* Styles for `.inspector::-webkit-scrollbar`. */
.left-dock::-webkit-scrollbar,
.inspector::-webkit-scrollbar {
  width: 10px;
}

/* Styles for `.inspector::-webkit-scrollbar-track`. */
.left-dock::-webkit-scrollbar-track,
.inspector::-webkit-scrollbar-track {
  background: rgba(16, 22, 30, 0.55);
  border-radius: 999px;
}

/* Styles for `.inspector::-webkit-scrollbar-thumb`. */
.left-dock::-webkit-scrollbar-thumb,
.inspector::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(119, 164, 224, 0.9), rgba(76, 120, 181, 0.92));
  border-radius: 999px;
  border: 2px solid rgba(16, 22, 30, 0.55);
}

/* Styles for `#side-menu-3`. */
#side-menu,
#side-menu-2,
#side-menu-3 {
  position: relative;
  width: 100%;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(45, 56, 73, 0.92), rgba(32, 40, 53, 0.94));
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Styles for `#side-menu`. */
#side-menu {
  margin-bottom: 10px;
}

/* Styles for `#side-menu-2`. */
#side-menu-2 {
  margin-bottom: 10px;
}

/* Styles for `#side-menu-3 h3`. */
#side-menu h3,
#side-menu-2 h3,
#side-menu-3 h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #cedcf0;
}

/* Styles for `#side-menu.transform-panel`. */
#side-menu.transform-panel {
  gap: 10px;
}

/* Styles for `#side-menu.transform-panel h3`. */
#side-menu.transform-panel h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #cedcf0;
}

/* Styles for `#transform-button button`. */
#help-btn,
#file-menu-btn,
#edit-menu-btn,
#menu-btn,
#menu-btn-2,
#menu-btn-3,
#show-btn,
#ai-btn,
#close-help-btn,
#close-menu-btn,
#close-menu-2-btn,
#close-menu-3-btn,
#close-ai-btn,
#enlarge-btn,
#shrink-btn,
#up-btn,
#down-btn,
#left-btn,
#right-btn,
#reset-btn,
#flip-btn,
#rotate-btn,
#quit-btn,
#restore-btn,
#redo-btn,
#download-btn,
.file-menu-item,
.edit-menu-item,
#filter-buttons button,
#transform-button button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: linear-gradient(165deg, rgba(79, 95, 117, 0.95), rgba(52, 65, 83, 0.96));
  color: #ecf3ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 8px 10px;
  transition: border-color 0.16s ease, transform 0.14s ease, background 0.16s ease;
}

/* Styles for `#show-btn`. */
#help-btn,
#file-menu-btn,
#edit-menu-btn,
#show-btn {
  padding: 9px 12px;
}

/* Styles for `.file-menu-wrap`. */
.file-menu-wrap {
  position: relative;
}

/* Styles for `.edit-menu-wrap`. */
.edit-menu-wrap {
  position: relative;
}

/* Styles for `.file-menu-dropdown`. */
.file-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1300;
  display: none;
  min-width: 152px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(40, 49, 63, 0.98), rgba(28, 35, 47, 0.98));
  box-shadow: var(--shadow);
  gap: 6px;
}

/* Styles for `.edit-menu-dropdown`. */
.edit-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1300;
  display: none;
  min-width: 136px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(40, 49, 63, 0.98), rgba(28, 35, 47, 0.98));
  box-shadow: var(--shadow);
  gap: 6px;
}

/* Styles for `.file-menu-dropdown.is-open`. */
.file-menu-dropdown.is-open {
  display: grid;
}

/* Styles for `.edit-menu-dropdown.is-open`. */
.edit-menu-dropdown.is-open {
  display: grid;
}

/* Styles for `.file-menu-item`. */
.file-menu-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
}

/* Styles for `.edit-menu-item`. */
.edit-menu-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
}

/* Styles for `.file-menu-item.file-menu-danger`. */
.file-menu-item.file-menu-danger {
  background: linear-gradient(165deg, rgba(129, 62, 79, 0.95), rgba(94, 45, 59, 0.97));
  border-color: rgba(255, 190, 204, 0.22);
}

/* Styles for `#menu-btn-3`. */
#menu-btn,
#menu-btn-2,
#menu-btn-3 {
  width: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* Styles for `.tool-tab-icon`. */
.tool-tab-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Styles for `.tool-tab-label`. */
.tool-tab-label {
  line-height: 1;
}

/* Styles for `#menu-btn-3.is-open`. */
#menu-btn.is-open,
#menu-btn-2.is-open,
#menu-btn-3.is-open {
  border-color: var(--line-strong);
  background: linear-gradient(165deg, rgba(65, 123, 184, 0.95), rgba(38, 94, 151, 0.98));
}

/* Styles for `#transform-button button:hover`. */
#help-btn:hover,
#file-menu-btn:hover,
#edit-menu-btn:hover,
#menu-btn:hover,
#menu-btn-2:hover,
#menu-btn-3:hover,
#show-btn:hover,
#enlarge-btn:hover,
#shrink-btn:hover,
#up-btn:hover,
#down-btn:hover,
#left-btn:hover,
#right-btn:hover,
#reset-btn:hover,
#flip-btn:hover,
#rotate-btn:hover,
#restore-btn:hover,
#redo-btn:hover,
.file-menu-item:hover,
.edit-menu-item:hover,
#filter-buttons button:hover,
#transform-button button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

/* Styles for `#quit-btn`. */
#quit-btn {
  background: linear-gradient(165deg, rgba(129, 62, 79, 0.95), rgba(94, 45, 59, 0.97));
  border-color: rgba(255, 190, 204, 0.22);
}

/* Styles for `#close-ai-btn`. */
#close-help-btn,
#close-menu-btn,
#close-menu-2-btn,
#close-menu-3-btn,
#close-ai-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  padding: 0;
  line-height: 1;
}

/* Styles for `#close-menu-3-btn`. */
#close-menu-btn,
#close-menu-2-btn,
#close-menu-3-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Styles for `#zoom-buttons`. */
#zoom-buttons {
  display: flex;
  gap: 8px;
}

/* Styles for `#shrink-btn`. */
#enlarge-btn,
#shrink-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
  padding: 0;
}

/* Styles for `#arrow-buttons`. */
#arrow-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  justify-items: center;
}

/* Styles for `#right-btn`. */
#up-btn,
#down-btn,
#left-btn,
#right-btn {
  width: 38px;
  height: 34px;
  padding: 0;
  font-size: 14px;
  background: linear-gradient(165deg, rgba(52, 110, 78, 0.95), rgba(36, 84, 59, 0.97));
}

/* Styles for `#side-menu #zoom-buttons`. */
#side-menu #zoom-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Styles for `#side-menu #shrink-btn`. */
#side-menu #enlarge-btn,
#side-menu #shrink-btn {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  font-size: 40px;
  line-height: 1;
}

/* Styles for `#side-menu #arrow-buttons`. */
#side-menu #arrow-buttons {
  display: none;
  grid-template-columns: repeat(3, 74px);
  grid-template-rows: repeat(3, 74px);
  justify-content: center;
  gap: 10px;
  margin: 0;
}

/* Styles for `#side-menu #right-btn`. */
#side-menu #up-btn,
#side-menu #down-btn,
#side-menu #left-btn,
#side-menu #right-btn {
  width: 74px;
  height: 74px;
  border-radius: 14px;
  border: 4px solid rgba(217, 230, 249, 0.94);
  background: linear-gradient(165deg, rgba(105, 125, 152, 0.84), rgba(78, 98, 124, 0.9));
  box-shadow: inset 0 1px 0 rgba(241, 247, 255, 0.24), 0 6px 14px rgba(0, 0, 0, 0.22);
  color: #e9f1fd;
  transform: rotate(45deg);
}

/* Styles for `#side-menu #up-btn`. */
#side-menu #up-btn {
  grid-column: 2;
  grid-row: 1;
}

/* Styles for `#side-menu #left-btn`. */
#side-menu #left-btn {
  grid-column: 1;
  grid-row: 2;
}

/* Styles for `#side-menu #right-btn`. */
#side-menu #right-btn {
  grid-column: 3;
  grid-row: 2;
}

/* Styles for `#side-menu #down-btn`. */
#side-menu #down-btn {
  grid-column: 2;
  grid-row: 3;
}

/* Styles for `#side-menu .arrow-glyph`. */
#side-menu .arrow-glyph {
  display: inline-block;
  transform: rotate(-45deg);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

/* Styles for `#side-menu #right-btn:hover`. */
#side-menu #up-btn:hover,
#side-menu #down-btn:hover,
#side-menu #left-btn:hover,
#side-menu #right-btn:hover {
  border-color: #e8f3ff;
  transform: rotate(45deg) translateY(-1px);
}

/* Styles for `.transform-action-buttons`. */
.transform-action-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
}

/* Styles for `#side-menu #rotate-btn`. */
#side-menu #reset-btn,
#side-menu #flip-btn,
#side-menu #rotate-btn {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Styles for `.transform-action-icon`. */
.transform-action-icon {
  width: 24px;
  height: 24px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Styles for `#side-menu #quit-btn`. */
#side-menu #quit-btn {
  margin-top: 2px;
  width: 100%;
}

/* Styles for `#controls`. */
#controls {
  display: flex;
  gap: 8px;
}

/* Styles for `#controls #redo-btn`. */
#controls #restore-btn,
#controls #redo-btn {
  flex: 1;
  width: auto;
}

/* Styles for `.history-progress`. */
.history-progress {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(208, 225, 247, 0.14);
  border-radius: 8px;
  padding: 8px;
  background: rgba(18, 24, 33, 0.46);
}

/* Styles for `.history-progress-row`. */
.history-progress-row {
  display: grid;
  gap: 4px;
}

/* Styles for `.history-progress-head`. */
.history-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #b8c8dc;
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Styles for `.history-progress-track`. */
.history-progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(90, 108, 132, 0.34);
  overflow: hidden;
}

/* Styles for `.history-progress-fill`. */
.history-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(120, 190, 255, 0.95), rgba(63, 157, 243, 0.98));
  transition: width 0.15s ease;
}

/* Styles for `.history-progress-fill.redo-fill`. */
.history-progress-fill.redo-fill {
  background: linear-gradient(90deg, rgba(142, 232, 180, 0.94), rgba(81, 195, 133, 0.97));
}

/* Styles for `#redo-btn`. */
#restore-btn,
#redo-btn {
  width: 100%;
}

/* Styles for `button:disabled`. */
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* Styles for `#pixel-modification-buttons`. */
#pixel-modification-buttons {
  display: grid;
  gap: 10px;
}

/* Styles for `.section-label`. */
.section-label {
  color: #9fb0c4;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

/* Styles for `#transform-button`. */
#filter-buttons,
#transform-button {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* Styles for `#chanel-buttons`. */
#chanel-buttons {
  display: grid;
  gap: 3px;
}

/* Styles for `.slider-container`. */
.slider-container {
  display: grid;
  grid-template-columns: 78px 1fr 60px 26px;
  align-items: center;
  gap: 8px;
}

/* Styles for `.slider-container label`. */
.slider-container label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Styles for `.slider-container span`. */
.slider-container span {
  font-size: 11px;
  color: #b8c8dc;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Styles for `.channel-value-input`. */
.channel-value-input {
  appearance: textfield;
  -moz-appearance: textfield;
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(108, 129, 153, 0.45);
  border-radius: 9px;
  background: rgba(22, 29, 40, 0.92);
  color: #c3d4e8;
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding: 0 8px;
}

/* Styles for `.channel-value-input:focus`. */
.channel-value-input:focus {
  outline: none;
  border-color: #82c4ff;
  box-shadow: 0 0 0 1px rgba(130, 196, 255, 0.22);
}

/* Styles for `.channel-value-input::-webkit-inner-spin-button`. */
.channel-value-input::-webkit-outer-spin-button,
.channel-value-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Styles for `.channel-reset-btn`. */
.channel-reset-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(108, 129, 153, 0.45);
  border-radius: 50%;
  background: rgba(26, 35, 48, 0.9);
  color: #a8bfd9;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.14s ease, background 0.16s ease;
}

/* Styles for `.channel-reset-btn:hover`. */
.channel-reset-btn:hover {
  border-color: #82c4ff;
  color: #d7ebff;
  background: rgba(36, 49, 67, 0.95);
  transform: translateY(-1px);
}

/* Styles for `.channel-reset-btn:focus`. */
.channel-reset-btn:focus {
  outline: none;
  border-color: #82c4ff;
  box-shadow: 0 0 0 1px rgba(130, 196, 255, 0.22);
}

/* Styles for `#chanel-buttons input[type="range"]`. */
#chanel-buttons input[type="range"] {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(74, 88, 106, 0.95), rgba(48, 58, 74, 0.95));
}

/* Styles for `#chanel-buttons input[type="range"]::-webkit-slider-thumb`. */
#chanel-buttons input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(20, 32, 44, 0.95);
  background: #82c4ff;
}

/* Styles for `#chanel-buttons input[type="range"]::-moz-range-thumb`. */
#chanel-buttons input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(20, 32, 44, 0.95);
  background: #82c4ff;
}

/* Styles for `.shortcut-card`. */
.shortcut-card {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(26, 33, 44, 0.8);
  padding: 10px;
}

/* Styles for `.dock-footer`. */
.dock-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

/* Styles for `.dock-history-progress`. */
.dock-history-progress {
  padding: 10px;
}

/* Styles for `.shortcut-title`. */
.shortcut-title {
  margin: 0 0 7px;
  color: #cfdbed;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Styles for `.shortcut-card p`. */
.shortcut-card p {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 11px;
}

/* Styles for `#help-menu`. */
#help-menu {
  position: fixed;
  top: 64px;
  left: 14px;
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100vh - 90px);
  min-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(40, 49, 63, 0.97), rgba(28, 35, 47, 0.97));
  box-shadow: var(--shadow);
  z-index: 1200;
  padding: 14px 14px 16px;
  padding-right: 16px;
}

/* Styles for `#help-menu h3`. */
#help-menu h3 {
  margin: 0 44px 4px 0;
  font-size: 28px;
  letter-spacing: 0.02em;
  color: #e4eefc;
}

/* Styles for `#help-menu #close-help-btn`. */
#help-menu #close-help-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* Styles for `#help-menu .help-intro`. */
#help-menu .help-intro {
  margin: 0 0 12px;
  color: #a8bbd2;
  font-size: 12px;
  line-height: 1.45;
}

/* Styles for `#help-menu .help-section`. */
#help-menu .help-section {
  border: 1px solid rgba(194, 214, 240, 0.12);
  border-radius: 10px;
  background: rgba(19, 28, 41, 0.36);
  padding: 10px 10px 8px;
  margin-bottom: 10px;
}

/* Styles for `#help-menu .help-section:last-child`. */
#help-menu .help-section:last-child {
  margin-bottom: 0;
}

/* Styles for `#help-menu .help-section h4`. */
#help-menu .help-section h4 {
  margin: 0 0 8px;
  color: #d5e3f7;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Styles for `#help-menu .help-list`. */
#help-menu .help-list {
  margin: 0;
  padding-left: 16px;
}

/* Styles for `#help-menu .help-list li`. */
#help-menu .help-list li {
  color: #b8c8dc;
  font-size: 12px;
  line-height: 1.48;
  margin-bottom: 6px;
}

/* Styles for `#help-menu .help-list li:last-child`. */
#help-menu .help-list li:last-child {
  margin-bottom: 0;
}

/* Styles for `#help-menu .help-list strong`. */
#help-menu .help-list strong {
  color: #dce8f9;
}

/* Styles for `#help-menu code`. */
#help-menu code {
  font-family: "Consolas", "Menlo", "Monaco", monospace;
  font-size: 11px;
  color: #e7f2ff;
  background: rgba(33, 47, 66, 0.78);
  border: 1px solid rgba(141, 172, 212, 0.22);
  border-radius: 4px;
  padding: 0 4px;
}

/* Styles for `#help-menu`. */
#help-menu {
  scrollbar-width: thin;
  scrollbar-color: rgba(117, 158, 214, 0.78) rgba(16, 22, 30, 0.55);
}

/* Styles for `#help-menu::-webkit-scrollbar`. */
#help-menu::-webkit-scrollbar {
  width: 10px;
}

/* Styles for `#help-menu::-webkit-scrollbar-track`. */
#help-menu::-webkit-scrollbar-track {
  background: rgba(16, 22, 30, 0.55);
  border-radius: 999px;
}

/* Styles for `#help-menu::-webkit-scrollbar-thumb`. */
#help-menu::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(119, 164, 224, 0.9), rgba(76, 120, 181, 0.92));
  border-radius: 999px;
  border: 2px solid rgba(16, 22, 30, 0.55);
}

/* Styles for `.statusbar`. */
.statusbar {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-top: 1px solid var(--line-soft);
  color: #91a4bb;
  font-size: 11px;
  letter-spacing: 0.02em;
  background: rgba(21, 28, 37, 0.75);
}

/* Styles for `#show-btn`. */
#show-btn {
  display: none;
  position: fixed;
  right: 16px;
  top: 60px;
  z-index: 1100;
}

/* Responsive layout adjustments for screens up to 1440px. */
@media (max-width: 1440px) {
  /* Styles for `.editor-main`. */
  .editor-main {
    grid-template-columns: 156px 1fr 320px;
    gap: 10px;
    padding: 10px;
  }
}

/* Responsive layout adjustments for screens up to 1280px. */
@media (max-width: 1280px) {
  /* Styles for `.editor-main`. */
  .editor-main {
    grid-template-columns: 140px 1fr 288px;
    gap: 8px;
    padding: 8px;
  }

  /* Styles for `.inspector`. */
  .left-dock,
  .inspector {
    border-radius: 10px;
  }

  /* Styles for `.inspector`. */
  .inspector {
    padding: 8px;
    gap: 8px;
  }
}
