/* Stonko controls keep the route canvas and its established palette. */
.header-inner { gap: 28px; }
.header .brand { gap: 11px; font-size: 30px; letter-spacing: -.055em; color: var(--primary); }
.header .brand img { width: 38px; height: 38px; object-fit: contain; background: none; }
.header .brand-sub { font-size: 6px; letter-spacing: .12em; color: var(--muted); }
.header nav { gap: 23px; font-size: 12px; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 0; }
.header .preview-badge { display: none; }

.button,
.hero .builder .button.wide,
.workspace-layout .flow-visual .button,
.bottom-cta .button {
  min-height: 40px;
  padding: 10px 16px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  box-shadow: none;
  transition: background .16s, border-color .16s, color .16s;
}
.button.small { min-height: 38px; padding: 9px 14px; font-size: 11px; gap: 9px; }
.button svg { width: 16px; height: 16px; flex-shrink: 0; }
.button.primary { background: var(--primary); border-color: var(--primary); color: var(--bg); }
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); transform: none; }
.button.quiet { background: var(--deep); border-color: var(--line); color: var(--ink); }
.button.quiet:hover { background: var(--surface); border-color: var(--primary); }
.button:active { border-color: var(--primary-hover); }
.button:disabled { cursor: not-allowed; opacity: .45; }

.choose-quote,
.workspace-layout .choose-quote {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--deep);
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: none;
  transition: background .16s, border-color .16s;
}
.choose-quote:hover { background: var(--surface); border-color: var(--primary); color: var(--ink); }
.icon-button,
.workspace-layout .icon-button,
.dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--deep);
  color: var(--primary);
  transition: background .16s, border-color .16s;
}
.icon-button:hover,
.dialog-close:hover { border-color: var(--primary); background: var(--surface); }
.dialog-close { font-size: 23px; }
.token-result { border: 1px solid var(--line-soft); border-radius: 9px; background: var(--deep); padding: 12px; }
.token-result:hover { border-color: var(--primary); background: var(--surface); }
.token-result[aria-current="true"] { border-color: var(--primary); }

.studio-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 44px;
}
.metric-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 120px;
  padding: 19px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--deep);
  transition: background .16s, border-color .16s;
}
.metric-card:hover { border-color: var(--primary); background: var(--surface); }
.metric-value { display: block; color: var(--ink); font-size: 27px; font-weight: 800; line-height: 1.1; letter-spacing: -.055em; }
.metric-label { display: block; margin-top: 8px; color: var(--primary); font-size: 12px; line-height: 1.45; letter-spacing: -.025em; }
.metric-note { display: block; margin-top: 7px; color: var(--dim); font: 8px/1.5 Mono, monospace; }

@media (max-width: 1100px) {
  .header-inner { gap: 20px; }
  .header nav { gap: 17px; font-size: 11px; }
  .header .brand { font-size: 28px; }
  .header .brand img { width: 36px; height: 36px; }
  .metric-card { padding-left: 15px; padding-right: 15px; }
  .metric-value { font-size: 25px; }
  .metric-label { font-size: 11px; }
}
@media (max-width: 1000px) {
  .studio-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .metric-card { grid-column: span 2; min-height: 112px; }
  .metric-card:nth-last-child(-n + 2) { grid-column: span 3; }
}
@media (max-width: 900px) {
  .header-actions .quiet { display: none; }
  .header-actions { margin-left: auto; }
  .header nav { margin-left: auto; }
}
@media (max-width: 760px) {
  .header-inner { gap: 12px; }
  .header .brand { font-size: 27px; gap: 9px; }
  .header .brand img { width: 34px; height: 34px; }
  .header .brand-sub { font-size: 5px; letter-spacing: .08em; }
  .header-actions .button.small { min-height: 39px; padding: 9px 12px; font-size: 10px; }
  .hero .builder .button.wide,
  .workspace-layout .flow-visual .button,
  .bottom-cta .button { min-height: 44px; font-size: 11px; }
  .studio-metrics { gap: 10px; margin: 18px 0 34px; }
  .metric-card { padding: 17px 16px; }
  .metric-value { font-size: 26px; }
  .metric-label { font-size: 12px; }
}
@media (max-width: 600px) {
  .studio-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card,
  .metric-card:nth-last-child(-n + 2) { grid-column: auto; min-height: 116px; }
  .metric-card:last-child { grid-column: 1 / -1; }
  .metric-label { font-size: 12px; }
}
@media (pointer: coarse) {
  .button,
  .button.small,
  .header-actions .button.small,
  .choose-quote,
  .workspace-layout .choose-quote,
  .icon-button,
  .workspace-layout .icon-button,
  .dialog-close { min-height: 44px; }
  .icon-button,
  .workspace-layout .icon-button,
  .dialog-close { min-width: 44px; }
  .workspace-layout .market-controls { grid-template-columns: 1fr 1fr 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .button,
  .choose-quote,
  .icon-button,
  .dialog-close,
  .metric-card { transition: none; }
}

/* Equal side columns keep the navigation at the true center of the header. */
.header > .header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 18px;
  min-height: 68px;
  padding-top: 11px;
  padding-bottom: 11px;
}
.header .header-inner > .brand { justify-self: start; }
.header .header-inner > nav {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 5px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #9fb7c2;
  white-space: nowrap;
}
.header .header-inner > nav > a,
.header .header-inner > nav > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.4;
  transition: color .16s, background .16s;
}
.header .header-inner > nav > a:hover,
.header .header-inner > nav > button:hover,
.header .header-inner > nav > .is-active,
.header .header-inner > nav > [aria-current="location"] {
  background: #192a2e;
  color: var(--ink);
}
.header .header-inner > nav > .social-x {
  min-width: 40px;
  padding: 10px;
}
.header .social-x svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}
.header .header-inner > .header-actions {
  justify-self: end;
  justify-content: flex-end;
  margin: 0;
  white-space: nowrap;
}
@media (min-width: 1200px) {
  .header .header-inner > nav { font-size: 15px; gap: 6px; }
}
@media (max-width: 900px) {
  .header .header-inner > .header-actions .quiet { display: none; }
}
@media (max-width: 760px) {
  :root { scroll-padding-top: 132px; }
  .header > .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 12px 14px;
    padding: 12px 18px 9px;
  }
  .header .header-inner > .brand { grid-column: 1; grid-row: 1; }
  .header .header-inner > .header-actions { grid-column: 2; grid-row: 1; }
  .header .header-inner > nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    max-width: 100%;
    overflow-x: auto;
    gap: 3px;
    font-size: 13px;
    scrollbar-width: thin;
  }
  .header .header-inner > nav > a,
  .header .header-inner > nav > button {
    flex: 0 0 auto;
    padding-left: 11px;
    padding-right: 11px;
  }
}
@media (max-width: 380px) {
  .header .header-inner > nav { font-size: 12px; gap: 1px; }
  .header .header-inner > nav > a,
  .header .header-inner > nav > button { padding-left: 9px; padding-right: 9px; }
}
@media (pointer: coarse) {
  .header .header-inner > nav > a,
  .header .header-inner > nav > button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .header .header-inner > nav > a,
  .header .header-inner > nav > button { transition: none; }
}
