:root {
  --bg: #0a0b0f;
  --bg-soft: #0f1117;
  --panel: #12141b;
  --panel-2: #171a23;
  --line: #252a36;
  --line-strong: #353d4d;
  --ink: #f5f7fb;
  --ink-soft: #a4adbf;
  --brand: #10a37f;
  --brand-2: #31c48d;
  --danger: #f07a86;
  --ok: #4ad295;
  --warn: #e6bb6e;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-1: 0 24px 48px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 12px 28px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(29, 38, 58, 0.5), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(18, 45, 38, 0.38), transparent 34%),
    var(--bg);
  font-family: "Manrope", "Segoe UI", sans-serif;
  scrollbar-width: thin;
  scrollbar-color: #394258 #10141d;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: #10141d;
}

*::-webkit-scrollbar-thumb {
  background: #394258;
  border-radius: 999px;
}

#app {
  padding: 10px 0 28px 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.shell {
  width: min(1500px, 96vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 8px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 15, 21, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-1);
}

.brand-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #101319, #1b202b);
  border: 1px solid var(--line-strong);
  color: #dfe7f6;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.03rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  margin: 1px 0 0 0;
  color: var(--ink-soft);
  font-size: 0.73rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.top-nav-link {
  background: transparent;
  border: 1px solid transparent;
  color: #c8ceda;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.84rem;
}

.top-nav-link:hover {
  border-color: var(--line);
  background: #171b24;
  color: #f1f4fa;
}

.top-nav-link.active {
  border-color: var(--line-strong);
  background: #1b212b;
  color: #ffffff;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 11px;
  color: var(--ink);
  background: #141822;
}

input::placeholder,
textarea::placeholder {
  color: #7f899d;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 16px;
  padding: 0;
  margin: 2px 0 0 0;
  border-radius: 4px;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

select[data-action="language-change"] {
  width: 170px;
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

button:disabled:hover {
  transform: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(16, 163, 127, 0.5);
  outline-offset: 2px;
}

.btn-primary {
  background: #f4f5f7;
  border-color: #f4f5f7;
  color: #0c1018;
  font-weight: 700;
}

.btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
}

.btn-secondary {
  color: #f0f4fa;
  background: #1a1f2b;
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background: #222937;
}

.btn-ghost {
  color: #d7deea;
  background: transparent;
  border-color: var(--line);
}

.btn-ghost:hover {
  background: #181d28;
  border-color: var(--line-strong);
}

.btn-danger {
  color: #fff5f5;
  background: #7f1d1d;
  border-color: #ef4444;
  font-weight: 700;
}

.btn-danger:hover {
  background: #991b1b;
  border-color: #f87171;
}

.btn-warning {
  color: #fffbeb;
  background: #78350f;
  border-color: #f59e0b;
  font-weight: 700;
}

.btn-warning:hover {
  background: #92400e;
  border-color: #fbbf24;
}

.btn-icon {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 38px;
  padding: 7px;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.landing {
  margin-top: 14px;
}

.landing-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.landing-sidebar {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #0f131c;
  padding: 12px;
  box-shadow: var(--shadow-2);
}

.sidebar-search input {
  border-radius: 9px;
  background: #161b27;
}

.sidebar-group {
  display: grid;
  gap: 6px;
}

.sidebar-group h4 {
  margin: 6px 0 4px 0;
  font-size: 0.82rem;
  color: #c5cedd;
  font-weight: 700;
}

.sidebar-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 0.82rem;
}

.sidebar-item:hover {
  background: #171c28;
  border-color: var(--line);
  color: #edf2ff;
}

.sidebar-item.active {
  background: #1c2230;
  border-color: #344059;
  color: #ffffff;
}

.landing-content {
  display: grid;
  gap: 12px;
}

.hero,
.proof-card,
.flow-card,
.footnotes,
.tab-panel,
.onboarding-panel,
.status-banner,
.model-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-2);
}

