* { box-sizing: border-box; }
:root {
  --red: #b31217;
  --red-dark: #6d0b10;
  --gold: #f3c04a;
  --panel: #151821;
  --panel-2: #0f1219;
  --text: #f2f2f4;
  --muted: #c1c6d3;
  --border: #2a2f3b;
}
body {
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  margin: 0;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(179, 18, 23, 0.25), transparent 60%),
    radial-gradient(800px 500px at 90% 10%, rgba(243, 192, 74, 0.18), transparent 60%),
    #0b0d12;
  color: var(--text);
  min-height: 100vh;
}
.shell { max-width: 1340px; margin: 0 auto; padding: 14px; }
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #3a1b1b;
  border-left: 4px solid var(--red);
  background: linear-gradient(90deg, rgba(179, 18, 23, 0.18), transparent);
}
.title-block { display: flex; flex-direction: column; gap: 4px; }
h1 {
  font-size: 18px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
  word-break: break-word;
}
.subtitle { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.header-actions { position: relative; }
.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #2a2f3b;
  background: #2a2f3b;
  color: var(--gold);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-button:hover { background: #353b4a; }
.panel {
  position: absolute;
  right: 0;
  top: 42px;
  min-width: 200px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #2a2f3b;
  background: #11141c;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 20;
}
.panel.is-hidden { display: none; }
.panel-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold);
  margin-bottom: 8px;
}
.panel-list { display: grid; gap: 6px; }
.panel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.panel-item button {
  width: auto;
  padding: 4px 8px;
  font-size: 11px;
  text-transform: none;
  margin: 0;
}
.panel-empty { font-size: 12px; color: var(--muted); }
.grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: 12px;
  grid-auto-flow: dense;
}
.card {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #2c313d;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 280px;
  min-height: fit-content;
}
.card--wide { grid-column: 1 / -1; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  user-select: none;
  cursor: grab;
}
.card-head:active { cursor: grabbing; }
.card-head h3 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold);
}
.card-actions { display: flex; gap: 6px; }
.card-action {
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  border: 1px solid #2a2f3b;
  background: #2a2f3b;
  color: var(--text);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: none;
}
.card-action:hover { background: #3a3f4c; }
.card-body { display: grid; gap: 6px; }
.card-body.fill {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-body.fill pre {
  flex: 1;
  height: 100%;
  min-height: 0;
}
.card-body.fill .viewer-wrap {
  flex: 1;
  min-height: 0;
}
.card-body.fill iframe {
  height: 100%;
}
.card.is-minimized .card-body { display: none; }
.card.is-hidden { display: none; }
.card.is-dragging { opacity: 0.6; border-style: dashed; }
.resize-handle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 14px;
  height: 14px;
  cursor: se-resize;
  border-right: 2px solid rgba(243, 192, 74, 0.6);
  border-bottom: 2px solid rgba(243, 192, 74, 0.6);
  opacity: 0.7;
}
.resize-handle::after {
  content: '';
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(243, 192, 74, 0.4);
  border-bottom: 2px solid rgba(243, 192, 74, 0.4);
}
label { display: block; font-size: 11px; margin-bottom: 4px; color: var(--muted); }
input, button, select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0d1016;
  color: var(--text);
}
button {
  cursor: pointer;
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  border-color: #7b0b12;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0.3rem 0;
}
button.secondary {
  background: #2a2f3b;
  border-color: #2a2f3b;
  text-transform: none;
  font-weight: 500;
}
.row { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
details { margin-top: 8px; border: 1px solid #2a2f3b; border-radius: 8px; background: rgba(8, 10, 14, 0.6); }
summary { list-style: none; cursor: pointer; padding: 8px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--gold); }
summary::-webkit-details-marker { display: none; }
.accordion-body { padding: 0 10px 10px 10px; display: grid; gap: 8px; }
pre { background: #0a0c10; padding: 8px; border-radius: 6px; min-height: 120px; overflow: auto; font-size: 12px; }
iframe { width: 100%; height: 320px; border: 0; border-radius: 10px; background: #0b0d11; }
.viewer-wrap { position: relative; }
.viewer-overlay { position: absolute; inset: 0; border-radius: 10px; pointer-events: none; }
.viewer-overlay.active { pointer-events: auto; cursor: grab; outline: 2px solid rgba(243, 192, 74, 0.6); }
.viewer-overlay.active.is-looking { cursor: grabbing; }
.viewer-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(15, 17, 21, 0.85);
  border: 1px solid #2a2f3b;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  color: #cbd2e0;
  max-width: 320px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.viewer-overlay.active .viewer-hint { opacity: 1; }
