/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Page ── */
body {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  background: #f0f0f0;
  color: #111;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ── Top bar ── */
#toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 44px;
  flex-shrink: 0;
}

#toolbar label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #888;
}

#toolbar select {
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
}

#toolbar select:focus { outline: 2px solid #555; }

#toolbar input[type="range"] {
  width: 160px;
  accent-color: #888;
  cursor: ew-resize;
}

#width-label {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #aaa;
  min-width: 40px;
  text-align: right;
}

/* ── Info panel ── */
#info {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.text{
  padding: 12px 16px;
}

#name {
  font-size: 15px;
  font-weight: 700;
}

#expects {
  font-size: 12px;
  color: #666;
  &:before{
    content: 'Expects: ';
    font-weight: bold;
  }
}

/* ── Canvas ── */
#canvas {
  flex: 1;
  padding: 24px 0;
  overflow: hidden;
  border-inline: 2px solid;
  margin-inline: auto;
  width: 100%;
}

/* ── CSS readout ── */
#css-panel {
  background: #1e1e2e;
  border-top: 1px solid #333;
  flex-shrink: 0;
}

#css-panel summary {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #888;
  cursor: pointer;
  user-select: none;
}

#css-panel summary:hover { color: #aaa; }

#css, #classname {
  display: block;
  padding: 12px 16px 16px;
  font-family: "Fira Code", "Cascadia Code", monospace;
  font-size: 12px;
  line-height: 1.7;
  color: #cdd6f4;
  white-space: pre;
  overflow-x: auto;
}

#classname{
  font-style: italic;
  color: #a2d018;
}

/* ── Canvas (resizable viewport simulation) ── */
#canvas {
  resize: horizontal;
  overflow: auto;
  container-type: inline-size;
  container-name: canvas;
}

/* ── Grid container ── */
#container {
  padding-top: 40px;
  width: 100%;
  min-height: 200px;
}

/* ── Col blocks ── */
.col, .area {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 2px;
  overflow: hidden;
  white-space: nowrap;
  writing-mode:sideways-lr;
  text-orientation: mixed;
}

/* Column */
.col:not(.col--margin):not(.col--off):not(.col--gutter) {
  background: #d4e4ff;
  border: 1px solid #a8c8ff;
  color: #2255aa;
}

/* Gutter */
.col--gutter {
  background: #f5f0ff;
  border: 1px dashed #c8aaff;
  color: #7744bb;
  font-size: 9px;
}

/* Off */
.col--off {
  background: #fff8e0;
  border: 1px dashed #ffd966;
  color: #996600;
}

/* Margin */
.col--margin {
  background: #ffe0e0;
  border: 1px dashed #ffaaaa;
  color: #aa2222;
}

.area{
  min-height: 28px;
  writing-mode:unset;
  text-orientation: mixed;
  background-color: transparent;
  border: #f8ce73 2px dashed;
  border-top-width: 0;
}

&:has(*){
  justify-content: unset;
}

.area--still {
  grid-column: var(--grrr-use-still-area);
}

.calc-box {
  height: 40px;
  background: #ffa94d33;
  border: 2px solid #ffa94d;
  border-radius: 2px;
  display: flex;
  align-items: center;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #b35c00;
  white-space: nowrap;
  overflow: hidden;
}