@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Serif+Display:ital@0;1&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #191512;
  --muted: #756d65;
  --paper: #f5f1e9;
  --card: #fffdf9;
  --line: #e4ddd2;
  --lime: #ff9a73;
  --green: #e46f4b;
  --danger: #b83c32;
  --shadow: 0 10px 32px rgba(53, 38, 28, .045);
}

body { font-family: Inter, system-ui, sans-serif; background: var(--paper); }
h1, h2, h3 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; }
.eyebrow, code, pre, th { font-family: "DM Mono", Consolas, monospace; }

.topbar {
  height: 68px;
  padding: 0 24px;
  background: rgba(255, 253, 249, .96);
  border-color: var(--line);
  backdrop-filter: blur(16px);
}
.brand { font-size: 18px; color: var(--ink); }
.brand b { color: var(--green); }
.mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: #17120f; color: #ff9a73;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}
.topbar-label { color: #a09890; border-color: var(--line); }
.text-link, .text-button { color: #a84c34; }

.app-shell { grid-template-columns: 230px minmax(0, 1fr); max-width: none; min-height: calc(100vh - 68px); }
.sidebar {
  top: 68px; height: calc(100vh - 68px); padding: 25px 14px 18px;
  background: #fffdfa; border-color: var(--line);
}
.workspace { padding: 0 8px 20px; margin: 0 0 16px; border-bottom: 1px solid #eee7dd; }
.workspace-icon { background: #fff1eb; color: #b75238; border-color: #f0d5ca; border-radius: 10px; }
.workspace strong { color: var(--ink); }
.nav-link { padding: 11px 13px; color: #625d57; font-size: 13px; border-radius: 10px; }
.nav-link > span { color: #8e857c; }
.nav-link:hover { background: #fbf0e9; color: #aa4d35; }
.nav-link.active { background: #f8e8e1; color: #b64f34; font-weight: 650; }
.nav-link.active > span { color: #db6a49; }
.sidebar-foot { border-color: var(--line); padding: 20px 9px 0; }
.sidebar-foot code { color: #a04d39; }

.console-content { max-width: 1460px; padding: 34px 30px 0; }
.welcome { margin-bottom: 24px; }
.welcome h1 { font-size: 34px; letter-spacing: -.8px; }
.welcome p { font-size: 13px; }
.eyebrow { color: #b96349; }

.primary {
  background: #17120f; border-color: #17120f; color: #fff;
  border-radius: 10px; box-shadow: 0 6px 14px rgba(27, 20, 16, .12);
}
.primary:hover:not(:disabled) { background: #34251e; border-color: #34251e; }
.ghost { background: #fffdfa; border-color: var(--line); border-radius: 10px; }
.ghost:hover:not(:disabled) { background: #fff5ef; border-color: #dfb9a9; }
.badge { background: #fff0e9; color: #a64f39; border-radius: 999px; }

.metrics { grid-template-columns: 1.18fr repeat(3, 1fr); gap: 14px; }
.metric { min-height: 142px; border-color: var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.metric strong { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; font-size: 34px; }
.metric.balance-card {
  background: linear-gradient(135deg, #1c1511, #3a281f);
  border-color: #2a1e18; color: white; overflow: hidden;
}
.metric.balance-card::after {
  content: ""; position: absolute; width: 130px; height: 130px; right: -46px; top: -48px;
  border: 26px solid rgba(255, 144, 100, .22); border-radius: 50%;
}
.balance-card strong { color: #ff9a73; }
.balance-card > span, .balance-card small { color: #cbbdb5; }
.balance-card a { color: #ffb89d; }
.panel { border-color: var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.panel-head h2 { font-size: 23px; }
.starter-steps a { border-color: #eee6dc; }
.starter-steps a:hover { background: #fff6f0; }
.starter-steps a > span { background: #fff0e9; color: #b85a40; }
.starter-steps strong, .detail-list dd, td strong, td code { color: #473c35; }
.table-wrap { border-color: var(--line); border-radius: 11px; }
th { background: #faf6f0; color: #8f8379; }
td { border-color: #eee7de; color: #665d56; }
input, textarea, select { border-color: #ddd4ca; border-radius: 10px; }
input:focus, textarea:focus, select:focus { border-color: #df7959; box-shadow: 0 0 0 3px rgba(228,111,75,.12); }
.notice { background: #fff2eb; border-color: #f0d6c9; color: #85513e; }

/* Playground em formato de estúdio/chat */
.playground-studio {
  min-height: 690px; display: grid; grid-template-rows: auto minmax(360px, 1fr) auto;
  border: 1px solid var(--line); border-radius: 18px; background: #fffdfa;
  box-shadow: 0 18px 50px rgba(57, 39, 28, .07); overflow: hidden;
}
.studio-toolbar {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: #fff;
}
.studio-brand { display: flex; align-items: center; gap: 11px; }
.studio-brand strong, .studio-brand small { display: block; }
.studio-brand strong { font: 18px/1.1 "DM Serif Display", Georgia, serif; }
.studio-brand small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.studio-spark, .studio-orbit { color: #ed7651; }
.studio-spark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #fff0ea; font-size: 20px; }
.studio-selects { display: flex; align-items: end; gap: 10px; }
.studio-selects label { margin: 0; gap: 3px; }
.studio-selects label > span { font: 8px "DM Mono", monospace; letter-spacing: 1px; color: #9a8e84; }
.studio-selects select { width: 190px; min-height: 37px; padding: 7px 30px 7px 10px; font-size: 11px; }
.studio-canvas {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 40px 7%; background:
    radial-gradient(circle at 50% 45%, rgba(255,144,100,.09), transparent 34%),
    linear-gradient(#fffdfa, #faf6ef);
}
.studio-intro { text-align: center; max-width: 680px; transition: opacity .2s; }
.studio-orbit { display: block; font-size: 38px; line-height: 1; margin-bottom: 14px; }
.studio-intro h2 { margin: 0 0 8px; font-size: clamp(32px, 4vw, 48px); }
.studio-intro p { color: var(--muted); margin-bottom: 22px; }
.prompt-suggestions { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; }
.prompt-suggestions button { border: 1px solid var(--line); background: #fff; padding: 10px 13px; border-radius: 999px; color: #645a52; font-size: 11px; }
.prompt-suggestions button:hover { border-color: #e39b82; background: #fff6f1; }
.studio-response { display: none; width: 100%; min-height: 300px; background: transparent; border: 0; box-shadow: none; padding: 0; }
.studio-response:has(#answer:not(:empty)) { display: flex; }
.studio-response:has(#answer:not(:empty)) ~ * { display: none; }
.studio-canvas:has(#answer:not(:empty)) .studio-intro { display: none; }
.studio-canvas:has(#answer:not(:empty)) { align-items: stretch; }
.studio-response pre { background: #fff; color: #342b25; border-color: var(--line); min-height: 230px; max-height: 470px; }
.studio-composer { margin: 0 auto 18px; width: min(900px, calc(100% - 36px)); border: 1px solid #d9cfc5; border-radius: 17px; background: #fff; box-shadow: 0 12px 30px rgba(46,32,23,.09); overflow: hidden; }
.composer-settings { border-bottom: 1px solid #eee7de; padding: 0 15px; }
.composer-settings > summary { cursor: pointer; list-style: none; padding: 9px 0; color: #8c7e73; font-size: 10px; }
.composer-settings > summary::-webkit-details-marker { display: none; }
.composer-settings-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 14px; padding: 0 0 12px; align-items: start; }
.composer-settings-grid label { margin: 0; }
.composer-settings-grid .key-paste { margin: 0; padding: 8px 10px; }
.composer-settings-grid .key-paste label { margin: 8px 0 4px; }
.composer-settings-grid .two-cols { gap: 8px; }
.composer-prompt { margin: 0; }
.composer-prompt textarea { border: 0; border-radius: 0; min-height: 92px; resize: none; padding: 17px 18px 8px; font-size: 14px; box-shadow: none; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px 11px 17px; }
.composer-footer > div { display: flex; align-items: center; gap: 12px; }
.composer-footer .hint { margin: 0; max-width: 470px; font-size: 9px; }
.composer-footer .check-label { margin: 0; }
.composer-footer .play-actions { margin: 0; }
.composer-footer #send { border-radius: 999px; min-width: 90px; }
.composer-footer #send span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.14); }
.studio-composer > .error { margin: 0 12px 12px; }
.catalog-panel { margin-bottom: 26px; }

.package-card.selected { border-color: #de7454; background: #fff2ec; }
.package-card.selected::after { color: #d45e3e; }
.pix-result, .purchase-summary { background: #fff6f1; border-color: #ecd8cc; }
.toast { background: #211813; color: #ffc0a7; border-color: #4f3529; }

@media (max-width: 980px) {
  .studio-toolbar { align-items: flex-start; }
  .studio-selects { flex-wrap: wrap; justify-content: flex-end; }
  .composer-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { height: 64px; }
  .sidebar { top: 64px; }
  .studio-toolbar { flex-direction: column; }
  .studio-selects { width: 100%; justify-content: stretch; }
  .studio-selects label { flex: 1; }
  .studio-selects select { width: 100%; }
  .studio-canvas { padding: 38px 20px; min-height: 340px; }
  .studio-intro h2 { font-size: 34px; }
  .studio-composer { width: calc(100% - 20px); margin-bottom: 10px; }
  .composer-footer { align-items: flex-end; }
  .composer-footer > div:first-child { display: block; }
  .composer-footer .hint { display: block; max-width: 200px; margin-top: 4px; }
}
@media (max-width: 440px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .studio-selects { display: grid; grid-template-columns: 1fr; }
  .studio-selects .badge { display: none; }
  .prompt-suggestions button:last-child { display: none; }
  .composer-footer .hint { display: none; }
}
