:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f7;
  color: #17212b;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

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

button { cursor: pointer; }

.app-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 30px 0 48px; }

.topbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; border-bottom: 1px solid #ced7dc; padding-bottom: 20px; }
.eyebrow { margin: 0 0 6px; color: #46706e; font-size: 12px; font-weight: 700; letter-spacing: 0; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; line-height: 1.15; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 16px; line-height: 1.2; letter-spacing: 0; }

.connection-state { border: 1px solid #d7aa52; background: #fff7df; color: #765116; padding: 7px 10px; border-radius: 6px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.connection-state.ok { border-color: #71a792; background: #e8f5ee; color: #205943; }
.connection-state.error { border-color: #cf7b77; background: #ffefee; color: #87322e; }

.connection-panel { display: grid; grid-template-columns: 1.2fr 1.8fr auto; gap: 12px; align-items: end; padding: 20px 0; }
label { display: grid; gap: 6px; color: #425261; font-size: 13px; font-weight: 650; }
input, textarea, select { width: 100%; border: 1px solid #bdc9cf; border-radius: 5px; background: #fff; color: #17212b; padding: 9px 10px; outline: none; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: #24767a; box-shadow: 0 0 0 3px #d5eeee; }

.tabs { display: flex; border-bottom: 1px solid #bdc9cf; gap: 4px; }
.tab { border: 0; background: transparent; color: #526271; padding: 11px 14px; font-weight: 700; }
.tab.active { color: #126269; border-bottom: 3px solid #126269; }

.workspace { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 18px; padding: 20px 0; }
.tool-panel, .response-panel { border: 1px solid #ced7dc; border-radius: 6px; background: #fff; padding: 18px; }
.panel-heading, .response-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-heading span, .response-heading span { color: #71808d; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.form-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.inline-controls, .button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.checkbox { display: flex; align-items: center; gap: 7px; font-weight: 550; }
.checkbox input { width: auto; }

.primary-button, .secondary-button, .danger-button, .quick-reference button { border-radius: 5px; padding: 9px 12px; font-size: 13px; font-weight: 700; }
.primary-button { border: 1px solid #126269; background: #126269; color: #fff; }
.secondary-button { border: 1px solid #aebdc5; background: #fff; color: #344652; }
.danger-button { border: 1px solid #b75d58; background: #fff; color: #9c3731; }
.primary-button:hover { background: #0c5258; }
.secondary-button:hover, .quick-reference button:hover { background: #eef4f5; }
.danger-button:hover { background: #fff1ef; }

.video-preview { margin-top: 18px; display: grid; gap: 8px; }
.video-preview video { width: 100%; max-height: 310px; background: #17212b; border-radius: 4px; }
.video-preview a { color: #126269; font-size: 13px; font-weight: 700; }
.resource-main { min-width: 0; }
.quick-reference { display: flex; flex-direction: column; gap: 8px; align-self: start; }
.quick-reference button { width: 100%; border: 1px solid #cbd6da; background: #f8fafb; color: #364a56; text-align: left; }
.code-input, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; }

.response-panel { margin-top: 2px; }
.response-heading { align-items: center; margin-bottom: 10px; }
.response-heading h2 { margin-bottom: 4px; }
pre { min-height: 180px; max-height: 480px; overflow: auto; margin: 0; padding: 14px; border: 1px solid #d7e0e3; border-radius: 4px; background: #17212b; color: #d9f0e6; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.hidden { display: none; }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 22px, 1180px); padding-top: 18px; }
  .topbar, .connection-panel, .workspace { grid-template-columns: 1fr; display: grid; }
  .topbar { align-items: start; }
  .connection-state { justify-self: start; }
  .form-grid { grid-template-columns: 1fr; }
  .panel-heading { display: grid; }
  .panel-heading span { text-align: left; }
}
