@import url("https://fonts.googleapis.com/css2?family=VT323&display=swap");

:root {

  --win-teal: #008080;
  --win-gray: #c0c0c0;
  --win-gray-light: #ffffff;
  --win-gray-shadow: #808080;
  --win-gray-dark: #000000;
  --win-blue: #000080;
  --win-blue-inactive: #808080;
  --font-main: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: "Courier New", Courier, monospace;
  --font-dos: "VT323", monospace;
}

* {
  box-sizing: border-box;
}

.title-bar,
.resizer {
  user-select: none;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--win-teal);
  font-family: var(--font-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  background-size: auto;
  background-position: center;
  background-repeat: no-repeat;
}

#desktop {
  position: relative;
  width: 100%;
  height: 100%;
}

#context-menu,
.program-icon-context-menu {
  position: absolute;
  display: none;
  min-width: 170px;
  background-color: var(--win-gray);
  border: 1px solid var(--win-gray-dark);
  box-shadow: inset 1px 1px 0px var(--win-gray-light),
    inset -1px -1px 0px var(--win-gray-shadow), 2px 2px 6px rgba(0, 0, 0, 0.35);
  z-index: 10000;
  padding: 4px 0;
  font-size: 13px;
}

#context-menu .context-menu-item,
.program-icon-context-menu .context-menu-item {
  padding: 6px 18px;
  cursor: default;
  white-space: nowrap;
}

#context-menu .context-menu-item:hover,
#context-menu .context-menu-item:focus,
.program-icon-context-menu .context-menu-item:hover,
.program-icon-context-menu .context-menu-item:focus {
  outline: none;
  color: white;
  background-color: var(--win-blue);
}

#context-menu .context-menu-separator,
.program-icon-context-menu .context-menu-separator {
  height: 1px;
  margin: 4px 6px;
  background-color: var(--win-gray-shadow);
  border-top: 1px solid var(--win-gray-light);
}

.desktop-icon-container {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-start;
  pointer-events: none;
}

.desktop-icon {
  width: 70px;
  text-align: center;
  color: white;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.desktop-icon .icon-img {
  width: 32px;
  height: 32px;
  background-color: transparent;
  margin-bottom: 4px;
  image-rendering: pixelated;
}
.icon-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.desktop-icon .icon-label {
  font-size: 14px;
  background-color: var(--win-teal);
  padding: 2px 4px;
  line-height: 1.2;
  text-shadow: 1px 1px 0 #000;
}

.desktop-icon.minimized {
  opacity: 0.8;
}

.desktop-icon.minimized:hover {
  opacity: 1;
}

.window {
  position: absolute;
  background-color: var(--win-gray);
  border: 1px solid var(--win-gray-dark);
  box-shadow: inset 1px 1px 0px var(--win-gray-light),
    inset -1px -1px 0px var(--win-gray-shadow), 2px 2px 5px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  min-height: 100px;
  padding: 3px;
  border-radius: 0;
}

.window.active {
  z-index: 100;
}

.resizer {
  position: absolute;
  z-index: 200;
  opacity: 0;
}

.resizer.n {
  top: -4px;
  left: 0;
  right: 0;
  height: 8px;
  cursor: n-resize;
}

.resizer.s {
  bottom: -4px;
  left: 0;
  right: 0;
  height: 8px;
  cursor: s-resize;
}

.resizer.e {
  right: -4px;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: e-resize;
}

.resizer.w {
  left: -4px;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: w-resize;
}

.resizer.ne {
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  cursor: ne-resize;
}

.resizer.nw {
  top: -4px;
  left: -4px;
  width: 12px;
  height: 12px;
  cursor: nw-resize;
}

.resizer.se {
  bottom: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  cursor: se-resize;
}

.resizer.sw {
  bottom: -4px;
  left: -4px;
  width: 12px;
  height: 12px;
  cursor: sw-resize;
}

.title-bar {
  height: 24px;
  background-color: var(--win-blue-inactive);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px;
  font-weight: bold;
  font-size: 14px;
  cursor: default;
}

.window.active .title-bar {
  background-color: var(--win-blue);
}

.title-bar-text {
  flex-grow: 1;
  text-align: center;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 4px;
}

.sys-box,
.win-btn {
  width: 20px;
  height: 18px;
  background-color: var(--win-gray);
  border-top: 1px solid var(--win-gray-light);
  border-left: 1px solid var(--win-gray-light);
  border-right: 1px solid var(--win-gray-dark);
  border-bottom: 1px solid var(--win-gray-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: black;
  cursor: pointer;
}

.sys-box:focus-visible,
.win-btn:focus-visible,
.desktop-icon:focus-visible,
.desktop-icon .icon-img:focus-visible,
.task-btn:focus-visible,
.menu-item:focus-visible,
#minimized-container .desktop-icon:focus-visible {
  outline: 2px solid var(--win-blue);
  outline-offset: 2px;
}

.sys-box:active,
.win-btn:active {
  border-top: 1px solid var(--win-gray-dark);
  border-left: 1px solid var(--win-gray-dark);
  border-right: 1px solid var(--win-gray-light);
  border-bottom: 1px solid var(--win-gray-light);
  padding-top: 2px;
  padding-left: 2px;
}

.sys-box {
  font-weight: bold;
  font-size: 16px;
  line-height: 14px;
}

.win-controls-right {
  display: flex;
  gap: 2px;
}

.menu-bar {
  display: flex;
  background-color: var(--win-gray);
  padding: 2px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--win-gray-dark);
}

.menu-item {
  padding: 2px 8px;
  cursor: default;
}

.menu-item:focus-visible {
  outline: 2px solid var(--win-blue);
  outline-offset: 1px;
  background-color: var(--win-blue);
  color: white;
}

.menu-item::first-letter {
  text-decoration: underline;
}

.menu-item:hover {
  background-color: var(--win-blue);
  color: white;
}

.window-body {
  flex-grow: 1;
  background-color: white;
  border: 1px solid var(--win-gray-dark);  
  overflow: auto;
  position: relative;
  font-family: "Arial", sans-serif;
  font-size: 14px;
  cursor: auto;
  user-select: text;
}

.prog-man-container {
  min-height: 100%;
}

.prog-man-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px 8px;
  background-color: var(--win-gray);
  border-bottom: 1px solid var(--win-gray-shadow);
  box-shadow: inset 0 1px 0 var(--win-gray-light);
}

.prog-view-button {
  min-width: 72px;
  padding: 3px 8px;
  color: var(--win-gray-dark);
  background-color: var(--win-gray);
  border: 1px solid var(--win-gray-dark);
  box-shadow: inset 1px 1px 0 var(--win-gray-light), inset -1px -1px 0 var(--win-gray-shadow);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.prog-view-button.active {
  color: white;
  background-color: var(--win-blue);
  box-shadow: inset 1px 1px 0 var(--win-gray-dark), inset -1px -1px 0 var(--win-gray-light);
}

.prog-view-button:focus {
  outline: 1px dotted var(--win-gray-dark);
  outline-offset: -4px;
}

.prog-man-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  padding: 10px;
}

.prog-man-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
}

.prog-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  text-align: center;
}

.prog-icon:hover .prog-label {
  background-color: var(--win-blue);
  color: white;
}

.prog-icon img {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  image-rendering: pixelated;
}
.prog-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 3px 6px;
  color: var(--win-gray-dark);
  cursor: pointer;
  border: 1px solid transparent;
}

.prog-detail-row:hover,
.prog-detail-row:focus {
  outline: none;
  color: white;
  background-color: var(--win-blue);
  border-color: var(--win-blue);
}

.prog-detail-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prog-detail-icon img,
.prog-detail-icon svg {
  width: 24px;
  height: 24px;
  margin: 0;
  image-rendering: pixelated;
}

.prog-detail-main {
  min-width: 0;
  line-height: 1.15;
}

.prog-detail-name {
  font-size: 13px;
  font-weight: bold;
}

.prog-detail-meta,
.prog-detail-permissions {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.runtime-error {
  padding: 8px;
  color: #b00020;
  font-weight: bold;
}

.prog-label {
  font-size: 13px;
  padding: 1px 3px;
  color: black;
}

.notepad-area {
  width: 100%;
  height: 100%;
  border: none;
  resize: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 5px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 10px;
  background-color: var(--win-gray);
  height: 100%;
}

.calc-display {
  grid-column: 1 / -1;
  background: white;
  border: 1px solid var(--win-gray-shadow);
  text-align: right;
  padding: 5px;
  font-family: var(--font-mono);
  font-size: 18px;
  margin-bottom: 5px;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.calc-btn {
  background: var(--win-gray);
  border-top: 1px solid white;
  border-left: 1px solid white;
  border-right: 1px solid black;
  border-bottom: 1px solid black;
  padding: 5px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  font-weight: bold;
  color: blue;
}

.calc-btn.op {
  color: red;
}

.calc-btn:active {
  border: 1px solid black;
  border-right: 1px solid white;
  border-bottom: 1px solid white;
  background: #b0b0b0;
}

.mines-bar {
  background: var(--win-gray);
  display: flex;
  justify-content: space-between;
  padding: 5px;
  border-bottom: 2px solid white;
  border-left: 2px solid white;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  margin: 5px;
}

.mines-lcd {
  background: black;
  color: red;
  font-family: "VT323", monospace;
  font-size: 24px;
  padding: 0 4px;
  border: 1px solid #808080;
}

.mines-face {
  width: 26px;
  height: 26px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: white #808080 #808080 white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

.mines-face:active {
  border-width: 1px;
}

.mines-grid {
  display: grid;
  grid-template-columns: repeat(9, 20px);
  grid-template-rows: repeat(9, 20px);
  border: 3px solid;
  border-color: #808080 white white #808080;
  margin: 0 auto 5px auto;
}

.mine-cell {
  width: 20px;
  height: 20px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: white #808080 #808080 white;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.mine-cell.revealed {
  border: 1px solid #808080;
  border-top: none;
  border-left: none;
  background: #c0c0c0;
}

.mine-cell.flagged {
  color: red;
}

.mine-cell.bomb {
  background: red;
  color: black;
}

.mine-cell.blown {
  background: #ff8080;
}

.c1 {
  color: blue;
}

.c2 {
  color: green;
}

.c3 {
  color: red;
}

.c4 {
  color: darkblue;
}

.kakuro-root {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  height: 100%;
}

.kakuro-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.kakuro-keypad {
  display: grid;
  grid-template-columns: repeat(5, minmax(46px, 1fr));
  gap: 6px;
}

.kakuro-actions {
  display: flex;
  gap: 6px;
}

.kakuro-board {
  flex: 1;
  display: grid;
  gap: 2px;
  background: #808080;
  padding: 6px;
  border: 2px solid #404040;
}

.kakuro-cell {
  position: relative;
  background: white;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: var(--font-ui);
}

.kakuro-cell input {
  width: 100%;
  height: 100%;
  text-align: center;
  border: none;
  font-size: 20px;
  font-weight: bold;
  background: transparent;
  outline: none;
}

.kakuro-cell.active {
  outline: 2px solid #000080;
  outline-offset: -2px;
}

.kakuro-block {
  background: #202020;
}

.kakuro-clue {
  background: #202020;
  color: white;
  font-size: 12px;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 4px;
}

.kakuro-clue::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #202020 50%, #404040 50%);
  z-index: 0;
}

.kakuro-clue div {
  position: relative;
  z-index: 1;
}

.kakuro-clue-across {
  align-self: flex-end;
  font-size: 12px;
}

.kakuro-clue-down {
  margin-left: auto;
  font-size: 12px;
}

.kakuro-play {
  border: 1px solid #c0c0c0;
}

.kakuro-error {
  background: #ffe6e6;
}

.kakuro-correct {
  background: #e8ffef;
}

.kakuro-status {
  min-height: 20px;
  font-weight: bold;
}

.kakuro-help {
  font-size: 12px;
  color: #202020;
}

.compiler-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
}

.compiler-toolbar {
  padding: 4px;
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--win-gray-shadow);
}

