:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171717;
  background: #000000;
  --bg: #000000;
  --panel: #ffffff;
  --panel-muted: #f6f6f6;
  --ink: #171717;
  --muted: #626262;
  --line: #d7d7d7;
  --strong-line: #111111;
  --accent: #ff9900;
  --accent-strong: #f08f00;
  --accent-soft: #fff1d8;
  --danger-bg: #fff0ee;
  --danger: #9d2319;
  --warn-bg: #fff5df;
  --warn: #664300;
  --ok-bg: #eef8f0;
  --ok: #1e6c37;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(#050505 0 188px, var(--bg) 188px 100%);
}

.workspace {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
legend,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: #ffffff;
  font-size: 32px;
  line-height: 1.15;
}

h2,
legend {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.header-tools {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.language-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #4b4b4b;
  border-radius: 8px;
  background: #1c1c1c;
}

.language-switcher button {
  border: 0;
  border-radius: 0;
  padding: 8px 12px;
  color: #dddddd;
  background: transparent;
}

.language-switcher button.active {
  color: #111111;
  background: var(--accent);
  font-weight: 800;
}

.revision {
  color: #c7c7c7;
  font-size: 13px;
  text-align: right;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid #232323;
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 18px 36px rgb(0 0 0 / 0.28);
}

.form-panel,
.output-panel {
  padding: 18px;
}

.output-panel {
  position: sticky;
  top: 16px;
}

.output-panel section + section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

fieldset {
  min-width: 0;
  border: 0;
  padding: 0 0 22px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

fieldset:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

label {
  display: block;
  margin-top: 12px;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid #b9b9b9;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #ffffff;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgb(255 153 0 / 0.35);
  outline-offset: 2px;
  border-color: var(--accent-strong);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fffafa;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

button {
  border: 1px solid var(--strong-line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
}

button.active,
button:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #111111;
}

button:disabled {
  color: #777777;
  cursor: not-allowed;
  background: #eeeeee;
}

.thaw-button.thaw-button--primary {
  border-color: var(--accent-strong) !important;
  color: #111111 !important;
  background: var(--accent) !important;
  font-weight: 800;
}

.thaw-button.thaw-button--primary:hover:not(:disabled) {
  background: #ffad21 !important;
}

.thaw-button.thaw-button--secondary {
  border-color: var(--strong-line) !important;
  color: var(--ink) !important;
  background: #ffffff !important;
}

.thaw-button.thaw-button--secondary:hover:not(:disabled) {
  border-color: var(--accent-strong) !important;
  background: var(--accent-soft) !important;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row-compact {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

.check-row input {
  width: auto;
}

.check-row span {
  min-width: 0;
}

.confirm-with-help {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 14px;
}

.tooltip-trigger {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: help;
}

.tooltip-trigger:focus-visible {
  border-radius: 3px;
  outline: 3px solid rgb(255 153 0 / 0.35);
  outline-offset: 2px;
}

.tooltip-card {
  display: none;
  position: absolute;
  left: 28px;
  bottom: 100%;
  z-index: 3;
  width: min(540px, calc(100vw - 48px));
  min-width: 0;
  border: 1px solid #222222;
  border-top: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 16px 32px rgb(0 0 0 / 0.24);
}

.confirm-with-help:hover .tooltip-card,
.confirm-with-help:focus-within .tooltip-card {
  display: block;
}

.tooltip-card p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.copy-code {
  position: relative;
  min-width: 0;
}

.copy-code pre {
  overflow: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  border-radius: 5px;
  padding: 10px 48px 10px 10px;
  border: 1px solid #2a2a2a;
  border-top: 3px solid var(--accent);
  background: #050505;
  color: #f2f2f2;
  font-size: 12px;
  line-height: 1.45;
}

.code-copy-group {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-copy {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-color: var(--accent-strong);
  border-radius: 6px;
  padding: 0;
  color: #111111;
  background: var(--accent);
}

.icon-copy:hover:not(:disabled) {
  background: #ffad21;
}

.copy-icon {
  position: relative;
  width: 14px;
  height: 14px;
}

.copy-icon::before,
.copy-icon::after {
  position: absolute;
  content: "";
  border: 2px solid currentColor;
  border-radius: 2px;
  background: transparent;
}

.copy-icon::before {
  right: 0;
  bottom: 0;
  width: 8px;
  height: 8px;
}

.copy-icon::after {
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
}

.icon-copy:hover:not(:disabled) .copy-icon::after {
  background: #ffad21;
}

.copy-feedback {
  padding: 4px 7px;
  border: 1px solid #2f2f2f;
  border-radius: 6px;
  color: #ffffff;
  background: #111111;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  animation: copy-feedback-fade 2.1s ease-out forwards;
}

.copy-feedback-failed {
  border-color: var(--danger);
  background: var(--danger);
}

@keyframes copy-feedback-fade {
  0%,
  65% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-3px);
  }
}

.tooltip-card .copy-code pre {
  padding: 10px;
  padding-right: 48px;
}

.field-help,
.field-error,
.field-warning,
.field-notice,
.danger-callout,
.message,
.flash,
.action-note,
.empty-output {
  font-size: 14px;
  line-height: 1.45;
}

.field-help {
  margin: 7px 0 0;
  color: var(--muted);
}

.field-help code {
  padding: 1px 5px;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  color: var(--ink);
  background: #f3f3f3;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.field-error {
  margin: 7px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.field-warning,
.field-notice,
.danger-callout {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
}

.field-warning {
  background: var(--warn-bg);
  color: var(--warn);
}

.field-notice {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  color: #4a3100;
}

.danger-callout {
  border: 2px solid var(--danger);
  background: #2a0704;
  color: #ffffff;
  font-weight: 800;
}

.message {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 6px;
}

.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.command,
.preview {
  overflow: auto;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
  border-top: 3px solid var(--accent);
  padding: 12px;
  background: #050505;
  color: #f2f2f2;
  font-size: 13px;
  line-height: 1.5;
}

.preview {
  max-height: 260px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.action-note,
.empty-output,
.flash {
  margin: 10px 0 0;
  color: var(--muted);
}

.flash {
  color: #533500;
  font-weight: 700;
}

@media (max-width: 860px) {
  .app-shell {
    background: linear-gradient(#111111 0 220px, var(--bg) 220px 100%);
  }

  .workspace {
    width: min(100vw - 20px, 680px);
    padding: 18px 0;
  }

  .page-header,
  .layout {
    display: block;
  }

  .header-tools {
    justify-items: start;
    margin-top: 14px;
  }

  .revision {
    text-align: left;
  }

  .output-panel {
    position: static;
    margin-top: 16px;
  }

  .confirm-with-help {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .tooltip-card {
    position: static;
    flex-basis: 100%;
    width: 100%;
  }
}
