/* Base */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background var(--speed), color var(--speed);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Barra superiore */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
  transition: background var(--speed), border-color var(--speed);
}

.topbar h1,
.panel-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 30px;
  line-height: 1.05;
}

.topbar-brand {
  min-width: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--input-bg);
  box-shadow: 0 0 0 1px var(--line), 0 10px 28px color-mix(in srgb, var(--accent-2) 24%, transparent);
}

.panel-heading h2 {
  font-size: 20px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* Area di lavoro */

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
  gap: 22px;
  padding: 22px 32px 32px;
}

.editor-panel,
.solution-panel {
  min-width: 0;
}

.editor-panel {
  align-self: start;
  position: sticky;
  top: 102px;
  max-height: calc(100vh - 122px);
  overflow: auto;
  padding-right: 4px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

/* Righe flessibili */

.topbar-actions,
.small-actions,
.example-row,
.step-toolbar,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-actions {
  align-items: flex-end;
  justify-content: flex-end;
}

.output-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.output-grid > * {
  min-width: 0;
}
