.pentagon-graph-app {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(300px, 1fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  color: #ffffe0;
  font-family: Joan, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: auto;
}

.content:has(.pentagon-graph-app) {
  overflow: hidden;
}

.pentagon-panel {
  border: 2px solid black;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.88);
  box-sizing: border-box;
  padding: 16px;
  min-height: 0;
}

.pentagon-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}

.pentagon-dashboard {
  display: grid;
  grid-template-rows: minmax(0, calc(58% - 8px)) minmax(0, calc(42% - 8px));
  align-items: stretch;
  gap: 16px;
  height: 100%;
  overflow: hidden;
}

.pentagon-panel-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.pentagon-inputs,
.pentagon-stats {
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pentagon-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pentagon-input-label {
  font-size: 0.8rem;
  line-height: 1.2;
  font-weight: 700;
}

.pentagon-tag-input {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  border: 1px solid #5a4b6d;
  border-radius: 6px;
  background: #080808;
  color: #ffffe0;
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 10px;
  outline: none;
}

.pentagon-tag-input:focus {
  border-color: #00ff00;
  box-shadow: 0 0 0 2px rgba(0, 255, 0, 0.18);
}

.pentagon-canvas-wrap {
  width: 100%;
  max-width: 280px;
  height: 100%;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
  justify-self: center;
  overflow: hidden;
}

#pentagonRadarCanvas {
  display: block;
  width: auto;
  height: 100%;
  max-width: min(100%, 280px);
  max-height: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #eeeee0;
  touch-action: none;
}

@supports (width: 100cqw) {
  #pentagonRadarCanvas {
    width: min(100cqw, 100cqh, 280px);
    height: min(100cqw, 100cqh, 280px);
  }
}

.pentagon-stats {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(5, minmax(0, calc((100% - 32px) / 5)));
  gap: 8px;
  justify-self: center;
  overflow: hidden;
}

.pentagon-stat-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 0;
  height: 100%;
  border-left: 5px solid currentColor;
  border-radius: 6px;
  background: rgba(255, 255, 224, 0.08);
  padding: 6px 12px;
  box-sizing: border-box;
}

.pentagon-stat-label {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #ffffe0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.pentagon-stat-value {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 980px) {
  .pentagon-graph-app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100%;
    overflow: visible;
  }

  .content:has(.pentagon-graph-app) {
    overflow: auto;
  }

  .pentagon-dashboard {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .pentagon-canvas-wrap {
    height: auto;
    aspect-ratio: 1;
  }

  #pentagonRadarCanvas {
    width: 100%;
    height: auto;
    max-height: 340px;
  }

  .pentagon-stats {
    height: auto;
    display: flex;
    gap: 10px;
    overflow: visible;
  }

  .pentagon-stat-block {
    min-height: 42px;
  }
}

@media (max-width: 620px) {
  .left,
  .right {
    width: 100%;
    float: none;
  }

  .navbar {
    float: none;
    width: auto;
    height: auto;
    margin: 0 10px 12px;
  }

  .title,
  .content {
    width: auto;
    margin-left: 10px;
    margin-right: 10px;
  }

  .title p {
    font-size: 11vw;
    line-height: 1.1;
  }
}
