/* web/src/styles.css */
:root {
  color: #172018;
  background: #f4f5f1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button, input, textarea {
  font: inherit;
}

.app {
  min-height: 100vh;
}

.topbar {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #d9ded4;
  justify-content: space-between;
  align-items:  end;
  gap: 24px;
  padding: 28px 32px 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.topbar p {
  color: #5c6659;
  margin: 8px 0 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding: 24px 32px 36px;
}

.panel {
  background: #fff;
  border: 1px solid #d9ded4;
  border-radius: 8px;
  min-width: 0;
  padding: 18px;
}

.panelHeader {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 16px;
  margin-bottom: 14px;
}

.panelHeader h2 {
  margin: 0;
  font-size: 18px;
}

.panelHeader span, .segmentedWrap > span, .scale span {
  color: #667061;
  font-size: 13px;
}

.dropzone {
  display: grid;
  cursor: pointer;
  background: #f8faf5;
  border: 1px dashed #9ca893;
  border-radius: 8px;
  place-items:  center;
  min-height: 140px;
}

.dropzone input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.dropzone span, .actions button {
  color: #fff;
  background: #2f6b42;
  border: 1px solid #2d5a3a;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 650;
}

textarea {
  resize: vertical;
  color: #172018;
  background: #fbfcfa;
  border: 1px solid #c8d0c2;
  border-radius: 8px;
  width: 100%;
  min-height: 150px;
  padding: 12px;
  line-height: 1.45;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 170px 96px;
  gap: 12px;
  margin-top: 14px;
}

.segmentedWrap, .scale {
  display: grid;
  gap: 7px;
}

.segmented {
  display: flex;
  overflow: hidden;
  border: 1px solid #c8d0c2;
  border-radius: 8px;
  min-height: 38px;
}

.segmented button {
  color: #2b3428;
  cursor: pointer;
  background: #f6f7f4;
  border: 0;
  flex: 1;
  padding: 8px 10px;
}

.segmented button + button {
  border-left: 1px solid #c8d0c2;
}

.segmented button.active {
  color: #16351f;
  background: #dce8d8;
  font-weight: 700;
}

.scale input {
  border: 1px solid #c8d0c2;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.actions button {
  cursor: pointer;
}

.actions button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.summary {
  display: grid;
  border-top: 1px solid #e1e5dd;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
}

.summary h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.summary div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items:  start;
  gap: 12px;
}

.summary span {
  color: #667061;
}

.summary strong {
  overflow-wrap: anywhere;
  min-width: 0;
}

.json {
  overflow: auto;
  color: #dfe9d9;
  background: #111710;
  border-radius: 8px;
  max-height: 360px;
  margin: 16px 0 0;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.generated {
  display: flex;
  background: #f8faf5;
  border: 1px solid #d9ded4;
  border-radius: 8px;
  justify-content: center;
  align-items:  center;
  min-height: 220px;
  margin-top: 16px;
}

.generated img {
  image-rendering: pixelated;
  width: min(280px, 80%);
}

.error {
  color: #7a1f1f;
  background: #fff1f1;
  border: 1px solid #b84b4b;
  border-radius: 8px;
  margin: 18px 32px 0;
  padding: 12px 14px;
}

@media (max-width: 880px) {
  .topbar, .workspace {
    padding-left: 16px;
    padding-right: 16px;
  }

  .workspace, .controls {
    grid-template-columns: 1fr;
  }
}