.compiler-btn {
  background: var(--win-gray);
  border-top: 1px solid white;
  border-left: 1px solid white;
  border-right: 1px solid black;
  border-bottom: 1px solid black;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  font-weight: bold;
}

.compiler-btn:active {
  border: 1px solid black;
  border-right: 1px solid white;
  border-bottom: 1px solid white;
  background: #b0b0b0;
}

.compiler-editor {
  flex: 1;
  background: white;
  border: 1px solid var(--win-gray-shadow);
  font-family: "Courier New", monospace;
  font-size: 14px;
  padding: 5px;
  resize: none;
  outline: none;
  margin: 4px;
}

.compiler-output {
  height: 120px;
  background: black;
  color: lightgray;
  font-family: "VT323", monospace;
  font-size: 16px;
  padding: 5px;
  border: 1px solid var(--win-gray-shadow);
  margin: 0 4px 4px 4px;
  overflow-y: auto;
  white-space: pre-wrap;
  box-shadow: inset 1px 1px 3px rgba(255, 255, 255, 0.1);
}

.console {
  background-color: black;
  color: #c0c0c0;
  font-family: var(--font-dos);
  font-size: 18px;
  padding: 5px;
  height: 100%;
  width: 100%;
  overflow-y: auto;
  cursor: text;
}

.console-line {
  display: flex;
  align-items: center;
  width: 100%;
}

.console-input {
  background: transparent;
  border: none;
  color: #c0c0c0;
  font-family: var(--font-dos);
  font-size: 18px;
  outline: none;
  flex-grow: 1;
  flex: 1;
  min-width: 0;
  margin-left: 5px;
  text-transform: uppercase;
}

.bbs-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, #0e121c, #0a0d15);
  color: #aee0ff;
  font-family: var(--font-dos);
}

.bbs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111827;
  border-bottom: 1px solid #1f2937;
  padding: 6px;
  gap: 12px;
}

.bbs-dial {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.bbs-dial label {
  color: #9ca3af;
}

.bbs-dial input,
.bbs-dial select {
  background: #0b1220;
  border: 1px solid #233043;
  color: #d1e8ff;
  padding: 3px 6px;
  font-family: var(--font-dos);
  font-size: 14px;
}

.bbs-status {
  font-weight: bold;
  color: #e5e7eb;
}

.bbs-status.connected {
  color: #7cf0c4;
}

.bbs-body {
  display: flex;
  flex: 1;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.bbs-sidebar {
  width: 210px;
  background: #0b1021;
  border: 1px solid #1f2937;
  border-radius: 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #d8e2ff;
}

.bbs-section-title {
  font-weight: bold;
  margin-bottom: 4px;
  color: #93c5fd;
}

.bbs-section button,
.bbs-section select {
  width: 100%;
  margin-top: 4px;
}

.bbs-terminal {
  flex: 1;
  background: #050b14;
  border: 1px solid #1f2937;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 10px;
  color: #d1e8ff;
  font-family: var(--font-dos);
  font-size: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bbs-line {
  line-height: 1.25;
  white-space: pre-wrap;
}

.bbs-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #1f2937;
  background: #0f1628;
}

.bbs-input {
  flex: 1;
  background: #050b14;
  border: 1px solid #1f2937;
  color: #d1e8ff;
  padding: 6px 8px;
  font-family: var(--font-dos);
  font-size: 15px;
}

.bbs-prompt {
  color: #7cf0c4;
  font-weight: bold;
}

.bbs-progress {
  width: 100%;
  height: 8px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.bbs-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ade80, #22d3ee);
  transition: width 0.2s ease;
}

.bbs-progress-fill.active {
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.4);
}

.ansi-black {
  color: #111827;
}

.ansi-red {
  color: #f43f5e;
}

.ansi-green {
  color: #22c55e;
}

.ansi-yellow {
  color: #eab308;
}

.ansi-blue {
  color: #3b82f6;
}

.ansi-magenta {
  color: #c084fc;
}

.ansi-cyan {
  color: #22d3ee;
}

.ansi-white {
  color: #e5e7eb;
}

.ansi-bright-black {
  color: #374151;
}

.ansi-bright-red {
  color: #fb7185;
}

.ansi-bright-green {
  color: #4ade80;
}

.ansi-bright-yellow {
  color: #fde047;
}

.ansi-bright-blue {
  color: #60a5fa;
}

.ansi-bright-magenta {
  color: #d8b4fe;
}

.ansi-bright-cyan {
  color: #67e8f9;
}

.ansi-bright-white {
  color: #f8fafc;
}

.task-mgr-layout {
  display: flex;
  flex-direction: column;
  padding: 5px;
  height: 100%;
  background: var(--win-gray);
  font-family: var(--font-main);
}

.task-list {
  height: 120px;
  background: white;
  border: 1px solid var(--win-gray-shadow);
  margin-bottom: 8px;
  overflow-y: auto;
  padding: 2px;
  font-size: 14px;
}

.task-item {
  padding: 2px 4px;
  cursor: pointer;
  margin-bottom: 1px;
}

.task-item.selected {
  background-color: var(--win-blue);
  color: white;
}

.task-btns {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 5px;
}

.task-btn {
  flex: 1;
  height: 24px;
  background: var(--win-gray);
  border-top: 1px solid white;
  border-left: 1px solid white;
  border-right: 1px solid black;
  border-bottom: 1px solid black;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-btn:active {
  border: 1px solid black;
  border-bottom: 1px solid white;
  border-right: 1px solid white;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.pdf-reader {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--win-gray-light);
  border: 1px solid var(--win-gray-shadow);
  font-size: 12px;
}

.pdf-toolbar .file-btn {
  position: relative;
  overflow: hidden;
}

.pdf-toolbar .file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.pdf-url-input {
  flex: 1;
  padding: 4px;
  font-size: 12px;
  border: 1px solid var(--win-gray-shadow);
  background: white;
}

.pdf-status {
  font-weight: bold;
  color: #400000;
}

.pdf-viewer {
  flex: 1;
  margin-top: 6px;
  border: 1px solid var(--win-gray-shadow);
  background: white;
}

.pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.img-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 6px;
}

.img-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--win-gray-light);
  border: 1px solid var(--win-gray-shadow);
  font-size: 12px;
}

.img-toolbar .file-btn {
  position: relative;
  overflow: hidden;
}

.img-toolbar .file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.img-url-input {
  flex: 1;
  padding: 4px;
  font-size: 12px;
  border: 1px solid var(--win-gray-shadow);
  background: white;
}

.img-status {
  font-weight: bold;
  color: #003366;
}

.img-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--win-gray-shadow);
  background: #111;
  overflow: auto;
}

.img-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #333;
  background: #f0f0f0;
  border: 2px dashed var(--win-gray-shadow);
  padding: 12px;
}

.md-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 6px;
}

.md-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--win-gray-light);
  border: 1px solid var(--win-gray-shadow);
  font-size: 12px;
}

.md-toolbar .file-btn {
  position: relative;
  overflow: hidden;
}

.md-toolbar .file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.md-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.md-input {
  width: 100%;
  height: 100%;
  resize: none;
  border: 1px solid var(--win-gray-shadow);
  background: white;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
}

.md-preview {
  border: 1px solid var(--win-gray-shadow);
  background: white;
  padding: 10px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.5;
}

.md-preview pre {
  background: #f4f4f4;
  padding: 8px;
  border: 1px solid #ddd;
  overflow: auto;
}

.md-preview code {
  background: #f4f4f4;
  padding: 2px 4px;
  border-radius: 2px;
}

.md-preview ul {
  padding-left: 20px;
  margin: 8px 0;
}

.md-preview a {
  color: #003399;
}

.md-empty {
  color: #555;
  font-style: italic;
}

.hex-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 6px;
}

.hex-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--win-gray-light);
  border: 1px solid var(--win-gray-shadow);
  font-size: 12px;
}

.hex-toolbar .file-btn {
  position: relative;
  overflow: hidden;
}

.hex-toolbar .file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.hex-body {
  flex: 1;
  display: grid;
  grid-template-columns: 120px 1fr 1fr;
  gap: 6px;
}

.hex-body textarea {
  width: 100%;
  height: 100%;
  resize: none;
  border: 1px solid var(--win-gray-shadow);
  font-family: var(--font-mono);
  font-size: 13px;
  background: white;
  padding: 8px;
  box-sizing: border-box;
  line-height: 1.4;
}

.hex-offsets {
  background: #f4f4f4;
  color: #444;
  text-align: right;
}

.hex-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: var(--win-gray-light);
  border: 1px solid var(--win-gray-shadow);
  font-size: 12px;
}

.hex-status {
  font-weight: bold;
}

.hex-status.error {
  color: #b00000;
}

.hex-hint {
  color: #333;
}

.task-queue-view {
  flex: 1;
  background: black;
  color: lime;
  font-family: "Courier New", monospace;
  font-size: 12px;
  padding: 5px;
  border: 2px solid gray;
  overflow-y: auto;
}

.queue-row {
  display: block;
  white-space: pre;
  border-bottom: 1px dotted #004000;
}

.queue-header {
  font-weight: bold;
  white-space: pre;
  border-bottom: 1px solid lime;
  margin-bottom: 4px;
}

.paint-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
}

.paint-main {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
}

.paint-tools {
  width: 40px;
  background: var(--win-gray);
  display: flex;
  flex-direction: column;
  padding: 4px;
  gap: 4px;
  border-right: 1px solid var(--win-gray-shadow);
}

.tool-btn {
  width: 30px;
  height: 30px;
  border: 2px solid var(--win-gray);
  border-top-color: white;
  border-left-color: white;
  border-right-color: black;
  border-bottom-color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 18px;
}

.tool-btn.active {
  background-color: white;
  border: 2px solid black;
  border-bottom-color: white;
  border-right-color: white;
  border-top-color: black;
  border-left-color: black;
}

.paint-canvas-container {
  flex-grow: 1;
  overflow: auto;
  background: #808080;
  padding: 10px;
  position: relative;
}

.paint-canvas {
  background: white;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
  cursor: crosshair;
  display: block;
}

.paint-palette {
  height: 40px;
  background: var(--win-gray);
  border-top: 1px solid var(--win-gray-shadow);
  display: flex;
  align-items: center;
  padding: 4px;
  overflow-x: auto;
}

.color-swatch {
  width: 20px;
  height: 20px;
  border: 1px solid black;
  margin-right: 2px;
  cursor: pointer;
}

.color-swatch.active {
  border: 2px solid white;
  outline: 1px solid black;
  z-index: 10;
}

.artist-app {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  background: var(--win-gray);
}

.artist-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--win-gray-shadow);
  background: linear-gradient(#dcdcdc, #bfbfbf);
}

.artist-prompt {
  height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--win-gray-dark);
  font-family: var(--font-main);
}

.artist-status {
  font-size: 12px;
  color: #003366;
}

.artist-status-error {
  color: #a00000;
  font-weight: bold;
}

.artist-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px 8px 8px;
  height: 100%;
}

.artist-preview-wrap {
  flex: 1;
  min-height: 200px;
  border: 1px solid var(--win-gray-shadow);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.artist-preview {
  max-width: 100%;
  max-height: 100%;
  display: none;
}

.artist-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  background: repeating-linear-gradient(
    45deg,
    #f5f5f5 0,
    #f5f5f5 12px,
    #e8e8e8 12px,
    #e8e8e8 24px
  );
  text-align: center;
  padding: 12px;
}

.artist-hint {
  font-size: 12px;
  color: #333;
}

.artist-link {
  font-size: 12px;
  color: #003399;
  text-decoration: underline;
  width: fit-content;
}


.ps-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #8b8b8b;
  color: #111;
  font-family: "MS Sans Serif", "Geneva", var(--font-main);
  font-size: 11px;
}

.ps-classic {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(180deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px) 0 0 / 16px 16px,
    #7f7f7f;
}

.ps-menu-bar {
  display: flex;
  gap: 18px;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  background: #d6d3ce;
  border-bottom: 1px solid #000;
  box-shadow: inset 0 1px 0 #fff;
  flex: 0 0 auto;
}

