:root {
  --border: #111;
  --text: #050505;
  --muted: #666;
  --background: #fff;
  --panel: #fff;
  --soft: #f6f6f6;
  --danger: #8a0000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--background);
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 0 22px;
}

.top-bar {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  align-items: start;
  gap: 10px;
}

h1 {
  margin: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-button {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.gear {
  font-size: 34px;
  line-height: 34px;
}

.prompt-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-section label {
  margin-left: 18px;
  font-size: 14px;
  font-weight: 800;
}

#promptInput {
  width: 100%;
  height: 115px;
  padding: 16px;
  border: 4px solid var(--border);
  border-radius: 18px;
  resize: vertical;
  font-size: 16px;
  outline: none;
}

#promptInput:focus,
input:focus,
button:focus-visible {
  outline: 3px solid #777;
  outline-offset: 2px;
}

.prompt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  border: 3px solid var(--border);
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--text);
  color: white;
}

.secondary-button {
  background: white;
  color: var(--text);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.responses-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 84px;
  align-items: stretch;
}

.response-card {
  min-height: 505px;
  border: 4px solid var(--border);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.card-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.model-badge {
  color: var(--muted);
  background: var(--soft);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.response-output {
  flex: 1;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow: auto;
}

.response-output.error {
  color: var(--danger);
}

footer {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  margin-top: auto;
}

.settings-dialog {
  width: min(520px, calc(100vw - 28px));
  border: 4px solid var(--border);
  border-radius: 18px;
  padding: 0;
}

.settings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.25);
}

#settingsForm {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-header h3 {
  margin: 0;
  font-size: 20px;
}

.icon-button {
  border: 0;
  background: transparent;
  font-size: 30px;
  line-height: 30px;
  cursor: pointer;
}

.settings-note {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

#settingsForm label {
  font-weight: 800;
  font-size: 13px;
}

#settingsForm input {
  width: 100%;
  padding: 10px 12px;
  border: 3px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}

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

@media (max-width: 820px) {
  .top-bar {
    grid-template-columns: 1fr auto;
  }

  .top-bar > div {
    display: none;
  }

  h1 {
    text-align: left;
  }

  .responses-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .response-card {
    min-height: 360px;
  }
}

/* Three-provider layout: GPT | GROK | CLAUDE */
.responses-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 32px;
  align-items: stretch;
  width: 100%;
}

.response-card {
  min-width: 0;
}

@media (max-width: 1200px) {
  .responses-grid {
    grid-template-columns: 1fr;
  }
}

.copy-button {
  margin-top: 12px;
  align-self: flex-start;
  border: 3px solid #111;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font-weight: 800;
  padding: 8px 14px;
  cursor: pointer;
}

.copy-button:hover {
  background: #f2f2f2;
}

.copy-button:active {
  transform: translateY(1px);
}