.hero {
  padding: clamp(16px, 3vw, 28px);
  background:
    linear-gradient(135deg, rgba(18, 21, 29, 0.98), rgba(17, 24, 31, 0.97)),
    radial-gradient(circle at 100% 0%, rgba(16, 163, 127, 0.15), transparent 40%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 18px;
}

.announcement {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #274039;
  background: rgba(16, 163, 127, 0.12);
  color: #98dbc6;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.announcement svg {
  width: 14px;
  height: 14px;
}

.hero h1 {
  margin: 12px 0 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4.3vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 12px 0 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.hero-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-notice {
  margin-top: 10px;
  color: var(--danger);
  font-size: 0.82rem;
}

.cli-row {
  margin-top: 14px;
}

.cli-row p {
  margin: 0 0 7px 0;
  font-size: 0.76rem;
  color: #909cb1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cli-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cli-pill {
  border: 1px solid #2f3747;
  border-radius: 999px;
  padding: 4px 9px;
  background: #191f2a;
  color: #e4ebf8;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.hero-visual {
  border: 1px solid #2b3343;
  border-radius: 14px;
  padding: 14px;
  background: #0f131b;
  display: grid;
  gap: 10px;
}

.code-pill {
  width: fit-content;
  border: 1px solid #3a4559;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.7rem;
  color: #d7dfed;
  background: #1b2230;
}

.hero-code {
  margin: 0;
  border: 1px solid #283042;
  border-radius: 10px;
  background: #0b0f16;
  padding: 12px;
  min-height: 240px;
  overflow: auto;
  color: #d7deec;
  font-size: 0.79rem;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.model-section {
  padding: 16px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.34rem;
  font-family: "Space Grotesk", sans-serif;
}

.section-head span {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.model-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.model-card {
  border: 1px solid #2f3747;
  border-radius: 14px;
  padding: 16px;
  min-height: 150px;
  display: grid;
  align-content: space-between;
  background: linear-gradient(140deg, #272c3d, #1f2532);
}

.model-card strong {
  font-size: 1.14rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.model-card p {
  margin: 8px 0 0 0;
  color: #d3d9e5;
  font-size: 0.84rem;
  line-height: 1.5;
}

.model-card-1 {
  background: linear-gradient(140deg, #3a2b4c, #2b2a3e);
}

.model-card-2 {
  background: linear-gradient(140deg, #2d324e, #28363f);
}

.model-card-3 {
  background: linear-gradient(140deg, #2e3d4e, #26313f);
}

.model-card-4 {
  background: linear-gradient(140deg, #3a3148, #2c2d3d);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.proof-card {
  padding: 14px;
  background: var(--panel-2);
}

.proof-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #eff4fc;
  margin-bottom: 10px;
}

.proof-card:nth-child(1) .proof-icon {
  background: linear-gradient(140deg, #296b57, #1d5a4e);
}

.proof-card:nth-child(2) .proof-icon {
  background: linear-gradient(140deg, #334466, #243653);
}

.proof-card:nth-child(3) .proof-icon {
  background: linear-gradient(140deg, #3f3f6d, #313859);
}

.proof-card:nth-child(4) .proof-icon {
  background: linear-gradient(140deg, #66443c, #563631);
}

.proof-icon svg {
  width: 18px;
  height: 18px;
}

.proof-card h3 {
  margin: 0;
  font-size: 0.97rem;
}

.proof-card p {
  margin: 6px 0 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.flow-card {
  padding: 18px;
}

.flow-card h2 {
  margin: 0;
  font-size: 1.28rem;
  font-family: "Space Grotesk", sans-serif;
}

.flow-card p {
  margin: 8px 0 0 0;
  color: var(--ink-soft);
  max-width: 78ch;
}

.flow-steps {
  margin: 12px 0 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.flow-steps li {
  border: 1px solid #2f3748;
  border-radius: 10px;
  background: #171b26;
  padding: 10px 11px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.flow-index {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #232a39;
  color: #f4f7fd;
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.footnotes {
  padding: 13px 14px;
  background: #11161f;
}

.footnotes p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.55;
}

.footnotes p + p {
  margin-top: 7px;
}

.connected-shell {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.status-banner {
  padding: 14px 16px;
  background: linear-gradient(135deg, #121722, #141a27);
}

.status-banner h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.18rem;
}

.status-banner p {
  margin: 5px 0 0 0;
  color: var(--ink-soft);
}

.status-stats {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.status-stats article {
  border: 1px solid #2d3445;
  border-radius: 10px;
  background: #161b27;
  padding: 9px;
}

.status-stats span {
  color: #9ca6b8;
  font-size: 0.74rem;
  display: block;
}

.status-stats strong {
  display: block;
  margin-top: 5px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.workspace-sidebar {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 8px;
}

.workspace-main {
  min-width: 0;
}

.onboarding-panel {
  padding: 13px;
}

.onboarding-panel h3,
.tab-panel h3,
.lane h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.onboarding-panel > p {
  margin: 5px 0 0 0;
  color: var(--ink-soft);
}

.onboarding-wizard {
  padding: 14px;
}

.wizard-track {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 7px;
}

.wizard-step {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #171d29;
  min-height: 68px;
  padding: 8px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 5px;
  color: #e9edf6;
}

.wizard-step span {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  background: #242c3d;
  color: #dce4f5;
}

.wizard-step strong {
  font-size: 0.74rem;
  line-height: 1.28;
}

.wizard-step.done {
  border-color: #2b5948;
  background: #15342b;
}

.wizard-step.done span {
  background: #1f6a53;
  color: #f0fcf7;
}

.wizard-step.active {
  border-color: #356e5d;
  background: #1a2d29;
}

.wizard-step.locked {
  opacity: 0.58;
}

.wizard-body {
  margin-top: 12px;
}

.wizard-panel {
  border: 1px solid #2a3244;
  border-radius: 10px;
  background: #151b27;
  padding: 12px;
}

.wizard-panel + .wizard-panel {
  margin-top: 12px;
}

.wizard-panel h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.97rem;
}

.wizard-panel p {
  margin: 7px 0 0 0;
  color: var(--ink-soft);
  line-height: 1.48;
  font-size: 0.86rem;
}

.terms-toolbar {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.terms-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.terms-badge {
  border: 1px solid #304160;
  border-radius: 999px;
  background: #182132;
  color: #d7e2f5;
  font-size: 0.74rem;
  padding: 4px 9px;
}

.terms-document {
  margin-top: 10px;
  border: 1px solid #2d3649;
  border-radius: 11px;
  background: #111723;
}

.terms-document-head {
  padding: 10px 11px;
  border-bottom: 1px solid #293247;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.terms-document-head strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.84rem;
}

.terms-document-head span {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.terms-content {
  margin: 0;
  padding: 10px 11px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.77rem;
  line-height: 1.48;
  color: #cfdaee;
}

.wizard-link {
  text-decoration: none;
}

.wizard-actions {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.onboarding-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.step-card {
  border: 1px solid #2d3444;
  border-radius: 10px;
  background: #161b26;
  padding: 10px;
}

.step-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.step-title h4 {
  margin: 0;
  font-size: 0.9rem;
}

.badge {
  font-size: 0.73rem;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid transparent;
  font-weight: 700;
}

.badge.todo {
  color: #d8b980;
  background: #30261a;
  border-color: #594932;
}

.badge.done {
  color: #9ce3c5;
  background: #1e3d33;
  border-color: #346756;
}

.mini-form {
  display: grid;
  gap: 7px;
}

.mini-form[hidden],
.cli-provider-card [hidden] {
  display: none !important;
}

.cli-provider-grid {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.cli-provider-card {
  border: 1px solid #2f3748;
  border-radius: 12px;
  background: #151c28;
  padding: 10px;
}

.cli-provider-card[draggable="true"] {
  cursor: grab;
}

.cli-provider-card[draggable="true"]:active {
  cursor: grabbing;
}

.cli-provider-card.dragging {
  opacity: 0.55;
  border-color: #4a6388;
}

.cli-provider-card.drag-over {
  border-color: #31c48d;
  box-shadow: inset 0 0 0 1px rgba(49, 196, 141, 0.35);
}

.cli-provider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cli-drag-handle {
  border: 1px solid #384359;
  border-radius: 999px;
  padding: 3px 9px;
  background: #1d2635;
  color: #d8e1f0;
  font-size: 0.74rem;
  user-select: none;
}

.mini-form.billing-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.mini-form.billing-form .billing-wide {
  grid-column: 1 / -1;
}

.mini-form.billing-form .btn-secondary.billing-wide {
  justify-self: flex-start;
}

.mini-form label {
  display: grid;
  gap: 4px;
  font-size: 0.81rem;
  color: var(--ink-soft);
}

.hint {
  margin: 6px 0 0 0;
  color: var(--ink-soft);
  font-size: xx-small;
  line-height: 1.45;
}

.ontology-explorer-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(260px, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.ontology-tree-list {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #2d3649;
  border-radius: 11px;
  background: #111723;
  padding: 0.45rem;
}

.ontology-tree-item-row {
  gap: 0.35rem;
  align-items: center;
  margin-left: var(--ontology-indent, 0);
}

.ontology-node-button {
  text-align: left;
  flex: 1;
  border: 1px solid transparent;
  padding: 0.28rem 0.4rem;
  border-radius: 0.45rem;
}

.ontology-node-button.active {
  border-color: rgba(56, 189, 248, 0.5);
  background: #1a2332;
}

.ontology-tree-node-body {
  padding: 0.35rem 0;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.ontology-inspector-section,
.ontology-bound-editor {
  margin-top: 0.55rem;
  padding: 0;
}

.ontology-plain-editor {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ontology-inspector-section h6,
.ontology-bound-editor h6 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: #e6edf8;
}

.ontology-kv-list {
  display: grid;
  gap: 0.4rem;
  max-height: 250px;
  overflow: auto;
}

.ontology-kv-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) minmax(0, 1.25fr);
  gap: 0.5rem;
  padding: 0.42rem;
  border: 1px solid #273046;
  border-radius: 8px;
  background: #121a28;
}

.ontology-kv-key {
  font-size: 0.76rem;
  color: #a8b4cc;
  overflow-wrap: anywhere;
}

.ontology-kv-value {
  min-width: 0;
}

.ontology-type-pill {
  display: inline-block;
  border: 1px solid #35517a;
  border-radius: 999px;
  padding: 2px 8px;
  background: #19263a;
  color: #cfe3ff;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ontology-scalar-value {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  line-height: 1.42;
  color: #d5deef;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ontology-editor-input {
  font-size: 0.78rem;
  line-height: 1.42;
  width: 100%;
}

.ontology-editor-textarea {
  min-height: 300px;
  height: 100%;
  flex: 1 1 auto;
  resize: none;
}

.ontology-save-row {
  justify-content: flex-end;
  margin-top: 0.55rem;
}

.ontology-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ontology-save-icon-btn {
  border-color: #35517a;
  background: #19263a;
  color: #cfe3ff;
}

.ontology-save-icon-btn:hover {
  border-color: #4a6b9c;
  background: #21314b;
}

.ontology-save-btn svg {
  width: 16px;
  height: 16px;
}

.inline-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.icon-nav {
  display: grid;
  gap: 6px;
  border: 1px solid #2a3142;
  border-radius: 12px;
  background: #141a25;
  padding: 7px 5px;
}

.icon-tab {
  width: 46px;
  height: 42px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: #c8d1e3;
  padding: 0;
}

.icon-tab svg {
  width: 18px;
  height: 18px;
}

.icon-tab:hover {
  background: #1b2331;
  border-color: #36455f;
  color: #f2f6ff;
}

.icon-tab.active {
  background: #223248;
  border-color: #4a6388;
  color: #ffffff;
}

.tab-panel {
  padding: 14px;
  background: var(--panel);
}

.stage-flow-header {
  margin-bottom: 10px;
}

.planner-wide-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}

.stage-context-panel h3 {
  margin-bottom: 8px;
}

.stage-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stage-context-grid label {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.workspace-chip-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.workspace-chip {
  border: 1px solid #2e3749;
  border-radius: 999px;
  background: #1a202d;
  color: #e6edf8;
  padding: 5px 10px;
  font-size: 0.78rem;
}

.workspace-chip.active {
  background: #23344a;
  border-color: #4a6388;
}

.workspace-list-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.workspace-card {
  border: 1px solid #2f3748;
  border-radius: 12px;
  background: #151c28;
  padding: 10px;
}

.workspace-card.active {
  border-color: #4a6388;
  background: #1c2738;
}

.workspace-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.workspace-card p {
  margin: 7px 0 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.arch-layout {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
}

.arch-chapter-nav {
  display: grid;
  gap: 6px;
  align-content: start;
}

.chapter-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #2f3748;
  border-radius: 10px;
  background: #151c28;
  color: #e2e9f8;
  padding: 7px 8px;
}

.chapter-btn.active {
  border-color: #4a6388;
  background: #21324a;
}

.arch-main {
  display: grid;
  gap: 10px;
}

.adr-grid,
.goal-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.adr-card,
.goal-card {
  border: 1px solid #2f3748;
  border-radius: 11px;
  background: #141b28;
  padding: 10px;
}

.adr-head,
.goal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.adr-card p,
.goal-card p {
  margin: 7px 0 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.roadmap-form {
  margin-bottom: 10px;
}

.roadmap-config-actions {
  justify-content: space-between;
  flex-wrap: wrap;
}

.roadmap-stage-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.roadmap-values-panel .ontology-tree-list {
  max-height: 360px;
}

.roadmap-chat-list {
  gap: 10px;
}

.roadmap-dimensions-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.roadmap-dimension {
  border: 1px solid #2b3448;
  border-radius: 10px;
  background: #131a27;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.roadmap-dimension strong {
  color: #d9e8ff;
}

.roadmap-item-form {
  margin-top: 10px;
}

.roadmap-chart-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.roadmap-chart-item {
  border: 1px solid #2f3748;
  border-radius: 11px;
  background: #141b28;
  padding: 10px;
}

.roadmap-item-editor-panel {
  border-color: #34435c;
}

.roadmap-item-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.roadmap-item-card-title {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.roadmap-item-card-title strong {
  display: block;
}

.roadmap-item-card-title p {
  margin: 5px 0 0 0;
  font-size: 0.78rem;
}

.roadmap-item-card-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.roadmap-item-edit-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #2f384b;
}

.roadmap-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.roadmap-chart-bar {
  margin-top: 8px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.2);
}

.roadmap-chart-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
}

.stage-markdown-panel {
  min-height: 260px;
}

.markdown-preview {
  margin-top: 8px;
  border: 1px solid #2c3448;
  border-radius: 10px;
  background: #0f141f;
  padding: 10px;
  max-height: 360px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #cfd8ea;
}

.stage-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(138px, 1fr);
  overflow: auto;
  gap: 8px;
  padding-bottom: 2px;
}

.stage-chip {
  position: relative;
  overflow: hidden;
  border: 1px solid #2b3344;
  background: #151b27;
  border-radius: 10px;
  padding: 9px;
  text-align: left;
  min-height: 82px;
  color: #e8eef9;
}

.stage-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.14) var(--stage-progress, 0%), rgba(148, 163, 184, 0.02) var(--stage-progress, 0%));
  pointer-events: none;
}

.stage-chip > strong,
.stage-chip > span {
  position: relative;
  z-index: 1;
}

.stage-chip.tone-none {
  border-color: #2b3344;
  background: #151b27;
}

.stage-chip.tone-none::before {
  background: linear-gradient(90deg, rgba(100, 116, 139, 0.1) var(--stage-progress, 0%), rgba(100, 116, 139, 0.02) var(--stage-progress, 0%));
}

.stage-chip.tone-low {
  border-color: #6a5231;
  background: #1f1a13;
}

.stage-chip.tone-low::before {
  background: linear-gradient(90deg, rgba(230, 187, 110, 0.2) var(--stage-progress, 0%), rgba(230, 187, 110, 0.03) var(--stage-progress, 0%));
}

.stage-chip.tone-mid {
  border-color: #2f5c56;
  background: #14221f;
}

.stage-chip.tone-mid::before {
  background: linear-gradient(90deg, rgba(74, 210, 149, 0.2) var(--stage-progress, 0%), rgba(74, 210, 149, 0.03) var(--stage-progress, 0%));
}

.stage-chip.tone-high {
  border-color: #35616f;
  background: #14202b;
}

.stage-chip.tone-high::before {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.22) var(--stage-progress, 0%), rgba(56, 189, 248, 0.04) var(--stage-progress, 0%));
}

.stage-chip.active {
  border-width: 1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.stage-chip strong {
  display: block;
  font-size: 0.83rem;
  line-height: 1.3;
}

.stage-chip span {
  display: block;
  margin-top: 7px;
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.stage-chip-backlog-compact {
  display: block;
  margin-top: 7px;
  font-size: 0.74rem;
  line-height: 1.35;
  white-space: nowrap;
}

.stage-chip-backlog-compact span {
  display: inline;
  margin-top: 0;
}

.stage-chip-count {
  font-weight: 700;
}

.stage-chip-sep {
  color: #6f7d94;
  padding: 0 1px;
}

.stage-chip-progress {
  color: #b5c0d6;
  margin-left: 3px;
}

.stage-chip-backlog-compact .stage-chip-count-zero {
  color: #8fa0b8;
}

.stage-chip-backlog-compact .stage-chip-count-nonzero {
  color: #22c55e;
}

.planner-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lane {
  border: 1px solid #2a3244;
  border-radius: 12px;
  background: #141a25;
  padding: 10px;
  min-height: 270px;
}

.lane h4 {
  margin-bottom: 10px;
}

.work-list {
  display: grid;
  gap: 8px;
}

.work-card {
  border: 1px solid #2d3549;
  border-radius: 10px;
  background: #1a202d;
  padding: 10px;
}

.work-card h5 {
  margin: 0;
  font-size: 0.89rem;
}

.work-card p {
  margin: 6px 0 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.vision-chat-list {
  gap: 10px;
}

.vision-chat-item {
  border: none;
  background: transparent;
  padding: 0;
}

.vision-chat-item p {
  margin: 4px 0 0;
}

.vision-chat-role {
  display: inline-block;
  font-size: small;
  font-weight: 600;
  text-transform: lowercase;
}

.vision-chat-form {
  margin-top: 16px;
}

.vision-chat-actions {
  margin-top: 14px;
}

.criteria-list {
  margin-top: 8px;
  display: grid;
  gap: 5px;
}

.backlog-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.backlog-create-wide {
  grid-column: 1 / -1;
}

.backlog-kanban-scroll {
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.backlog-kanban-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(280px, 1fr));
  gap: 10px;
  width: max-content;
  min-width: 100%;
}

.backlog-lane {
  border: 1px solid #2a3244;
  border-radius: 12px;
  background: #131a26;
  padding: 10px;
  min-height: 320px;
  width: 320px;
  max-width: 320px;
  min-width: 280px;
}

.backlog-lane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.backlog-lane-head h4 {
  margin: 0;
}

.backlog-card {
  border: 1px solid #2d3549;
  border-radius: 10px;
  background: #1a202d;
  padding: 10px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.backlog-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.backlog-card-head-tools {
  margin-left: auto;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  grid-auto-rows: max-content;
  flex: 0 0 auto;
  align-content: flex-start;
  justify-content: end;
  justify-items: end;
  gap: 4px;
}

.backlog-card-head-tools .btn-icon {
  min-width: 28px;
  min-height: 28px;
  padding: 4px;
}

.backlog-card-head-tools .btn-icon svg {
  width: 14px;
  height: 14px;
}

.backlog-card-title {
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
  display: grid;
  gap: 4px;
}

.backlog-pbi-title {
  display: block;
  margin: 0;
  font-size: 0.89rem;
  max-width: 250px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.backlog-card-title p {
  margin: 0;
}

.backlog-objective-inline {
  display: grid;
  gap: 4px;
  margin: 0;
  width: 100%;
}

.backlog-objective-inline .hint {
  margin: 0;
}

.backlog-objective-inline select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: small;
  background: #111826;
  color: #d7deea;
  border: 1px solid #2d3549;
  border-radius: 8px;
  padding: 4px 6px;
}

.backlog-objective-text {
  margin: 0;
  margin-left: -50px;
  width: 100%;
  padding-top: 3px;
  padding-bottom: 3px;
  font-size: 0.74rem;
  line-height: 1.2;
  color: #9fb0ce;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.backlog-card-bottom-row {
  margin-top: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.backlog-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 24px;
  margin-top: 0;
  margin-left: auto;
  min-width: 0;
  max-width: 40%;
  flex: 0 1 40%;
}

.backlog-card-cli {
  margin: 0;
  font-size: xx-small;
  text-align: right;
  white-space: normal;
  overflow-wrap: anywhere;
}

.backlog-cli-inline {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.backlog-cli-inline .hint {
  margin: 0;
}

.backlog-cli-inline select {
  width: auto;
  min-width: 120px;
  max-width: 100%;
  font-size: small;
  background: #111826;
  color: #d7deea;
  border: 1px solid #2d3549;
  border-radius: 8px;
  padding: 4px 6px;
}

.backlog-card p,
.backlog-card strong,
.backlog-card span,
.backlog-card summary,
.backlog-card .hint,
.backlog-card .feedback,
.backlog-card .success {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.backlog-card details,
.backlog-card details > pre {
  min-width: 0;
  max-width: 100%;
}

.backlog-card details {
  margin-top: 8px;
  border: 1px solid #2f384b;
  border-radius: 8px;
  background: #131a26;
  padding: 6px 8px;
}

.backlog-card details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: small;
}

.backlog-card .markdown-preview {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.backlog-performance-panel {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.backlog-performance-chart {
  display: grid;
  gap: 6px;
}

.backlog-performance-row {
  display: grid;
  gap: 6px;
  align-items: stretch;
  border: 1px solid #2f384b;
  border-radius: 8px;
  background: #0f1522;
  padding: 6px 8px;
  min-width: 0;
}

.backlog-performance-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.backlog-performance-agent {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.28;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.backlog-performance-bar-track {
  height: 10px;
  border: 1px solid #2f384b;
  border-radius: 999px;
  background: #111826;
  overflow: hidden;
}

.backlog-performance-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
}

.backlog-performance-row.in-progress .backlog-performance-bar {
  background: linear-gradient(90deg, #60a5fa, #38bdf8);
}

.backlog-performance-row.error .backlog-performance-bar {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.backlog-performance-duration {
  text-align: right;
  font-size: 0.76rem;
  font-weight: 600;
  color: #d5e2ff;
  white-space: nowrap;
}

.backlog-performance-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-width: 0;
}

.backlog-performance-meta-item {
  font-size: 0.7rem;
  color: #a8b3c7;
  white-space: nowrap;
}

.backlog-performance-lines {
  margin: 0;
  font-size: 0.74rem;
  background: #0d1421;
  border: 1px solid #2a3244;
  border-radius: 8px;
  padding: 8px;
}

.backlog-card-progress {
  margin-top: 8px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.22);
}

.backlog-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
}

.backlog-card-progress.active .backlog-card-progress-fill {
  background: linear-gradient(90deg, #60a5fa, #38bdf8);
}

.backlog-card-progress.error .backlog-card-progress-fill {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.backlog-card-progress.done .backlog-card-progress-fill {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.backlog-card-actions {
  margin-top: 0;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

.backlog-card-actions .btn-icon {
  min-width: 32px;
  min-height: 29px;
  padding: 5px;
}

.backlog-card-actions .btn-icon svg {
  width: 14px;
  height: 14px;
}

.backlog-cancel-btn {
  background: linear-gradient(135deg, #7f1d1d, #b91c1c);
  border-color: #f87171;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.28), 0 0 16px rgba(185, 28, 28, 0.25);
}

.backlog-warning-btn {
  background: linear-gradient(135deg, #78350f, #b45309);
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3), 0 0 16px rgba(180, 83, 9, 0.26);
}

.backlog-decision-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 8, 12, 0.7);
  backdrop-filter: blur(4px);
}

.backlog-decision-modal {
  width: min(780px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  border: 1px solid #37445c;
  border-radius: 14px;
  background: #121826;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  padding: 14px;
}

.backlog-decision-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.backlog-decision-modal-head h4 {
  margin: 0;
}

.backlog-decision-modal-head .hint {
  margin: 4px 0 0 0;
}

.backlog-decision-form {
  display: grid;
  gap: 10px;
}

.backlog-decision-item {
  border: 1px solid #2f384b;
  border-radius: 10px;
  background: #131a26;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.backlog-decision-item h5 {
  margin: 0;
}

.backlog-decision-item .hint {
  margin: 0;
}

.backlog-decision-item label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.backlog-decision-item textarea {
  min-height: 78px;
}

.backlog-decision-modal-actions {
  justify-content: flex-end;
  margin-top: 6px;
}

.criteria-row {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.79rem;
}

.criteria-row span {
  text-align: left;
}

.terms-accept-row {
  margin-top: 12px;
}

.feedback {
  margin-top: 7px;
  font-size: 0.79rem;
  color: var(--warn);
}

.success {
  color: var(--ok);
  font-size: 0.79rem;
}

.studio-success-float {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 1200;
  width: min(430px, calc(100vw - 24px));
  border: 2px solid #22c55e;
  border-left-width: 8px;
  border-radius: 12px;
  background: rgba(18, 39, 31, 0.98);
  color: #effcf4;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  pointer-events: none;
  animation: studioSuccessIn 160ms ease-out;
}

.studio-success-float strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #bbf7d0;
}

.studio-success-float span {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

@keyframes studioSuccessIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  border: 1px solid #2e3649;
  border-radius: 10px;
  background: #171d2a;
  padding: 11px;
}

.metric h4 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.22rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.83rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 9px 7px;
  border-bottom: 1px solid #283043;
}

.data-table th {
  color: #a7b1c3;
  font-size: 0.77rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.settings-card {
  border: 1px solid #2c3446;
  border-radius: 10px;
  background: #171e2a;
  padding: 11px;
}

.settings-card h4 {
  margin: 0;
}

.settings-card p {
  margin: 7px 0 0 0;
  color: var(--ink-soft);
  font-size: 0.83rem;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: pop-in 0.4s ease forwards;
}

.reveal:nth-child(2) {
  animation-delay: 0.05s;
}

.reveal:nth-child(3) {
  animation-delay: 0.1s;
}

.reveal:nth-child(4) {
  animation-delay: 0.14s;
}

@keyframes pop-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1320px) {
  .landing-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proof-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .landing-layout,
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .landing-sidebar,
  .workspace-sidebar {
    position: static;
  }

  .icon-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px;
  }

  .icon-tab {
    width: 100%;
  }

  .hero-grid,
  .planner-wide-grid,
  .arch-layout {
    grid-template-columns: 1fr;
  }

  .status-stats,
  .planner-grid,
  .usage-grid,
  .settings-grid,
  .stage-context-grid,
  .workspace-list-grid,
  .adr-grid,
  .goal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roadmap-dimensions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roadmap-item-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .roadmap-item-card-tools {
    justify-content: flex-start;
  }

  .backlog-create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #app {
    padding-top: 4px;
  }

  .shell {
    width: min(97vw, 720px);
  }

  select[data-action="language-change"] {
    width: 100%;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar > * {
    flex: 1 1 auto;
  }

  .icon-nav,
  .status-stats,
  .planner-grid,
  .usage-grid,
  .settings-grid,
  .proof-grid,
  .stage-context-grid,
  .workspace-list-grid,
  .adr-grid,
  .goal-grid,
  .model-grid {
    grid-template-columns: 1fr;
  }

  .roadmap-dimensions-grid {
    grid-template-columns: 1fr;
  }

  .studio-success-float {
    bottom: 8px;
    left: 8px;
    width: min(430px, calc(100vw - 16px));
  }

  .wizard-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-form.billing-form {
    grid-template-columns: 1fr;
  }

  .mini-form.billing-form .billing-wide {
    grid-column: auto;
  }

  .backlog-create-grid {
    grid-template-columns: 1fr;
  }

  .backlog-performance-duration {
    text-align: right;
  }

  .ontology-explorer-grid {
    grid-template-columns: 1fr;
  }

  .ontology-kv-row {
    grid-template-columns: 1fr;
  }
}