.ps-menu-bar span::first-letter {
  text-decoration: underline;
}

.ps-options-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 26px;
  padding: 3px 7px;
  background: #c7c7c7;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #555;
  box-shadow: inset 0 1px 0 #efefef;
  flex: 0 0 auto;
}

.ps-brand {
  padding-right: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-right: 1px solid #777;
}

.ps-status {
  min-height: 20px;
  padding: 3px 8px;
  background: #d6d3ce;
  border-top: 1px solid #fff;
  box-shadow: inset 0 1px 0 #777;
  color: #111;
  flex: 0 0 auto;
}

.ps-body {
  display: grid;
  grid-template-columns: 55px minmax(320px, 1fr) 205px;
  gap: 7px;
  min-height: 0;
  padding: 7px;
  flex: 1;
  overflow: hidden;
}

.ps-toolbar,
.ps-panel,
.ps-document-window,
.ps-panel-group {
  border: 1px solid #000;
  border-top-color: #fff;
  border-left-color: #fff;
  border-right-color: #404040;
  border-bottom-color: #404040;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #e8e8e8;
}

.ps-toolbar {
  display: grid;
  grid-template-columns: repeat(2, 22px);
  align-content: start;
  gap: 1px;
  padding: 5px;
  background: #d6d3ce;
  overflow: hidden;
}

.ps-tool {
  width: 22px;
  height: 22px;
  padding: 0;
  color: #111;
  background: #d6d3ce;
  border: 1px solid #000;
  border-top-color: #fff;
  border-left-color: #fff;
  border-right-color: #555;
  border-bottom-color: #555;
  box-shadow: inset 1px 1px 0 #efefef;
  cursor: default;
  font-family: "Times New Roman", serif;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.ps-tool.active,
.ps-tool:active {
  background: #bababa;
  border-top-color: #404040;
  border-left-color: #404040;
  border-right-color: #fff;
  border-bottom-color: #fff;
  box-shadow: inset 1px 1px 0 #777;
}

.ps-color-wells {
  position: relative;
  grid-column: 1 / -1;
  height: 42px;
  margin-top: 7px;
}

.ps-color-wells input[type="color"] {
  position: absolute;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #000;
  background: #fff;
}

.ps-color-primary {
  left: 4px;
  top: 0;
  z-index: 2;
}

.ps-color-secondary {
  right: 4px;
  bottom: 0;
}

.ps-canvas-wrap {
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 18px;
  background: #6f6f6f;
  border: 1px inset #555;
}

.ps-document-window {
  background: #d6d3ce;
  padding: 0 4px 4px;
  min-width: max-content;
}

.ps-document-title {
  height: 19px;
  margin: 0 -4px 4px;
  padding: 2px 8px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, #000080, #1084d0);
  border-bottom: 1px solid #000;
}

.ps-canvas {
  display: block;
  width: 640px;
  height: 420px;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
  cursor: crosshair;
  image-rendering: pixelated;
}

.ps-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 6px;
  background: #d6d3ce;
  overflow-y: auto;
}

.ps-panel-group {
  padding: 6px;
  background: #d6d3ce;
}

.ps-palette-title {
  margin: -6px -6px 6px;
  padding: 2px 6px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, #000080, #1084d0);
  border-bottom: 1px solid #000;
}

.ps-info-grid {
  display: grid;
  grid-template-columns: 20px 1fr 20px 1fr;
  gap: 3px 5px;
  padding: 4px;
  background: #efefef;
  border: 1px inset #808080;
}

.ps-control-row {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 6px;
}

.ps-brush-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  margin-top: 6px;
  background: #efefef;
  border: 1px inset #808080;
}

.ps-brush-preview span {
  display: block;
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
}

.ps-swatches {
  display: grid;
  grid-template-columns: repeat(5, 22px);
  gap: 3px;
}

.ps-swatch {
  width: 22px;
  height: 20px;
  padding: 0;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.55);
  cursor: default;
}

.ps-tabs {
  display: flex;
  gap: 1px;
  margin-bottom: 5px;
}

.ps-tabs span {
  padding: 2px 5px;
  background: #c2c2c2;
  border: 1px solid #555;
  border-bottom: 0;
}

.ps-tabs .active {
  background: #efefef;
  font-weight: 700;
}

.ps-layer-row {
  display: grid;
  grid-template-columns: 18px 1fr 34px;
  gap: 5px;
  align-items: center;
  padding: 4px;
  background: #efefef;
  border: 1px inset #808080;
}

.ps-eye {
  color: #000080;
}

.ps-filter-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.ps-filter-buttons .task-btn {
  min-height: 22px;
  padding: 2px 6px;
  font-size: 11px;
}

.ps-filter-buttons .task-btn:nth-child(-n + 3) {
  grid-column: span 2;
}

.ps-hint {
  margin-top: 6px;
  color: #333;
  font-size: 11px;
  background: #fffbe6;
  padding: 6px;
  border: 1px dashed #c29b00;
}

.db-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
  font-family: var(--font-main);
  font-size: 13px;
}

.db-form {
  background: var(--win-gray);
  padding: 8px;
  border-bottom: 1px solid var(--win-gray-shadow);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.db-input-group {
  display: flex;
  flex-direction: column;
}

.db-input-group label {
  margin-bottom: 2px;
  font-weight: bold;
}

.db-input {
  width: 120px;
  border: 1px solid #808080;
  padding: 2px;
}

.db-grid-container {
  flex: 1;
  background: white;
  border: 1px solid #808080;
  margin: 5px;
  overflow: auto;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Arial", sans-serif;
}

.db-table th {
  background: var(--win-gray);
  border: 1px solid #808080;
  padding: 2px 4px;
  text-align: left;
  position: sticky;
  top: 0;
  box-shadow: 0 1px 0 #000;
}

.db-table td {
  border: 1px solid #e0e0e0;
  padding: 2px 4px;
}

.db-table tr:hover {
  background: #ffffcc;
}

.pg-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
  font-family: var(--font-main);
  font-size: 13px;
}

.pg-header {
  padding: 8px;
  border-bottom: 1px solid var(--win-gray-shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pg-connection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
  align-items: center;
}

.pg-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px;
  border: 1px solid #808080;
}

.pg-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
}

.pg-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pg-status {
  font-size: 12px;
  color: #003300;
}

.pg-status-error {
  color: #8b0000;
}

.pg-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 8px;
  padding: 8px;
  height: 100%;
  box-sizing: border-box;
}

.pg-schema {
  background: #fff;
  border: 1px solid #808080;
  padding: 8px;
  overflow: auto;
}

.pg-panel-title {
  font-weight: bold;
  margin-bottom: 6px;
}

.pg-schema-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pg-schema-item {
  border: 1px solid #d0d0d0;
  padding: 6px;
  background: #f7fbff;
}

.pg-schema-name {
  font-weight: bold;
  color: #0b3d91;
}

.pg-schema-columns {
  font-size: 12px;
  color: #333;
}

.pg-query {
  background: #fff;
  border: 1px solid #808080;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pg-query-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #d0d0d0;
}

.pg-sample-label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: bold;
}

.pg-query-hint {
  font-size: 11px;
  color: #333;
  background: #fffbe6;
  padding: 4px 6px;
  border: 1px dashed #c29b00;
  flex: 1;
}

.pg-sql {
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid #d0d0d0;
  padding: 8px;
  font-family: "Courier New", monospace;
  min-height: 120px;
}

.pg-results {
  flex: 1;
  overflow: auto;
  padding: 8px;
  background: #f8f8f8;
  box-sizing: border-box;
}

.pg-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Arial", sans-serif;
}

.pg-table th,
.pg-table td {
  border: 1px solid #d0d0d0;
  padding: 4px 6px;
}

.pg-table th {
  background: #e9f0ff;
  text-align: left;
}

.pg-table tr:nth-child(odd) {
  background: #fefefe;
}

.pg-table tr:nth-child(even) {
  background: #f6f6f6;
}

.pg-empty {
  padding: 8px;
  color: #555;
}

.sound-rec-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
  padding: 5px;
  align-items: center;
}

.sound-vis {
  width: 250px;
  height: 60px;
  background: black;
  border: 2px solid #808080;
  border-right-color: white;
  border-bottom-color: white;
  margin-bottom: 10px;
  position: relative;
}

.sound-wave-canvas {
  width: 100%;
  height: 100%;
}

.daw-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  background: var(--win-gray);
  padding: 8px;
}

.daw-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.daw-tempo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.daw-tempo input[type="range"] {
  width: 150px;
}

.daw-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #e5e5e5;
  border: 2px inset white;
  padding: 6px;
  overflow: auto;
}

.daw-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.daw-row-label {
  width: 70px;
  font-weight: bold;
  font-size: 13px;
  text-align: right;
}

.daw-step-row {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 4px;
  flex: 1;
}

.daw-step {
  background: #dcdcdc;
  border: 1px solid #808080;
  height: 24px;
  cursor: pointer;
  position: relative;
}

.daw-step:nth-child(4n) {
  border-right: 2px solid #555;
}

.daw-step:hover {
  background: #f4f4f4;
}

.daw-step.active {
  background: #6dbc71;
  box-shadow: inset 1px 1px 0 #ffffff;
}

.daw-step.playhead {
  outline: 2px solid var(--win-blue);
}

.daw-step.playhead.active {
  background: #9bd48c;
}

.daw-status {
  font-size: 13px;
  padding: 4px 6px;
  background: #f6f6f6;
  border: 1px solid #b0b0b0;
}

.tracker-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  background: var(--win-gray);
  padding: 8px;
}

.tracker-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tracker-tempo,
.tracker-note-select,
.tracker-export {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.tracker-note-select label,
.tracker-tempo label,
.tracker-keyboard label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tracker-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #e6e6e6;
  border: 2px inset white;
  padding: 8px;
  overflow: auto;
}

.tracker-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tracker-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.tracker-row-name {
  font-weight: bold;
  font-size: 13px;
  width: 110px;
}

.tracker-step-row {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 4px;
}

.tracker-step {
  background: #d4d4d4;
  border: 1px solid #808080;
  text-align: center;
  padding: 4px 0;
  font-family: "Courier New", monospace;
  cursor: pointer;
  user-select: none;
}

.tracker-step:nth-child(4n) {
  border-right: 2px solid #5a5a5a;
}

.tracker-step:hover {
  background: #ededed;
}

.tracker-step.active {
  background: #3ad483;
  color: #0b2d12;
  font-weight: bold;
}

.tracker-step.playhead {
  outline: 2px solid var(--win-blue);
}

.tracker-step.playhead.active {
  background: #6df3aa;
}

.tracker-keyboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.tracker-keys-help {
  background: #fffbe6;
  border: 1px dashed #d3a400;
  padding: 4px 6px;
}

.tracker-record-toggle {
  font-weight: bold;
}

.tracker-status {
  font-size: 13px;
  padding: 4px 6px;
  background: #f6f6f6;
  border: 1px solid #b0b0b0;
}

.midi-sequencer {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 8px;
  background: var(--win-gray);
  padding: 8px;
  position: relative;
}

.midi-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.midi-transport {
  display: flex;
  gap: 6px;
  align-items: center;
}

.midi-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.midi-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.midi-file-picker input[type="file"] {
  display: none;
}

.midi-file-picker {
  border: 1px solid #808080;
  background: #eaeaea;
  padding: 4px 6px;
  cursor: pointer;
}

.midi-status {
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid #b0b0b0;
  background: #f6f6f6;
}

