.playground-page { min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--white); }
.playground-page .site-header { position: relative; }
.playground-page .brand { font-size: 18px; }
.playground-page .desktop-nav, .playground-page .header-actions { font-size: 14px; }
.playground-page .nav-active { position: relative; }
.playground-page .nav-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -26px; height: 2px; background: var(--blue); }
.playground-main { height: calc(100vh - 72px); min-height: 690px; display: flex; flex-direction: column; background: var(--paper); }
.workbench-bar { min-height: 68px; padding: 0 max(24px, calc((100vw - 1440px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ink); background: var(--white); }
.workbench-title { display: flex; align-items: center; gap: 12px; }
.live-pip { width: 8px; height: 8px; background: var(--signal); box-shadow: 0 0 0 5px rgba(101,244,207,.16); }
.workbench-title h1 { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 1; letter-spacing: -.035em; font-weight: 620; }
.workbench-title p { margin: 5px 0 0; color: #62655f; font-size: 13px; }
.workbench-meta { display: flex; align-items: center; gap: 22px; font-family: var(--font-mono); font-size: 10px; color: #62655f; letter-spacing: .035em; }
.endpoint-state { display: flex; align-items: center; gap: 7px; color: #28715f; }
.endpoint-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--signal); }
.workbench-meta button { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); font-family: inherit; font-size: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.workbench-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 312px minmax(420px, 1fr) minmax(370px, 410px); max-width: 1600px; width: 100%; margin-inline: auto; background: var(--white); border-inline: 1px solid var(--line); }
.settings-panel, .inspector-panel { min-width: 0; overflow-y: auto; scrollbar-width: thin; background: var(--paper); }
.settings-panel { border-right: 1px solid var(--ink); }
.inspector-panel { position: relative; display: flex; flex-direction: column; border-left: 1px solid var(--ink); background: var(--ink); color: var(--white); }
.panel-section { padding: 22px; border-bottom: 1px solid var(--line); }
.panel-heading { min-height: 20px; margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; color: #555852; }
.panel-heading a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.mode-switch button { min-height: 50px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border: 0; border-right: 1px solid var(--line); background: var(--white); color: #4f524d; font-size: 14px; cursor: pointer; }
.mode-switch button:last-child { border-right: 0; }
.mode-switch small { color: #747770; font-family: var(--font-mono); font-size: 10px; }
.mode-switch button.active { background: var(--ink); color: var(--white); }
.mode-switch button.active small { color: var(--signal); }
.select-wrap { position: relative; background: var(--white); }
.select-wrap select { width: 100%; height: 54px; padding: 0 40px 0 14px; appearance: none; border: 1px solid var(--line); border-radius: 0; outline: 0; background: transparent; color: var(--ink); font-family: var(--font-sans); font-size: 16px; font-weight: 620; cursor: pointer; }
.select-wrap select:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.select-wrap > span { position: absolute; right: 15px; top: 17px; pointer-events: none; font-family: var(--font-mono); font-size: 11px; }
.model-info { min-height: 42px; padding: 12px 2px 0; display: flex; justify-content: space-between; gap: 10px; color: #646761; font-family: var(--font-mono); font-size: 10px; line-height: 1.45; }
.model-info b { color: #126651; font-family: var(--font-price); font-size: 12px; font-weight: 650; letter-spacing: -.015em; text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.key-field { height: 46px; display: grid; grid-template-columns: 1fr auto auto; border: 1px solid var(--line); background: var(--white); }
.key-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.key-field input { min-width: 0; border: 0; outline: 0; padding: 0 11px; background: transparent; font-family: var(--font-mono); font-size: 12px; }
.key-field button { min-width: 52px; border: 0; border-left: 1px solid var(--line); background: transparent; color: #555852; font-family: var(--font-mono); font-size: 10px; cursor: pointer; }
.key-field button:hover { color: var(--ink); background: var(--paper); }
.api-section > p { margin: 11px 0 0; color: #686b65; font-size: 12px; line-height: 1.55; }
.advanced-toggle { width: 100%; min-height: 44px; padding: 0; display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; color: #555852; font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; cursor: pointer; }
.advanced-toggle span:last-child { color: var(--ink); }
.parameter-controls { display: grid; gap: 23px; padding-top: 15px; }
.parameter-controls > label > span { margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; color: #444742; font-size: 13px; }
.parameter-controls output { color: var(--ink); font-family: var(--font-mono); font-size: 11px; }
.parameter-controls input[type="range"] { width: 100%; height: 18px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
.parameter-controls input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--ink) var(--range-progress, 35%), #c4c3bc var(--range-progress, 35%)); }
.parameter-controls input[type="range"]::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -6px; appearance: none; border: 3px solid var(--paper); background: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.stream-control { min-height: 48px; position: relative; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.stream-control > span { margin: 0 !important; display: grid !important; justify-content: initial !important; }
.stream-control b { color: var(--ink); font-size: 13px; font-weight: 550; }
.stream-control small { margin-top: 3px; color: #696c66; font-size: 11px; }
.stream-control input { position: absolute; opacity: 0; }
.stream-control i { width: 34px; height: 18px; position: relative; border: 1px solid var(--line); background: #d9d7cf; cursor: pointer; }
.stream-control i::after { content: ""; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; background: #777a74; transition: transform .2s var(--ease); }
.stream-control input:checked + i { background: var(--ink); }
.stream-control input:checked + i::after { background: var(--signal); transform: translateX(16px); }

.conversation-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--white); }
.conversation-head { min-height: 56px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.conversation-head > div { display: flex; align-items: center; gap: 12px; }
.conversation-head span { color: #666963; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; }
.conversation-head b { padding-left: 12px; border-left: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.conversation-head button { min-height: 44px; padding: 0; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; color: #444742; font-size: 12px; cursor: pointer; }
.conversation-head button span { font-size: 15px; color: var(--ink); }
.conversation-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; }
.message-list { width: 100%; padding: 28px; display: grid; align-content: start; gap: 20px; }
.message { max-width: 760px; padding: 18px 20px; border: 1px solid var(--line); }
.message.user { margin-left: auto; background: var(--paper); }
.message.assistant { margin-right: auto; background: var(--ink); color: var(--white); border-color: var(--ink); }
.message-header { margin-bottom: 12px; display: flex; justify-content: space-between; gap: 30px; color: #666963; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; }
.message.assistant .message-header { color: #707570; }
.message p { margin: 0; font-size: 16px; line-height: 1.65; white-space: pre-wrap; }
.message.assistant p { color: #d5d7d1; }
.typing-cursor { display: inline-block; width: 6px; height: 13px; margin-left: 3px; vertical-align: -2px; background: var(--signal); animation: cursorBlink .75s steps(1) infinite; }
@keyframes cursorBlink { 50% { opacity: 0; } }
.composer-wrap { padding: 0 20px 18px; }
.system-prompt { border: 1px solid var(--line); border-bottom: 0; background: var(--paper); }
.system-prompt > button { width: 100%; min-height: 42px; padding: 0 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; border: 0; background: transparent; cursor: pointer; }
.system-prompt > button span { display: flex; align-items: center; gap: 8px; color: #3f423d; font-size: 12px; font-weight: 600; }
.system-prompt > button i { width: 5px; height: 5px; background: var(--blue); }
.system-prompt > button b { overflow: hidden; color: #72756f; font-family: var(--font-mono); font-size: 10px; font-weight: 400; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.system-prompt > button em { font-style: normal; }
.system-body { padding: 0 12px 12px; }
.system-body textarea { width: 100%; resize: vertical; padding: 10px; border: 1px solid var(--line); border-radius: 0; outline: 0; background: var(--white); font: 13px/1.6 var(--font-mono); }
.composer { border: 1px solid var(--ink); background: var(--white); box-shadow: 6px 6px 0 rgba(11,13,15,.07); }
.composer textarea { width: 100%; min-height: 80px; max-height: 190px; resize: none; padding: 15px 16px 8px; border: 0; outline: 0; background: transparent; color: var(--ink); font: 16px/1.6 var(--font-sans); }
.composer-footer { min-height: 50px; padding: 6px 7px 6px 14px; display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); color: #6c6f69; font-family: var(--font-mono); font-size: 10px; }
.composer-footer > span:nth-child(2) { margin-left: auto; }
.composer-footer kbd { padding: 2px 4px; border: 1px solid var(--line); background: var(--paper); font: inherit; }
.run-button { min-width: 148px; min-height: 42px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border: 0; background: var(--signal); color: var(--ink); font-size: 13px; font-weight: 650; cursor: pointer; }
.run-button:hover { background: var(--ink); color: var(--white); }
.run-button:disabled { background: #d4d2ca; color: #777a74; cursor: wait; }
.run-button i { font-style: normal; }
.request-error { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid #d24b3f; background: #f8e7e2; color: #743027; font-size: 12px; line-height: 1.5; }

.inspector-tabs { min-height: 56px; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line-dark); }
.inspector-tabs button { position: relative; border: 0; border-right: 1px solid var(--line-dark); background: transparent; color: #858a85; font-family: var(--font-mono); font-size: 11px; cursor: pointer; }
.inspector-tabs button:last-child { border-right: 0; }
.inspector-tabs button.active { color: var(--white); }
.inspector-tabs button.active::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: -1px; height: 2px; background: var(--signal); }
.inspector-view { flex: 1; min-height: 0; overflow-y: auto; }
.inspector-view.active { display: flex; flex-direction: column; }
.code-toolbar { min-height: 50px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-dark); }
.code-toolbar > div { display: flex; }
.code-toolbar button, .payload-title button { min-width: 46px; min-height: 42px; padding: 0 7px; border: 0; background: transparent; color: #858a85; font-family: var(--font-mono); font-size: 10px; cursor: pointer; }
.code-toolbar button.active { color: var(--signal); }
.code-toolbar > button { color: #bec1bc; border-left: 1px solid var(--line-dark); }
.request-code, .payload-code { flex: 1; min-height: 280px; margin: 0; padding: 24px 20px; overflow: auto; color: #d2d5cf; font: 11px/1.85 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.code-key { color: #aab4ff; }
.code-string { color: var(--signal); }
.code-number { color: #e1bb72; }
.code-note { margin: 16px; padding: 14px; display: flex; gap: 11px; border: 1px solid var(--line-dark); background: #111416; }
.code-note > i { width: 7px; height: 7px; margin-top: 4px; background: var(--blue); flex: 0 0 auto; }
.code-note p { margin: 0; display: grid; gap: 5px; }
.code-note b { color: #e1e3dd; font-size: 12px; font-weight: 550; }
.code-note span { color: #929792; font-size: 11px; line-height: 1.55; }
.request-summary { min-height: 72px; padding: 0 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-dark); }
.request-summary span { padding: 7px 9px; background: var(--signal); color: var(--ink); font-family: var(--font-mono); font-size: 10px; }
.request-summary code { color: #daddd7; font: 11px var(--font-mono); }
.request-facts { margin: 0; }
.request-facts > div { min-height: 58px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line-dark); }
.request-facts dt { color: #8b908b; font: 10px var(--font-mono); }
.request-facts dd { margin: 0; color: #d9dcd6; font: 11px var(--font-mono); text-align: right; }
.payload-title { min-height: 52px; padding-left: 20px; display: flex; align-items: center; justify-content: space-between; color: #8b908b; font: 10px var(--font-mono); border-bottom: 1px solid var(--line-dark); }
.payload-title button { margin-right: 12px; color: #bec1bc; }
.payload-code { min-height: 250px; flex: initial; }
.metrics-empty { margin: auto; width: 75%; padding: 40px 0; text-align: center; }
.metrics-empty span { color: #8b908b; font: 10px var(--font-mono); }
.metrics-empty p { color: #aeb2ad; font-size: 14px; line-height: 1.6; }
.metrics-data { width: 100%; }
.metric-primary { min-height: 190px; padding: 26px 20px; display: flex; flex-direction: column; justify-content: flex-end; border-bottom: 1px solid var(--line-dark); }
.metric-primary > span, .metric-grid span, .route-trace > span { color: #898e89; font: 10px var(--font-mono); letter-spacing: .05em; }
.metric-primary b { margin-top: 20px; color: var(--signal); font: 500 62px/1 var(--font-display); letter-spacing: -.06em; }
.metric-primary small, .metric-grid small { color: #8b908b; font: 10px var(--font-mono); }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; }
.metric-grid > div { min-height: 108px; padding: 18px 20px; display: grid; align-content: space-between; border-right: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.metric-grid > div:nth-child(even) { border-right: 0; }
.metric-grid b { color: #daddd7; font: 500 22px var(--font-display); }
.metric-grid > div:last-child b { font-family: var(--font-price); font-size: 24px; font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.route-trace { padding: 24px 20px; }
.route-trace > div { padding: 15px 0; display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line-dark); }
.route-trace i { width: 6px; height: 6px; background: var(--signal); }
.route-trace p { margin: 0; display: grid; gap: 4px; }
.route-trace b { color: #e0e3dd; font-size: 12px; font-weight: 500; }
.route-trace small, .route-trace em { color: #8c918c; font: 10px var(--font-mono); font-style: normal; }
.inspector-status { min-height: 42px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-dark); color: #858a85; font-family: var(--font-mono); font-size: 10px; }
.inspector-status span:first-child { display: flex; align-items: center; gap: 7px; color: var(--signal); }
.inspector-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.playground-page .toast { color: var(--ink); }

@media (max-width: 1180px) {
  .workbench-grid { grid-template-columns: 280px minmax(380px, 1fr) 360px; }
  .panel-section { padding: 18px; }
  .workbench-title p, .workbench-meta > span:first-child { display: none; }
}

@media (max-width: 900px) {
  .playground-page .nav-active::after { display: none; }
  .playground-main { height: auto; min-height: calc(100vh - 72px); }
  .workbench-bar { min-height: 64px; padding-inline: 18px; }
  .workbench-meta > span { display: none; }
  .workbench-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); }
  .settings-panel { grid-column: 1; grid-row: 1; max-height: none; }
  .conversation-panel { grid-column: 2; grid-row: 1; min-height: 760px; }
  .inspector-panel { grid-column: 1 / -1; grid-row: 2; min-height: 620px; border-left: 0; border-top: 1px solid var(--ink); }
}

@media (max-width: 640px) {
  .playground-page .site-header { position: relative; }
  .playground-page .header-actions .button { display: none; }
  .workbench-bar { min-height: 68px; }
  .workbench-title h1 { font-size: 20px; }
  .workbench-meta { gap: 0; }
  .workbench-grid { display: flex; flex-direction: column; border: 0; }
  .settings-panel { order: 1; overflow: visible; border-right: 0; border-bottom: 1px solid var(--ink); }
  .mode-section { padding-top: 18px; }
  .conversation-panel { order: 2; min-height: 560px; }
  .inspector-panel { order: 3; min-height: 620px; }
  .conversation-head { padding-inline: 16px; }
  .conversation-head > div > span { display: none; }
  .conversation-head b { padding-left: 0; border: 0; }
  .message-list { padding: 20px 16px; }
  .message { max-width: 94%; }
  .composer-wrap { padding: 0 12px 14px; }
  .system-prompt > button b { display: none; }
  .system-prompt > button { grid-template-columns: 1fr auto; }
  .composer-footer > span { display: none; }
  .run-button { width: 100%; margin-left: 0; }
  .code-toolbar { overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .typing-cursor { animation: none; }
}
