.auth-page,
.tool-page { background: var(--canvas); }

.auth-shell {
  width: min(28rem, calc(100% - 2rem));
  min-height: calc(100vh - 4rem);
  margin-inline: auto;
  display: grid;
  place-items: center;
  padding-block: 2rem;
}

.auth-card { width: 100%; }
.auth-card-heading { min-height: 4rem; }
.auth-card-heading h1 { margin: 0; font-size: 1.25rem; line-height: 1.15; }
.auth-form { padding: 1.5rem; }

.form-field { display: block; }
.form-field + .form-field { margin-top: 1.5rem; }
.form-field > span {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}
.form-field input {
  width: 100%;
  min-height: var(--control-height);
  padding-inline: 0.75rem;
  background: var(--panel-strong);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  font-size: 1rem;
}
.form-field input:hover { border-color: var(--accent-strong); }

.form-alert {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  background: var(--alarm-soft);
  color: var(--alarm-strong);
  border: 1px solid var(--alarm);
  font-weight: 700;
}
.alert-symbol {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--alarm);
  color: #ffffff;
  font-weight: 900;
}

.auth-submit { width: 100%; margin-top: 2rem; }

.tool-shell {
  width: min(78rem, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: 1rem 3rem;
}
.tool-intro {
  min-height: 5rem;
  display: flex;
  align-items: center;
  padding: 1.5rem;
  background: #e3e6e6;
  border: 1px solid var(--line-strong);
}
.tool-intro h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1;
  text-wrap: balance;
}

.console-panel,
.result-panel { margin-top: 1rem; }
.command-form { padding: 1rem; }
.command-input {
  display: block;
  width: 100%;
  min-height: 12rem;
  resize: vertical;
  padding: 1rem;
  background: #10191e;
  color: #e4ecef;
  border: 1px solid #718087;
  caret-color: #ffffff;
  font: 1rem/1.5 var(--font-data);
  tab-size: 2;
}
.command-input::placeholder { color: #aebbc0; opacity: 1; }
.command-input:hover { border-color: #9aabb2; }

.command-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.result-state {
  display: inline-flex;
  width: max-content;
  padding: 0.35rem 0.6rem;
  background: var(--normal-soft);
  color: #24483d;
  border: 1px solid #66887d;
  font: 0.75rem/1 var(--font-data);
  font-weight: 700;
  text-transform: uppercase;
}
.result-state.error { background: var(--alarm-soft); color: var(--alarm-strong); border-color: var(--alarm); }
.result-state.waiting { background: #d4d9da; color: var(--muted); border-color: var(--line); }

.result-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.result-meta div { padding: 0.75rem 1rem; border-inline-end: 1px solid var(--line); }
.result-meta div:last-child { border-inline-end: 0; }
.result-meta dt { color: var(--muted); font-size: 0.75rem; }
.result-meta dd { margin: 0.3rem 0 0; font: 0.875rem/1.2 var(--font-data); font-weight: 700; }

.command-output {
  min-height: 8rem;
  max-height: 34rem;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #10191e;
  color: #e4ecef;
  font: 0.875rem/1.5 var(--font-data);
  tab-size: 2;
}

@media (max-width: 52rem) {
  .result-meta { grid-template-columns: 1fr 1fr; }
  .result-meta div:nth-child(2) { border-inline-end: 0; }
  .result-meta div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 34rem) {
  .auth-shell,
  .tool-shell { width: min(100% - 1rem, 78rem); }
  .tool-intro { padding: 1rem; }
  .command-actions .primary-button { width: 100%; }
  .result-meta { grid-template-columns: 1fr; }
  .result-meta div { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .result-meta div:last-child { border-bottom: 0; }
}

@media (pointer: coarse) {
  .workspace-nav a { min-height: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