.midi-body {
  display: flex;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.midi-track-list {
  width: 190px;
  border: 2px inset white;
  background: #e6e6e6;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.midi-track {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid #b0b0b0;
  background: #f8f8f8;
  cursor: pointer;
}

.midi-track.active {
  outline: 2px solid var(--win-blue);
  background: #ffffff;
}

.midi-track-swatch {
  width: 14px;
  height: 14px;
  border: 1px solid #404040;
}

.midi-track-name {
  font-weight: bold;
  flex: 1;
}

.midi-grid {
  flex: 1;
  border: 2px inset white;
  background: #f0f0f0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  --midi-steps: 32;
}

.midi-grid-row {
  display: grid;
  grid-template-columns: 70px repeat(var(--midi-steps), minmax(18px, 1fr));
  gap: 2px;
  align-items: center;
}

.midi-grid-row.header {
  font-size: 11px;
  color: #555;
  user-select: none;
}

.midi-grid-label {
  font-weight: bold;
  text-align: right;
  padding-right: 6px;
  font-size: 12px;
}

.midi-grid-cell {
  min-height: 20px;
  background: #d9d9d9;
  border: 1px solid #9b9b9b;
  cursor: pointer;
}

.midi-grid-cell:nth-child(4n + 2) {
  border-left: 2px solid #9b9b9b;
}

.midi-grid-cell:hover {
  background: #ededed;
}

.midi-grid-cell.on {
  box-shadow: inset 1px 1px 0 #ffffff;
}

.midi-grid-cell.playhead {
  outline: 2px solid var(--win-blue);
}

.midi-grid-cell.beat-marker {
  cursor: default;
  background: transparent;
  border: none;
  text-align: center;
}

.midi-flash {
  position: absolute;
  inset: 8px;
  opacity: 0.1;
  border: 2px solid #000;
  pointer-events: none;
  animation: midiFlash 0.18s ease-out forwards;
}

@keyframes midiFlash {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 0;
  }
}

.rss-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 6px;
}

.rss-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 6px;
  align-items: center;
  background: linear-gradient(#dcdcdc, #bfbfbf);
  padding: 6px;
  border: 1px solid var(--win-gray-shadow);
}

.rss-label {
  font-size: 13px;
  font-weight: bold;
}

.rss-url {
  width: 100%;
  height: 26px;
  border: 1px solid var(--win-gray-dark);
  padding: 2px 6px;
  font-family: var(--font-main);
}

.rss-preset {
  height: 26px;
  border: 1px solid var(--win-gray-dark);
}

.rss-status {
  font-size: 12px;
  color: #003366;
}

.rss-status-error {
  color: #a00000;
  font-weight: bold;
}

.rss-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.rss-list {
  background: white;
  border: 1px solid var(--win-gray-dark);
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rss-item {
  padding: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  background: #f7f7f7;
}

.rss-item:hover {
  border-color: var(--win-blue);
  background: #eef3ff;
}

.rss-item.active {
  border-color: var(--win-blue);
  background: #dce6ff;
}

.rss-item-title {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 2px;
}

.rss-item-date {
  font-size: 12px;
  color: #444;
}

.rss-empty {
  font-size: 13px;
  color: #333;
  padding: 8px;
}

.rss-preview {
  background: white;
  border: 1px solid var(--win-gray-dark);
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rss-preview-title {
  font-size: 18px;
  font-weight: bold;
}

.rss-preview-meta {
  font-size: 12px;
  color: #555;
}

.rss-preview-text {
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
}

.rss-preview-link {
  font-size: 13px;
  color: var(--win-blue);
  text-decoration: underline;
}

.netnews-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 6px;
}

.netnews-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: linear-gradient(#dcdcdc, #bfbfbf);
  border: 1px solid var(--win-gray-shadow);
}

.netnews-title {
  font-weight: bold;
  font-size: 14px;
}

.netnews-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.netnews-status {
  font-size: 12px;
  color: #003366;
}

.netnews-status-error {
  color: #a00000;
  font-weight: bold;
}

.netnews-layout {
  display: grid;
  grid-template-columns: 220px 320px 1fr;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.netnews-pane {
  background: white;
  border: 1px solid var(--win-gray-dark);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.netnews-pane-label {
  padding: 6px 8px;
  font-weight: bold;
  background: #efefef;
  border-bottom: 1px solid var(--win-gray-dark);
}

.netnews-groups,
.netnews-threads {
  padding: 6px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.netnews-group,
.netnews-thread {
  border: 1px solid transparent;
  padding: 6px;
  background: #f8f8f8;
  cursor: pointer;
}

.netnews-group:hover,
.netnews-thread:hover {
  border-color: var(--win-blue);
  background: #eef3ff;
}

.netnews-group.active,
.netnews-thread.active {
  border-color: var(--win-blue);
  background: #dce6ff;
}

.netnews-group-title,
.netnews-thread-title {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 2px;
}

.netnews-group-desc,
.netnews-thread-meta {
  font-size: 12px;
  color: #555;
}

.netnews-pane-article {
  padding: 10px;
  gap: 8px;
}

.netnews-article-title {
  font-size: 18px;
  font-weight: bold;
}

.netnews-article-meta {
  font-size: 12px;
  color: #555;
}

.netnews-article-body {
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
  flex: 1;
  overflow-y: auto;
}

.netnews-open-link {
  font-size: 13px;
  color: var(--win-blue);
  text-decoration: underline;
}

.netnews-empty {
  font-size: 13px;
  color: #444;
}

.browser-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
}

.browser-toolbar {
  display: flex;
  gap: 4px;
  padding: 4px;
  align-items: center;
  border-bottom: 1px solid var(--win-gray-shadow);
  background: linear-gradient(#dcdcdc, #bfbfbf);
}

.browser-btn {
  min-width: 28px;
  height: 24px;
  background: var(--win-gray);
  border-top: 1px solid white;
  border-left: 1px solid white;
  border-right: 1px solid black;
  border-bottom: 1px solid black;
  font-weight: bold;
  cursor: pointer;
}

.browser-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.browser-url {
  flex: 1;
  height: 24px;
  border: 1px solid var(--win-gray-dark);
  padding: 2px 6px;
  font-family: var(--font-main);
  font-size: 13px;
}

.browser-view {
  flex: 1;
  position: relative;
  background: white;
  border: 1px solid var(--win-gray-shadow);
  margin: 4px;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.browser-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.browser-status {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed var(--win-gray-shadow);
}

.vm-layout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  background: var(--win-gray);
}

.vm-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
  background: linear-gradient(#dcdcdc, #bfbfbf);
  border-bottom: 1px solid var(--win-gray-shadow);
}

.vm-actions {
  display: flex;
  gap: 6px;
}

.vm-status {
  flex: 1;
  font-size: 13px;
}

.vm-note {
  margin: 0 8px;
  padding: 6px;
  background: #f8f8f8;
  border: 1px dashed var(--win-gray-shadow);
  font-size: 13px;
}

.vm-view {
  flex: 1;
  margin: 0 6px 8px;
  border: 1px solid var(--win-gray-shadow);
  background: black;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.vm-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: black;
}

.radio-garden {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 10px;
  background: linear-gradient(#fdfefe, #e4f6f8);
  border: 1px solid var(--win-gray-shadow);
}

.radio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.radio-title {
  font-weight: 700;
  font-size: 18px;
  color: #0b5f66;
}

.radio-subtitle {
  color: #234b50;
  font-size: 13px;
}

.celeryman {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 10px;
  background: linear-gradient(#f5fff8, #e6f4ff);
  border: 1px solid var(--win-gray-shadow);
}

.celeryman-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.celeryman-title {
  font-weight: 700;
  font-size: 18px;
  color: #0b2239;
}

.celeryman-subtitle {
  color: #2a3f55;
  font-size: 13px;
}

.celeryman-actions {
  display: flex;
  gap: 8px;
}

.celeryman-status {
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--win-gray-shadow);
  background: #f5f5f5;
  color: #111;
  border-radius: 4px;
}

.celeryman-status[data-tone="error"] {
  background: #ffe8e5;
  color: #a10505;
}

.celeryman-status[data-tone="success"] {
  background: #e6f5ea;
  color: #0e5c2c;
}

.celeryman-frame-wrap {
  flex: 1;
  border: 1px solid var(--win-gray-shadow);
  background: #0b2239;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.15);
}

.celeryman-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #0b2239;
}

.radio-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.radio-search-input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--win-gray-shadow);
  background: white;
  font-size: 14px;
}

.radio-quick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-quick-label {
  font-weight: bold;
  color: #0b5f66;
}

.radio-quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-chip {
  background: #0fa4af;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.4), inset -1px -1px 0 rgba(0, 0, 0, 0.15);
}

.radio-chip:hover {
  background: #0c8e97;
}

.radio-status {
  font-size: 13px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #b5d9dd;
  color: #0b5f66;
}

.radio-status-error {
  border-color: #d06060;
  color: #8b1b1b;
  background: #ffecec;
}

.radio-results {
  flex: 1;
  overflow: auto;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.radio-card {
  background: #ffffff;
  border: 1px solid var(--win-gray-shadow);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.6), inset -1px -1px 0 rgba(0, 0, 0, 0.05);
}

.radio-card-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-card-title {
  font-weight: bold;
  color: #0b5f66;
}

.radio-card-sub {
  color: #234b50;
  font-size: 13px;
}

.radio-card-actions {
  display: flex;
  gap: 8px;
}

.radio-pill {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #0b5f66;
  background: #0fa4af;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.radio-pill:hover:not(:disabled) {
  background: #0c8e97;
}

.radio-pill:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.radio-pill.ghost {
  background: white;
  color: #0b5f66;
}

.radio-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  border: 1px dashed var(--win-gray-shadow);
  color: #234b50;
  background: #f8ffff;
}

.irc-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
}

