:root {
  color-scheme: dark;
  --bg: #101010;
  --surface: #171717;
  --surface-2: #1f1f1f;
  --field: #0f0f0f;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #707079;
  --border: #303033;
  --border-strong: #49494d;
  --primary: #f4f4f5;
  --primary-text: #111111;
  --accent: #7dd3fc;
  --danger: #fb7185;
  --success: #86efac;
  --focus: rgba(125, 211, 252, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-text);
  cursor: pointer;
  padding: 0 18px;
  font-weight: 650;
}

button:hover {
  background: #ffffff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

button.ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

select {
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 118px;
  padding: 12px;
  line-height: 1.55;
}

textarea.large {
  min-height: 210px;
}

textarea.output {
  min-height: 520px;
  white-space: pre-wrap;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 13px;
}

.site-shell {
  min-height: 100vh;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-inner {
  width: min(100%, 460px);
  text-align: center;
}

.auth-inner h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.02;
}

.auth-inner p {
  min-height: 20px;
  margin: 18px 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
}

.auth-form input,
.auth-form button {
  height: 46px;
}

.app-screen {
  width: min(1540px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

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

.topbar p,
.feedback-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow,
.section-kicker {
  display: block;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(170px, 240px) 104px;
  gap: 10px;
  align-items: center;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pane {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pane-header h2,
.feedback-block h2 {
  margin: 2px 0 0;
  font-size: 16px;
  line-height: 1.25;
}

.feedback-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.feedback-header {
  align-items: start;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.error {
  color: var(--danger) !important;
}

.success {
  color: var(--success) !important;
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  textarea.output {
    min-height: 360px;
  }
}

@media (max-width: 520px) {
  .auth-form {
    grid-template-columns: 1fr;
  }

  .app-screen {
    width: min(100% - 20px, 1540px);
    padding-top: 14px;
  }

  .pane {
    padding: 14px;
  }
}