.irc-header {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 6px;
  padding: 6px;
  border-bottom: 1px solid var(--win-gray-shadow);
  background: linear-gradient(#dcdcdc, #bfbfbf);
  font-size: 12px;
}

.irc-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.irc-field label {
  font-weight: bold;
  color: #202020;
}

.irc-field input {
  padding: 4px 6px;
  border: 1px solid var(--win-gray-dark);
  font-family: var(--font-main);
  font-size: 13px;
}

.irc-actions {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.irc-body {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 6px;
  padding: 6px;
  flex: 1;
  min-height: 0;
}

.irc-log {
  background: white;
  border: 1px solid var(--win-gray-dark);
  padding: 6px;
  overflow-y: auto;
  font-family: "Courier New", monospace;
  font-size: 13px;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.15);
}

.irc-log-row {
  margin-bottom: 4px;
}

.irc-log-time {
  color: #666;
}

.irc-log-prefix {
  font-weight: bold;
  color: #003366;
  margin-left: 4px;
}

.irc-log-row.irc-system .irc-log-prefix {
  color: #800000;
}

.irc-log-row.irc-bot .irc-log-prefix {
  color: #008000;
}

.irc-log-row.irc-self .irc-log-prefix {
  color: #000080;
}

.irc-sidebar {
  background: white;
  border: 1px solid var(--win-gray-dark);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.irc-sidebar-header {
  padding: 4px 6px;
  background: #dcdcdc;
  border-bottom: 1px solid var(--win-gray-shadow);
  font-weight: bold;
  text-align: center;
}

.irc-users {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  font-size: 13px;
}

.discord-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
  gap: 6px;
}

.discord-header {
  display: grid;
  grid-template-columns: repeat(2, 1fr) auto;
  gap: 6px;
  padding: 6px;
  background: linear-gradient(#dcdcdc, #bfbfbf);
  border-bottom: 1px solid var(--win-gray-shadow);
  font-size: 12px;
}

.discord-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.discord-field label {
  font-weight: bold;
}

.discord-field input {
  padding: 4px 6px;
  border: 1px solid var(--win-gray-dark);
  font-size: 13px;
  font-family: var(--font-main);
}

.discord-actions {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.discord-status {
  padding: 4px 8px;
  margin: 0 6px;
  border: 1px solid var(--win-gray-shadow);
  background: #f7f7f7;
  font-size: 13px;
}

.discord-status[data-tone="error"] {
  background: #fff0f0;
  color: #8b0000;
  border-color: #c05050;
}

.discord-status[data-tone="success"] {
  background: #f0fff4;
  color: #0b5f2d;
  border-color: #4caf50;
}

.discord-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 6px;
  padding: 0 6px 6px;
  flex: 1;
  min-height: 0;
}

.discord-log {
  background: white;
  border: 1px solid var(--win-gray-dark);
  padding: 8px;
  overflow-y: auto;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discord-empty {
  text-align: center;
  color: #555;
}

.discord-msg-meta {
  font-weight: bold;
  color: #2c2f33;
  margin-bottom: 2px;
}

.discord-msg-body {
  background: #f5f5f5;
  border: 1px solid var(--win-gray-shadow);
  padding: 6px;
  white-space: pre-wrap;
}

.spotify {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.spotify-toolbar {
  display: flex;
  gap: 8px;
}

.spotify-input {
  flex: 1;
  padding: 6px;
}

.spotify-status {
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border-dark, #808080);
  background: #f5f5f5;
  color: #111;
  border-radius: 4px;
}

.spotify-status[data-tone="error"] {
  background: #ffe8e5;
  color: #a10505;
}

.spotify-status[data-tone="success"] {
  background: #e6f5ea;
  color: #0e5c2c;
}

.retromail {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(#f7f7ff, #ededf9);
  color: #111;
  font-size: 13px;
}

.mail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px;
  border-bottom: 1px solid var(--win-gray-shadow);
  background: linear-gradient(#dcdcff, #c0c0e8);
  box-shadow: inset 0 1px 0 #fff;
}

.mail-toolbar-left,
.mail-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mail-toolbar label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
}

.mail-toolbar input,
.mail-toolbar select {
  padding: 4px 6px;
  border: 1px solid var(--win-gray-dark);
  font-family: var(--font-main);
  font-size: 13px;
  background: white;
}

.mail-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 250px 1fr 1.1fr;
  gap: 8px;
  padding: 8px;
}

.mail-sidebar {
  background: #fdfdfd;
  border: 1px solid var(--win-gray-shadow);
  box-shadow: inset 1px 1px 0 #fff, 1px 1px 2px rgba(0, 0, 0, 0.15);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mail-panel-title {
  font-weight: bold;
  color: #000080;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.mail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.mail-field input,
.mail-field textarea {
  padding: 4px 6px;
  border: 1px solid var(--win-gray-dark);
  font-family: var(--font-main);
  font-size: 13px;
  background: linear-gradient(#fff, #f6f6ff);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.08);
}

.mail-status,
.mail-compose-status {
  padding: 6px 8px;
  border: 1px solid var(--win-gray-shadow);
  background: #eef2ff;
  color: #202020;
  font-size: 12px;
  box-shadow: inset 1px 1px 0 #fff;
}

.mail-status-error {
  background: #ffecec;
  color: #8a0000;
}

.mail-list {
  background: #fff;
  border: 1px solid var(--win-gray-shadow);
  box-shadow: inset 1px 1px 0 #fff;
  overflow-y: auto;
  min-height: 0;
}

.mail-row {
  padding: 8px;
  border-bottom: 1px solid #e2e2f0;
  cursor: pointer;
  background: linear-gradient(#ffffff, #f8f8ff);
}

.mail-row:hover {
  background: #eef0ff;
}

.mail-row.active {
  outline: 2px solid #000080;
  background: linear-gradient(#e4e8ff, #ccd4ff);
}

.mail-row.unread .mail-row-subject {
  font-weight: bold;
}

.mail-row-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
}

.mail-row-date {
  color: #555;
}

.mail-row-subject {
  color: #000;
  margin-top: 2px;
}

.mail-row-flags {
  margin-top: 2px;
  color: #000080;
}

.mail-empty {
  padding: 12px;
  color: #555;
}

.mail-preview {
  border: 1px solid var(--win-gray-shadow);
  background: white;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  box-shadow: inset 1px 1px 0 #fff;
  min-height: 0;
}

.mail-preview-header {
  border-bottom: 1px dashed #b0b0d0;
  padding-bottom: 6px;
}

.mail-preview-meta {
  font-size: 12px;
  color: #303050;
  margin-bottom: 4px;
}

.mail-preview-subject {
  font-size: 18px;
  font-weight: bold;
  color: #000080;
}

.mail-preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #d0d0ff;
  background: #fbfbff;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.08);
}

.mail-attachments {
  border: 1px solid var(--win-gray-shadow);
  padding: 6px;
  background: #f7f7ff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mail-attachment-row {
  padding: 4px 6px;
  background: #fff;
  border: 1px solid #d0d0ff;
  font-size: 12px;
}

.mail-attachment-row.empty {
  color: #666;
  font-style: italic;
}

.mail-inline-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px dashed #b0b0d0;
  padding: 6px;
  background: #fdfdff;
  min-height: 60px;
}

.mail-inline {
  border: 1px solid #8a8af0;
  padding: 4px;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.mail-inline img {
  max-width: 140px;
  max-height: 140px;
  display: block;
}

.mail-inline-empty {
  color: #606080;
  font-size: 12px;
}

.mail-compose {
  border-top: 1px solid #d0d0ff;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spotify-player {
  flex: 1;
  border: 1px solid var(--border-dark, #808080);
  background: #0c0f12;
  border-radius: 6px;
  padding: 4px;
  display: flex;
}

.spotify-embed {
  border: none;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: #000;
}

.discord-compose {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discord-message {
  width: 100%;
  height: 140px;
  resize: vertical;
  padding: 6px;
  border: 1px solid var(--win-gray-dark);
  font-family: var(--font-main);
  font-size: 13px;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.15);
}

.discord-compose-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.discord-help {
  font-size: 12px;
  color: #555;
}

.radio-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
}

.radio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px;
  background: linear-gradient(#dcdcdc, #bfbfbf);
  border-bottom: 1px solid var(--win-gray-shadow);
  font-size: 12px;
}

.radio-search {
  display: flex;
  gap: 6px;
  flex: 1;
}

.radio-query {
  flex: 1;
  padding: 4px 6px;
  border: 1px solid var(--win-gray-dark);
  font-family: var(--font-main);
  font-size: 13px;
}

.radio-status {
  color: #303030;
}

.radio-status.radio-error {
  color: #800000;
  font-weight: bold;
}

.radio-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
  padding: 8px;
  flex: 1;
  min-height: 0;
}

.radio-list {
  background: white;
  border: 1px solid var(--win-gray-dark);
  padding: 6px;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-item {
  text-align: left;
  background: #f6f6f6;
  border: 1px solid #b0b0b0;
  padding: 6px;
  cursor: pointer;
  font-family: var(--font-main);
  transition: background 0.1s ease, border-color 0.1s ease;
}

.radio-item:hover {
  background: #e8f0ff;
  border-color: #6b8cff;
}

.radio-item.active {
  background: #dfe7ff;
  border-color: #4a6ee0;
}

.radio-station-title {
  font-weight: bold;
  margin-bottom: 2px;
}

.radio-meta-line {
  font-size: 12px;
  color: #444;
}

.radio-player {
  background: white;
  border: 1px solid var(--win-gray-dark);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-now {
  font-weight: bold;
}

.radio-actions {
  display: flex;
  gap: 6px;
}

.radio-audio {
  width: 100%;
}

.radio-meta {
  font-size: 12px;
  color: #303030;
}

.radio-empty {
  color: #555;
  font-style: italic;
  padding: 6px;
}

@media (max-width: 900px) {
  .radio-body {
    grid-template-columns: 1fr;
  }
}

.irc-user {
  padding: 2px 4px;
  border-bottom: 1px dotted var(--win-gray-shadow);
}

.irc-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 6px;
  border-top: 1px solid var(--win-gray-shadow);
  background: #dcdcdc;
}

.irc-input {
  padding: 6px;
  border: 1px solid var(--win-gray-dark);
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.sound-controls {
  display: flex;
  gap: 5px;
}

.media-btn {
  width: 32px;
  height: 32px;
  background: var(--win-gray);
  border: 2px solid white;
  border-right-color: #808080;
  border-bottom-color: #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.media-btn:active {
  border: 2px solid #808080;
  border-right-color: white;
  border-bottom-color: white;
}

.symbol-rec {
  width: 12px;
  height: 12px;
  background: #800000;
  border-radius: 50%;
}

.symbol-stop {
  width: 12px;
  height: 12px;
  background: black;
}

.symbol-play {
  width: 0;
  height: 0;
  border-left: 12px solid black;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.char-map-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
  padding: 5px;
}

.char-map-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  background: white;
  border: 1px solid #808080;
  padding: 6px;
  margin-bottom: 6px;
}

.char-preview {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 40px;
  border: 1px solid #808080;
  background: #f3f3f3;
}

.char-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.char-code {
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.char-font-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.char-font {
  height: 22px;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 1px;
  background: white;
  border: 1px solid #808080;
  height: 200px;
  overflow-y: scroll;
  margin-bottom: 5px;
  padding: 2px;
}

.char-cell {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Times New Roman", serif;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
}

.char-cell:hover {
  border: 1px solid blue;
}

.char-cell.active {
  background: var(--win-blue);
  color: white;
}

.char-controls {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.copy-row {
  display: flex;
  gap: 5px;
}

.char-input {
  flex-grow: 1;
  border: 1px solid #808080;
}

.winfile-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
}

.drive-bar {
  height: 28px;
  background: var(--win-gray);
  border-bottom: 1px solid #808080;
  display: flex;
  align-items: center;
  padding: 0 5px;
  gap: 10px;
}

.drive-icon {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 2px 6px;
  border: 1px solid transparent;
}

.drive-icon:hover {
  border: 1px solid #808080;
}

.drive-icon.active {
  border: 1px solid black;
  background: #fff;
}

.winfile-main {
  flex-grow: 1;
  display: flex;
  padding: 2px;
  gap: 2px;
}

.winfile-pane {
  flex: 1;
  background: white;
  border: 1px solid #808080;
  overflow: auto;
  font-family: var(--font-main);
  font-size: 13px;
}

.winfile-pane-header {
  background: black;
  color: white;
  padding: 2px 5px;
  font-weight: bold;
}

.tree-item {
  padding: 1px 4px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tree-item:hover {
  background: #e0e0e0;
}

.tree-item.selected {
  background: var(--win-blue);
  color: white;
}

.file-list-view {
  padding: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 4px;
  cursor: pointer;
}

.file-item:hover {
  background: #e0e0e0;
}

.file-item.selected {
  background: var(--win-blue);
  color: white;
}

.tiny-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  image-rendering: pixelated;
}

.clock-layout {
  width: 100%;
  height: 100%;
  background: var(--win-gray);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.clock-canvas {
  background: transparent;
}

.clock-digital {
  font-family: "VT323", monospace;
  font-size: 48px;
  color: #00ff00;
  background: black;
  padding: 5px 20px;
  border: 4px solid #808080;
  border-right-color: white;
  border-bottom-color: white;
}

.control-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 15px;
  padding: 15px;
  background: white;
  height: 100%;
}

.cp-menu-bar {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--win-gray);
  border-bottom: 1px solid var(--win-gray-dark);
}

.cp-tab-btn.active,
.cp-menu-item.active {
  background: var(--win-blue);
  color: white;
}

.cp-view-area {
  height: calc(100% - 45px);
  overflow: auto;
}

.control-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.control-icon:hover .control-label {
  background-color: var(--win-blue);
  color: white;
}

.control-label {
  margin-top: 4px;
  font-size: 13px;
  padding: 1px 4px;
}

.cp-settings-layout {
  padding: 10px;
  background: var(--win-gray);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-section {
  border: 1px solid white;
  border-right-color: black;
  border-bottom-color: black;
  padding: 10px;
}

.cp-font-preview {
  background: white;
  border: 1px solid var(--win-gray-dark);
  border-right-color: var(--win-gray-light);
  border-bottom-color: var(--win-gray-light);
  padding: 8px;
  min-height: 50px;
  display: flex;
  align-items: center;
}

.cp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.cp-saver-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.cp-saver-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.cp-saver-note {
  margin-top: 8px;
  font-size: 12px;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

.volume-slider {
  flex: 1;
}

.volume-percent {
  width: 48px;
  text-align: right;
  font-weight: bold;
}

.volume-mute {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 13px;
}

.volume-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.volume-note {
  margin-top: 8px;
  font-size: 12px;
}

.write-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
}

.write-toolbar {
  padding: 4px;
  display: flex;
  gap: 5px;
  border-bottom: 1px solid #808080;
}

.write-select {
  height: 24px;
  border: 1px solid gray;
  background: white;
  font-size: 12px;
  font-family: var(--font-main);
  padding: 0 4px;
}

.fmt-btn {
  width: 24px;
  height: 24px;
  border: 1px solid gray;
  background: #e0e0e0;
  font-weight: bold;
  font-family: serif;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fmt-btn:active {
  border: 1px solid black;
  background: #c0c0c0;
}

.write-editor {
  flex-grow: 1;
  background: white;
  overflow-y: auto;
  padding: 10px;
  font-family: "Times New Roman", serif;
  font-size: 16px;
  outline: none;
  white-space: pre-wrap;
}

.cardfile-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-gray);
  font-family: var(--font-main);
  font-size: 13px;
}

.cardfile-menu {
  border-bottom: 1px solid #808080;
  padding: 4px;
  display: flex;
  gap: 5px;
}

.card-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 5px;
  overflow: hidden;
}

.card-index-list {
  height: 80px;
  background: white;
  border: 1px solid #808080;
  overflow-y: scroll;
  margin-bottom: 5px;
}

.card-index-item {
  padding: 1px 4px;
  cursor: pointer;
  border-bottom: 1px dotted #ccc;
}

.card-index-item.active {
  background: var(--win-blue);
  color: white;
}

.card-body-view {
  flex-grow: 1;
  background: white;
  border: 1px solid black;
  box-shadow: 3px 3px 0 #808080;
  display: flex;
  flex-direction: column;
}

.card-header-bar {
  background: #e0e0e0;
  border-bottom: 1px solid black;
  padding: 3px;
  font-weight: bold;
}

.card-content-area {
  flex-grow: 1;
  border: none;
  resize: none;
  padding: 5px;
  font-family: var(--font-main);
  outline: none;
}

.sol-layout {
  width: 100%;
  height: 100%;
  background: #008000;
  display: flex;
  flex-direction: column;
  padding: 10px;
  user-select: none;
}

.sol-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  height: 96px;
}

.sol-deck-area {
  display: flex;
  gap: 10px;
}

.sol-foundations {
  display: flex;
  gap: 10px;
}

.sol-tableau {
  display: flex;
  justify-content: space-between;
  height: 100%;
}

.sol-col {
  position: relative;
  width: 71px;
  height: 100%;
}

.sol-focus {
  outline: 2px solid yellow;
  outline-offset: 3px;
}

.sudoku-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 8px;
  padding: 10px;
  background: #d6d6d6;
}

.sudoku-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sudoku-field {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sudoku-status {
  min-height: 20px;
  font-size: 13px;
}

.sudoku-grid {
  background: #f5f5f5;
  border: 2px solid #808080;
  box-shadow: inset 0 0 0 2px #fff;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0;
  flex-grow: 1;
  padding: 6px;
  max-width: 460px;
  align-self: center;
}

.sudoku-cell {
  width: 100%;
  height: 100%;
  min-height: 44px;
  font-size: 18px;
  text-align: center;
  border: 1px solid #a0a0a0;
  background: white;
  box-sizing: border-box;
}

.sudoku-given {
  background: #e8eefc;
  font-weight: bold;
}

.sudoku-error {
  background: #ffdddd;
  border-color: #d00000;
}

.sudoku-bold-left {
  border-left-width: 3px;
}

.sudoku-bold-right {
  border-right-width: 3px;
}

.sudoku-bold-top {
  border-top-width: 3px;
}

.sudoku-bold-bottom {
  border-bottom-width: 3px;
}

.mafia-layout {
  display: flex;
  gap: 10px;
  height: 100%;
  background: #d6d6d6;
  padding: 10px;
}

.mafia-sidebar {
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mafia-section {
  background: #f5f5f5;
  border: 1px solid #9c9c9c;
  padding: 8px;
  box-shadow: inset 0 1px 0 #fff;
  border-radius: 4px;
}

.mafia-section-title {
  font-weight: bold;
  margin-bottom: 6px;
}

.mafia-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  margin-bottom: 6px;
}

.mafia-field input,
.mafia-field select {
  width: 100%;
}

.mafia-hint {
  font-size: 11px;
  color: #1f2a44;
  background: #eef5ff;
  border: 1px dashed #8ba4d8;
  padding: 6px;
  border-radius: 4px;
}

.mafia-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mafia-status {
  min-height: 22px;
  font-weight: bold;
  background: #fefefe;
  border: 1px solid #888;
  padding: 6px;
}

.mafia-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mafia-log {
  flex: 1;
  background: #0e0e0e;
  color: #e6e6e6;
  border: 1px solid #555;
  padding: 8px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 12px;
  border-radius: 4px;
}

.mafia-log-entry + .mafia-log-entry {
  margin-top: 6px;
}

.mafia-roster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.mafia-roster-row {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
}

.mafia-role {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: white;
  border: 1px solid #444;
  text-transform: capitalize;
}

.mafia-role-mafia {
  background: #b34747;
}

.mafia-role-detective {
  background: #3650a6;
}

.mafia-role-doctor {
  background: #2c8f6e;
}

.mafia-role-villager {
  background: #6c6c6c;
}

.mafia-role-hidden {
  background: #4a4a4a;
  border-style: dashed;
}

.mafia-player-name.mafia-faded {
  opacity: 0.55;
  text-decoration: line-through;
}

.card {
  width: 71px;
  height: 96px;
  background: white;
  border-radius: 4px;
  border: 1px solid black;
  position: absolute;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px;
  font-family: sans-serif;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
}

.card.red {
  color: red;
}

.card.black {
  color: black;
}

.card.back {
  background: repeating-linear-gradient(
    45deg,
    #000080,
    #000080 5px,
    #fff 5px,
    #fff 7px
  );
  border: 2px solid white;
}

.card.selected {
  border: 2px solid yellow;
  box-shadow: 0 0 5px yellow;
  z-index: 999 !important;
}

.card-ph {
  width: 71px;
  height: 96px;
  border: 1px solid #004000;
  border-radius: 4px;
  position: relative;
}

.card-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
}

.win-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.clip-area {
  width: 100%;
  height: 100%;
  resize: none;
  border: none;
  padding: 5px;
  font-family: var(--font-main);
  background: #e0e0e0;
}

.reversi-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #c0c0c0;
  height: 100%;
  padding: 10px;
}

.reversi-board {
  display: grid;
  grid-template-columns: repeat(8, 30px);
  grid-template-rows: repeat(8, 30px);
  border: 2px solid #808080;
  background: #008000;
  gap: 1px;
}

.reversi-cell {
  width: 30px;
  height: 30px;
  background: #008000;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.reversi-piece {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.reversi-piece.red {
  background: radial-gradient(circle at 8px 8px, #ff4040, #800000);
}

.reversi-piece.blue {
  background: radial-gradient(circle at 8px 8px, #4040ff, #000080);
}

.reversi-status {
  margin-bottom: 10px;
  font-weight: bold;
  font-family: sans-serif;
}

.mplayer-layout {
  background: #c0c0c0;
  height: 100%;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mplayer-screen {
  background: black;
  flex-grow: 1;
  border: 2px solid #808080;
  border-bottom-color: white;
  border-right-color: white;
  position: relative;
  overflow: hidden;
}

.mplayer-screen canvas,
.mplayer-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mplayer-screen canvas {
  image-rendering: pixelated;
}

.mplayer-video {
  object-fit: contain;
  background: black;
}

.mplayer-overlay {
  position: absolute;
  inset: 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 6px;
}

.mplayer-track-label {
  color: #e0ffe6;
  font-family: "Lucida Console", monospace;
  font-size: 12px;
  text-shadow: 1px 1px 0 #000;
}

.mplayer-seek-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c0ffd8;
  font-size: 12px;
  text-shadow: 1px 1px 0 #000;
}

.mplayer-seek {
  flex-grow: 1;
}

.mplayer-time {
  min-width: 42px;
  text-align: center;
}

.mplayer-controls {
  display: flex;
  gap: 5px;
  border-top: 1px solid white;
  padding-top: 5px;
}

.mplayer-track-select {
  flex-grow: 1;
  height: 24px;
  border: 1px solid #808080;
  background: #fff;
  font-size: 12px;
  padding: 0 4px;
}

.mplayer-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #808080;
  background: #c0c0c0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  cursor: pointer;
}

.mplayer-btn:active {
  border: 1px solid black;
}

.mplayer-load-btn {
  border: 1px solid #808080;
  background: linear-gradient(180deg, #f5f5f5, #c0c0c0);
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mplayer-load-btn input {
  display: none;
}

.mplayer-status {
  font-size: 12px;
  color: #1f4430;
  background: #e8f4ed;
  border: 1px solid #808080;
  padding: 4px 6px;
}

.mplayer-file-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simcity-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.simcity-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #d0d0d0;
  border: 1px solid #808080;
  padding: 6px;
  box-shadow: inset 1px 1px 0px white, inset -1px -1px 0px #808080;
}

.simcity-stats {
  display: flex;
  gap: 12px;
  font-weight: bold;
  font-family: var(--font-main);
}

.simcity-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.simcity-tools button {
  border: 1px solid #808080;
  background: #c0c0c0;
  padding: 4px 8px;
  cursor: pointer;
  box-shadow: inset 1px 1px 0px white, inset -1px -1px 0px #808080;
}

.simcity-tools button.active {
  background: #000080;
  color: white;
}

.simcity-map {
  flex: 1;
  display: grid;
  gap: 2px;
  background: #3a5f2f;
  border: 2px solid #444;
  padding: 6px;
}

.simcity-cell {
  width: 100%;
  padding-bottom: 100%;
  position: relative;
  border: 1px solid #2b2b2b;
}

.simcity-cell::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.tile-grass { background: #4caf50; }
.tile-road { background: #b59b6a; }
.tile-house { background: linear-gradient(135deg, #90caf9, #64b5f6); }
.tile-power { background: linear-gradient(135deg, #fbc02d, #ffb74d); }
.tile-park { background: #66bb6a; }

.simcity-log {
  background: #1f1f1f;
  color: #d8ffd8;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px;
  height: 70px;
  overflow: auto;
  border: 1px solid #000;
  white-space: pre-line;
}

.papers-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 6px;
  background: #dcdcdc;
  font-family: var(--font-main);
}

.papers-header {
  background: #b0b0b0;
  padding: 6px 8px;
  border: 1px solid #808080;
  box-shadow: inset 1px 1px 0px white, inset -1px -1px 0px #808080;
}

.papers-title {
  font-weight: bold;
  letter-spacing: 0.5px;
}

.papers-subtitle {
  font-style: italic;
  color: #4a4a4a;
  font-size: 12px;
}

.papers-stats {
  background: #f4f4f4;
  border: 1px solid #808080;
  padding: 4px 6px;
  font-family: var(--font-mono);
}

.papers-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.papers-docs {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: center;
  background: #fdfdfd;
  border: 1px solid #808080;
  padding: 8px;
}

.papers-photo {
  width: 120px;
  height: 120px;
  border: 2px solid #404040;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
  box-shadow: inset 1px 1px 0px white, inset -1px -1px 0px #808080;
}

.papers-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 6px;
}

.papers-field {
  background: #e9e9e9;
  border: 1px solid #aaaaaa;
  padding: 4px 6px;
  font-size: 13px;
}

.papers-label {
  font-weight: bold;
  color: #000080;
  margin-right: 4px;
}

.papers-reason {
  background: #fff9e6;
  border: 1px solid #b8860b;
  padding: 6px;
  min-height: 36px;
  box-shadow: inset 1px 1px 0px #fff3c4;
}

.papers-reason.invalid {
  color: #8b0000;
  font-weight: bold;
}

.papers-actions {
  display: flex;
  gap: 8px;
}

.papers-actions .task-btn {
  flex: 1;
}

.papers-log {
  flex: 1;
  background: #101010;
  color: #a3ffbf;
  border: 1px solid #000;
  padding: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-line;
  overflow: auto;
  min-height: 80px;
}

.skifree-layout {
  background: linear-gradient(#dfeef8, #c8ddf0);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  outline: none;
}

.skifree-layout:focus {
  outline: 2px dashed #000080;
  outline-offset: 2px;
}

.skifree-hud {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.skifree-stat,
.skifree-status {
  background: #c0dff5;
  border: 1px solid #6d8aaa;
  padding: 4px 6px;
  font-weight: bold;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6884a5;
}

.skifree-status {
  flex: 1;
}

.skifree-canvas {
  width: 100%;
  height: 360px;
  border: 2px solid #6d8aaa;
  background: #f5fbff;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6d8aaa;
}

.skifree-help {
  font-size: 12px;
  color: #0f2e4d;
  background: #cde2f3;
  border: 1px solid #6d8aaa;
  padding: 4px 6px;
}

.angrybirds-layout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: linear-gradient(180deg, #f7fbff, #e7f3ff);
  outline: none;
}

.angrybirds-layout:focus {
  outline: 2px dashed #5086c1;
  outline-offset: 2px;
}

.angrybirds-hud {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  flex-wrap: wrap;
}

.angrybirds-stat {
  padding: 4px 8px;
  background: #e2edff;
  border: 1px solid #98b6e4;
  border-radius: 4px;
}

.angrybirds-status {
  flex: 1;
  font-weight: 600;
  color: #214c7b;
}

.angrybirds-canvas {
  border: 2px solid #3b6aa4;
  border-radius: 6px;
  background: #cde9ff;
  width: 100%;
  height: auto;
}

.angrybirds-help {
  font-size: 11px;
  color: #375070;
}

.cannonduel-root {
  background: linear-gradient(#dfe9ff, #c7d7f2);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  outline: none;
}

.cannonduel-root:focus {
  outline: 2px dashed #000080;
  outline-offset: 2px;
}

.cannonduel-hud {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cannonduel-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #c7d7f2;
  border: 1px solid #6d8aaa;
  padding: 6px 8px;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6d8aaa;
}

.cannonduel-title {
  font-weight: bold;
  color: #142850;
}

.cannonduel-status {
  font-weight: bold;
  color: #203864;
}

.cannonduel-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cannonduel-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e4ecff;
  border: 1px solid #6d8aaa;
  padding: 4px 6px;
  font-weight: bold;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6d8aaa;
}

.cannonduel-health {
  flex: 1;
  height: 10px;
  background: #1f1f1f;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #555, inset -1px -1px 0 #000;
}

.cannonduel-health-fill {
  height: 100%;
  transition: width 0.2s ease;
}

.cannonduel-health-fill.p1 {
  background: linear-gradient(90deg, #f58549, #e4572e);
}

.cannonduel-health-fill.p2 {
  background: linear-gradient(90deg, #6ea8fe, #3b7dd8);
}

.cannonduel-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #c7d7f2;
  border: 1px solid #6d8aaa;
  padding: 6px 8px;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6d8aaa;
}

.cannonduel-canvas {
  width: 100%;
  height: 420px;
  border: 2px solid #6d8aaa;
  background: #e9f2ff;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6d8aaa;
}

.cannonduel-help {
  font-size: 12px;
  color: #142850;
  background: #d9e5ff;
  border: 1px solid #6d8aaa;
  padding: 4px 6px;
}

.pinball {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  outline: none;
}

.pinball-hud {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #0f172a, #0a0f1a);
  color: #e5e7eb;
  padding: 8px 10px;
  border: 2px solid #1f2937;
  border-radius: 6px;
}

.pinball-stat {
  font-weight: bold;
  font-family: "MS Sans Serif", sans-serif;
}

.pinball-status {
  flex: 1;
  font-size: 12px;
  color: #cbd5e1;
}

.pinball-canvas {
  width: 100%;
  flex: 1;
  border: 2px solid #111827;
  border-radius: 10px;
  background: #0b1020;
}

.pinball-help {
  text-align: center;
  font-size: 12px;
  color: #374151;
  margin-top: 2px;
}

.linerider-layout {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  background: linear-gradient(#f7fbff, #e4f0ff);
}

.linerider-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.linerider-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.linerider-mode.active {
  background: linear-gradient(#fefefe, #cde2f3);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #5779a4;
  border-color: #5779a4;
}

.linerider-canvas {
  width: 100%;
  height: 360px;
  border: 2px solid #5779a4;
  background: #f1f6ff;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #5779a4;
}

.linerider-status {
  font-size: 13px;
  background: #dce9fb;
  border: 1px solid #5779a4;
  padding: 6px;
}

#screensaver {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  z-index: 9999;
  display: none;
  cursor: none;
}

#screensaver.locked {
  cursor: default;
}

#bsod-overlay {
  position: absolute;
  inset: 0;
  background: #0c4cb3;
  color: #cddfff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: left;
  padding: 40px;
  z-index: 2;
}

#bsod-overlay.visible {
  display: flex;
}

#saver-lock {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #f5f5f5;
  font-family: "MS Sans Serif", Arial, sans-serif;
  z-index: 2;
}

.saver-lock-dialog {
  background: linear-gradient(#f0f4ff, #c9d9ff);
  color: #000;
  border: 2px solid #4b64a2;
  box-shadow: 0 0 0 1px #ffffff inset, 0 8px 16px rgba(0, 0, 0, 0.35);
  padding: 16px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 4px;
}

.saver-lock-title {
  font-weight: bold;
  font-size: 16px;
}

.saver-lock-text {
  font-size: 13px;
}

.saver-lock-dialog input {
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #5779a4;
  border-radius: 2px;
}

.saver-lock-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.saver-lock-error {
  color: #b00020;
  font-size: 12px;
  min-height: 16px;
}

.bsod-content {
  max-width: 720px;
  line-height: 1.6;
}

.bsod-sad {
  font-size: 96px;
  margin-bottom: 24px;
}

.bsod-message {
  font-size: 20px;
  margin-bottom: 16px;
}

.bsod-code {
  font-family: monospace;
  margin-bottom: 12px;
}

.bsod-footer {
  font-size: 14px;
  opacity: 0.85;
}

#saver-canvas,
#saver-maze-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#saver-maze-canvas {
  display: none;
}

.svg-icon {
  width: 32px;
  height: 32px;
}

.chess-layout {
  display: flex;
  gap: 10px;
  height: 100%;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 42px);
  grid-template-rows: repeat(8, 42px);
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
}

.chess-square {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
}

.chess-square.light {
  background: #dcdcdc;
}

.chess-square.dark {
  background: #808080;
}

.chess-square.selected {
  outline: 2px solid #0000ff;
}

.chess-square.hint::after {
  content: "";
  width: 10px;
  height: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
}

.chess-piece {
  filter: drop-shadow(1px 1px 0 #000);
}

.chess-piece.white {
  color: #fff;
}

.chess-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chess-status {
  background: #000080;
  color: #fff;
  padding: 6px;
  font-weight: bold;
  font-size: 14px;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
}

.chess-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chess-fen {
  flex: 1;
  min-width: 200px;
  height: 26px;
  padding: 2px 4px;
  font-family: var(--font-mono);
}

.chess-moves {
  flex: 1;
  overflow: auto;
  border: 1px solid #000;
  padding: 6px;
  background: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
}

.chess-move-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr;
  gap: 4px;
  padding: 2px 0;
}

.mv-num {
  font-weight: bold;
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    z-index: 20000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.splash-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.win-logo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 80px;
    height: 80px;
    gap: 4px;
    transform: skewX(-10deg);    
}

.win-pane {
    width: 100%;
    height: 100%;
    border: 1px solid black;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.5);    
}

.win-pane.red { background-color: #cf6060; border-radius: 30px 0 0 0; }
.win-pane.green { background-color: #11fc11; border-radius: 0 30px 0 0; }
.win-pane.blue { background-color: #3131ee; border-radius: 0 0 0 30px; }
.win-pane.yellow { background-color: #eeee00; border-radius: 0 0 30px 0; }

.splash-text {
    color: white;
    font-family: "Times New Roman", serif;
}

.splash-text h1 {
    font-size: 42px;
    margin: 0;
    font-weight: normal;
    line-height: 1;
}

.splash-text h1 .win-font {
    font-weight: bold;
    font-size: 56px;
    display: block;
}

.splash-version {
    font-family: "Arial", sans-serif;
    font-size: 14px;
    margin-top: 10px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.v-rect {
    border: 1px solid white;
    padding: 1px 4px;
    font-size: 10px;
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    background-image: none;
    z-index: 20000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
}

.splash-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.splash-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.xp-load-container {
    width: 250px;
    height: 16px;
    border: 2px solid #b2b2b2;
    border-radius: 4px;
    background: black;
    padding: 2px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px #505050;
}

.xp-load-bar {
    width: 15px;
    height: 100%;
    background: linear-gradient(180deg, #2b60de 0%, #7da2f5 30%, #2b60de 100%);
    position: absolute;
    top: 0;
    border-radius: 2px;
    opacity: 0;
    animation: xp-load 2.5s infinite linear;
    box-shadow: 0 0 4px #2b60de;
}

.xp-load-bar:nth-child(1) { animation-delay: 0s; }
.xp-load-bar:nth-child(2) { animation-delay: 0.15s; }
.xp-load-bar:nth-child(3) { animation-delay: 0.3s; }

@keyframes xp-load {
    0% {
        left: -20px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}
.minecraft-embed {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 6px;
}

.minecraft-loading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.minecraft-progress-bar {
  height: 10px;
  border: 1px solid var(--border-dark, #808080);
  background: var(--window-bg, #f0f0f0);
  position: relative;
  overflow: hidden;
}

.minecraft-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #6fa74f, #9b7d46);
  transition: width 0.3s ease;
}

.minecraft-iframe {
  flex: 1;
  width: 100%;
  border: 1px solid var(--border-dark, #808080);
  background: black;
}

.minecraft-note {
  font-size: 12px;
  padding: 6px 8px;
  background: var(--window-bg, #f0f0f0);
  border: 1px solid var(--border-dark, #808080);
}

.minecraft-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.minecraft-actions .task-btn {
  min-width: 120px;
  text-align: center;
}

.minecraft-loading-hidden {
  display: none;
}

.sandspiel-embed {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 6px;
}

.sandspiel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sandspiel-status {
  flex: 1;
  min-width: 220px;
  font-size: 12px;
  padding: 6px 8px;
  background: var(--window-bg, #f0f0f0);
  border: 1px solid var(--border-dark, #808080);
}

.sandspiel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sandspiel-actions .task-btn {
  min-width: 120px;
  text-align: center;
}

.sandspiel-iframe {
  flex: 1;
  width: 100%;
  border: 1px solid var(--border-dark, #808080);
  background: #0c0c0c;
}

.sandspiel3d {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.sandspiel3d-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sandspiel3d-title {
  font-weight: bold;
}

.sandspiel3d-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.sandspiel3d-field {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 12px;
}

.sandspiel3d-field input,
.sandspiel3d-field select {
  min-width: 120px;
}

.sandspiel3d-stage {
  position: relative;
  flex: 1;
  border: 1px solid var(--border-dark, #808080);
  background: #0c0f1c;
}

.sandspiel3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  background: transparent;
}

.sandspiel3d-overlay {
  position: absolute;
  bottom: 6px;
  left: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #e6ecff;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.shaderlab {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #0b0f1d;
  color: #e6ecff;
}

.shaderlab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: linear-gradient(90deg, #0f1832, #0c1528);
  border-bottom: 1px solid #1f2a44;
}

.shaderlab-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shaderlab-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #c6d4ff;
}

.shaderlab-field select {
  background: #0c1528;
  color: #e6ecff;
  border: 1px solid #25345a;
  border-radius: 4px;
  padding: 4px 6px;
}

.shaderlab-stats {
  display: flex;
  gap: 10px;
  font-family: monospace;
  font-size: 12px;
  color: #9fbaf5;
}

.shaderlab-body {
  display: grid;
  grid-template-columns: minmax(320px, 45%) 1fr;
  gap: 10px;
  padding: 10px;
  flex: 1;
  min-height: 0;
}

.shaderlab-editor {
  display: flex;
  flex-direction: column;
  background: #0b0d18;
  border: 1px solid #1f2a44;
  border-radius: 6px;
  overflow: hidden;
}

.shaderlab-editor-header {
  padding: 8px 10px;
  background: #101629;
  border-bottom: 1px solid #1f2a44;
  font-weight: bold;
  letter-spacing: 0.3px;
}

.shaderlab-code {
  flex: 1;
  background: #0f1527;
  color: #d6e5ff;
  border: none;
  padding: 10px;
  font-family: "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  outline: none;
  min-height: 220px;
}

.shaderlab-hint {
  padding: 6px 10px;
  background: #0c1324;
  border-top: 1px solid #1f2a44;
  color: #8fa3cc;
  font-size: 12px;
}

.shaderlab-errors {
  min-height: 34px;
  padding: 6px 10px;
  border-top: 1px solid #1f2a44;
  color: #ffb3b3;
  font-size: 12px;
}

.shaderlab-errors.has-errors {
  background: #2a0f15;
}

.shaderlab-preview {
  position: relative;
  background: #05070f;
  border: 1px solid #1f2a44;
  border-radius: 6px;
  overflow: hidden;
  min-height: 280px;
}

.shaderlab-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  background: #05070f;
}

.shaderlab-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  font-size: 12px;
  color: #b9c7e6;
}

.shaderlab-overlay-text,
.shaderlab-metrics {
  background: rgba(12, 18, 34, 0.72);
  border: 1px solid #23345b;
  padding: 4px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.shaderlab-metrics {
  align-self: flex-end;
  font-family: monospace;
}

@media (max-width: 920px) {
  .shaderlab-body {
    grid-template-columns: 1fr;
  }
}

.pixel-studio {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 8px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #fafafa 0%, #f1f1f1 100%);
}

.pixel-studio__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #c0c0c0;
  padding: 6px 8px;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 #fff;
}

.pixel-toolbar-left,
.pixel-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pixel-btn {
  background: linear-gradient(180deg, #fdfdfd 0%, #e7e7e7 100%);
  border: 1px solid #9a9a9a;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 1px 0 #fff, inset 0 1px 0 #f9f9f9;
}

.pixel-btn:active,
.pixel-btn.active {
  background: linear-gradient(180deg, #dcdcdc 0%, #c8c8c8 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.pixel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #333;
}

.pixel-subtitle {
  font-size: 12px;
  color: #5a5a5a;
}

.pixel-studio__body {
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.pixel-panel {
  background: #ffffff;
  border: 1px solid #c0c0c0;
  border-radius: 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-header {
  font-weight: bold;
  font-size: 13px;
  color: #1c1c1c;
  border-bottom: 1px solid #d8d8d8;
  padding-bottom: 4px;
}

.palette-editor {
  display: flex;
  gap: 6px;
}

.palette-editor input[type="text"] {
  flex: 1;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid #b0b0b0;
  border-radius: 3px;
}

.palette-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  gap: 6px;
}

.swatch {
  display: block;
  width: 100%;
  padding-top: 100%;
  position: relative;
  border: 1px solid #b0b0b0;
  border-radius: 3px;
  cursor: pointer;
}

.swatch.active {
  outline: 2px solid #0d6efd;
  outline-offset: 1px;
}

.swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2px;
}

.palette-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pixel-canvas-wrap {
  background: #ffffff;
  border: 1px solid #c0c0c0;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pixel-canvas {
  border: 1px solid #9a9a9a;
  image-rendering: pixelated;
  background: #f8f8f8;
}

.canvas-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  font-size: 12px;
  color: #555;
}

.onion-tip {
  color: #777;
}

.frames-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.frame-thumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid #c0c0c0;
  border-radius: 4px;
  background: #fafafa;
  cursor: pointer;
}

.frame-thumb.active {
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
  background: #f0f7ff;
}

.frame-preview {
  border: 1px solid #a0a0a0;
  background: #ffffff;
  flex-shrink: 0;
}

.sheet-preview {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-meta {
  font-size: 12px;
  color: #444;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sheet-canvas {
  width: 100%;
  border: 1px solid #c0c0c0;
  background: #ffffff;
  image-rendering: pixelated;
}

.whiteboard-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 6px;
}

.whiteboard-toolbar {
  padding: 6px;
  background: linear-gradient(#f8f8f8, #e9e9e9);
  border: 1px solid var(--border-dark, #808080);
  box-shadow: inset 0 1px 0 #fff;
}

.whiteboard-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.whiteboard-label {
  font-size: 12px;
  font-weight: bold;
}

.whiteboard-name {
  width: 140px;
  padding: 4px;
}

.whiteboard-tools {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.wb-tool {
  border: 1px solid #707070;
  background: #fdfdfd;
  padding: 4px 8px;
  cursor: pointer;
}

.wb-tool.active {
  background: #dbe8ff;
  border-color: #3d73c4;
}

.whiteboard-size {
  width: 120px;
}

.whiteboard-status {
  margin-top: 6px;
  font-size: 12px;
  color: #333;
}

.whiteboard-board {
  flex: 1;
  background: #eaeaea;
  border: 1px solid var(--border-dark, #808080);
  padding: 6px;
}

.whiteboard-layers {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid #808080;
  overflow: hidden;
}

.whiteboard-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  background: #fff;
}

.whiteboard-notes,
.whiteboard-cursors {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.messenger {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.messenger-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.messenger-name {
  width: 140px;
}

.messenger-status {
  font-size: 12px;
  color: #333;
}

.messenger-log {
  flex: 1;
  border: 1px solid #000;
  background: #fff;
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.messenger-message-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  line-height: 1.4;
}

.messenger-meta {
  color: #666;
  font-size: 11px;
  min-width: 52px;
}

.messenger-sender {
  font-weight: bold;
  color: #102a63;
}

.messenger-text {
  flex: 1;
  word-break: break-word;
}

.messenger-input {
  display: flex;
  gap: 8px;
}

.messenger-input input {
  flex: 1;
}

.whiteboard-note {
  position: absolute;
  width: 200px;
  min-height: 140px;
  border: 1px solid #c0a040;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
}

.whiteboard-note-header {
  font-weight: bold;
  font-size: 12px;
  cursor: grab;
  user-select: none;
}

.whiteboard-note-body {
  flex: 1;
  width: 100%;
  border: 1px solid #b0b0b0;
  padding: 4px;
  resize: none;
  background: rgba(255, 255, 255, 0.8);
}

.whiteboard-cursor {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transform: translate(-4px, -4px);
  font-size: 11px;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 1px #fff;
}

.cursor-label {
  padding: 2px 6px;
  background: #fff;
  border: 1px solid #666;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.packetlab {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.packetlab-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.packetlab-filter {
  flex: 1;
  min-width: 160px;
  padding: 6px 8px;
  border: 1px solid #808080;
  border-radius: 2px;
}

.packetlab-status-filter {
  padding: 6px 8px;
  border: 1px solid #808080;
  background: #f8f8f8;
}

.packetlab-count {
  margin-left: auto;
  font-weight: bold;
  color: #002244;
}

.packetlab-list {
  flex: 1;
  overflow: auto;
  background: #0f1d33;
  color: #f5f5f5;
  border: 1px solid #1e2f4d;
  border-radius: 4px;
  padding: 8px;
}

.packetlab-row {
  border: 1px solid #2b3e5c;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  background: #122442;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.packetlab-row-top {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.packetlab-badge {
  background: #1f6feb;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
  font-size: 12px;
}

.packetlab-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Segoe UI", sans-serif;
}

.packetlab-status {
  font-weight: bold;
}

.packetlab-time {
  font-size: 12px;
  color: #cdd9ed;
}

.packetlab-row-meta {
  font-size: 12px;
  color: #b7c5e0;
  margin-bottom: 4px;
}

.packetlab-payload {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  border-radius: 3px;
}

.packetlab-row.status-error {
  border-color: #e5534b;
  background: #2a1210;
}

.packetlab-row.status-pending {
  border-color: #c6a700;
  background: #2d2405;
}

.packetlab-row.status-ok {
  border-color: #2e7d32;
  background: #0f2414;
}

.packetlab-empty {
  text-align: center;
  padding: 16px;
  color: #cdd9ed;
}

.retroai-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.retroai-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.retroai-label {
  font-weight: bold;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.retroai-persona,
.retroai-prompt {
  width: 100%;
  box-sizing: border-box;
}

.retroai-description {
  font-size: 12px;
  padding: 6px 8px;
  background: #f2f2f2;
  border: 1px solid #c0c0c0;
}

.retroai-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.retroai-prompt {
  min-height: 60px;
  padding: 6px;
}

.retroai-output {
  flex: 1;
  border: 1px solid #c0c0c0;
  background: #fff;
  padding: 8px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-y: auto;
}

/* API Client */
.httpclient {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.httpclient-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f5f8ff;
  padding: 8px;
  border: 1px solid #c0c0c0;
  border-radius: 4px;
}

.httpclient-row {
  display: flex;
  gap: 8px;
}

.httpclient-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.httpclient-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.httpclient-field textarea {
  min-height: 120px;
  resize: vertical;
}

.httpclient-method {
  width: 100px;
}

.httpclient-url {
  flex: 1;
  padding: 6px;
}

.httpclient-preview {
  min-height: 18px;
  color: #1f2937;
  font-size: 12px;
  border-top: 1px dashed #d1d5db;
  padding-top: 4px;
  word-break: break-word;
}

.httpclient-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #c0c0c0;
  background: #fff;
  border-radius: 4px;
}

.httpclient-status.error {
  color: #b91c1c;
}

.httpclient-response {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.httpclient-response-headers {
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 8px;
  overflow: auto;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.httpclient-header-line + .httpclient-header-line {
  border-top: 1px dashed #e5e7eb;
}

.httpclient-response-body {
  border: 1px solid #d1d5db;
  background: #0b1021;
  color: #dbeafe;
  padding: 8px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  border-radius: 4px;
}

.httpclient-response-body[data-format="json"] {
  color: #b7f0ff;
}

.httpclient-hint {
  color: #6b7280;
  font-size: 12px;
}

.httpclient-loading {
  opacity: 0.85;
}

@media (max-width: 900px) {
  .httpclient-response {
    grid-template-columns: 1fr;
  }
  .httpclient-row-split {
    grid-template-columns: 1fr;
  }
}

.codepen-runner,
.codepen-viewer,
.codepen-installed-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #1f2937;
  color: #f9fafb;
}

.codepen-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px);
  gap: 8px;
  padding: 8px;
  background: #c0c0c0;
  color: #000;
  border-bottom: 2px solid #808080;
}

.codepen-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  font-weight: bold;
}

.codepen-field input {
  min-width: 0;
  padding: 4px 6px;
  border: 2px inset #fff;
  font: inherit;
}

.codepen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 1 / -1;
}

.codepen-actions button {
  padding: 4px 8px;
}

.codepen-status {
  grid-column: 1 / -1;
  min-height: 18px;
  font-size: 12px;
}

.codepen-status.error,
.codepen-message.error {
  color: #b91c1c;
}

.codepen-preview-shell {
  flex: 1;
  min-height: 0;
  padding: 8px;
  background: #111827;
}

.codepen-preview,
.codepen-viewer iframe,
.codepen-installed-app iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.codepen-installed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: #111827;
  border-bottom: 1px solid #374151;
  color: #f9fafb;
  font-size: 12px;
}

.codepen-installed-toolbar a {
  color: #93c5fd;
}

.codepen-message {
  padding: 12px;
  background: #c0c0c0;
}

@media (max-width: 720px) {
  .codepen-form {
    grid-template-columns: 1fr;
  }
}
