:root {
  --hub-nav: #0d261e;
  --hub-nav-hover: #163a2e;
  --hub-nav-text: #cfe0d8;
  --hub-nav-muted: #829d91;
  --workbench-line: #d7ded9;
  --workbench-chrome: #f1f4f2;
}

body {
  font-size: 14px;
  background: #f6f8f6;
}

.app {
  grid-template-columns: 224px minmax(0, 1fr);
}

.rail {
  width: 224px;
  padding: 18px 14px;
  color: var(--hub-nav-text);
  background: var(--hub-nav);
  border-right: 0;
}

.brand {
  padding: 4px 6px 24px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #07835f;
  font-size: 17px;
}

.brand strong {
  color: #f4faf7;
  font-size: 16px;
}

.brand span,
.nav-label,
.rail-note p {
  color: var(--hub-nav-muted);
}

.nav {
  gap: 4px;
}

.nav a {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 23px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--hub-nav-text);
  text-decoration: none;
  font-weight: 650;
}

.nav a:hover {
  color: #fff;
  background: var(--hub-nav-hover);
}

.nav a.active {
  color: #0b513b;
  background: #edf7f2;
}

.nav a.active > span:first-child {
  color: #258164;
}

.rail-note {
  border-top-color: #294139;
}

.topbar {
  min-height: 58px;
  padding: 10px 24px;
}

.topbar h1 {
  font-size: 16px;
}

.content {
  max-width: 1240px;
  padding: clamp(24px, 4vw, 54px);
}

.session-banner {
  margin-bottom: 18px;
  border-radius: 8px;
}

.page-head {
  align-items: flex-start;
  margin-bottom: 24px;
}

.page-head h2 {
  margin: 0 0 7px;
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.metrics {
  display: none;
}

.toolbar {
  grid-template-columns: minmax(240px, 1fr) 160px 160px auto;
  max-width: 1120px;
  margin: 0 auto 14px;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.skill-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--workbench-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.skill-card {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(210px, auto);
  gap: 20px;
  align-items: center;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--workbench-line);
  border-radius: 0;
}

.skill-card:last-child {
  border-bottom: 0;
}

.skill-card:hover,
.skill-card.selected {
  border-color: var(--workbench-line);
  background: #f1f7f4;
  box-shadow: none;
}

.skill-card h3 {
  font-size: 16px;
}

.skill-card p {
  margin-bottom: 0;
}

.skill-card .meta {
  margin: 0;
  gap: 20px;
}

body[data-page="library"] .detail {
  display: none;
}

body[data-page="detail"] [data-panel="library"] > .page-head,
body[data-page="detail"] [data-panel="library"] > .metrics,
body[data-page="detail"] [data-panel="library"] > .toolbar,
body[data-page="detail"] .skill-grid {
  display: none;
}

.detail {
  position: static;
  top: auto;
  min-height: 0;
  padding: 26px;
  border-radius: 8px;
  box-shadow: none;
}

.detail-content.active {
  display: block;
}

.detail-route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.detail-route-head a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
}

.detail-route-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.detail-route-actions .button {
  white-space: nowrap;
}

.panel,
.empty-state {
  border-radius: 8px;
  box-shadow: none;
}

.skill-workspace-dialog {
  position: fixed;
  inset: 58px 0 0 224px;
  z-index: 30;
  width: auto;
  height: auto;
  color: var(--ink);
  background: #fff;
  border-left: 1px solid var(--workbench-line);
}

.skill-workspace-form {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.skill-workspace-head {
  padding: 6px 10px 6px 14px;
  background: var(--workbench-chrome);
}

.skill-workspace-head h2 {
  font-size: 14px;
}

.skill-workspace-body {
  grid-template-columns: 44px 246px minmax(360px, 1fr) minmax(280px, 340px);
  background: #fff;
}

.activity-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-top: 6px;
  background: #e8ede9;
  border-right: 1px solid var(--workbench-line);
}

.activity-bar button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 2px solid transparent;
  color: #69766e;
  background: transparent;
  cursor: pointer;
}

.activity-bar button[aria-current="true"] {
  color: #0d5d43;
  border-left-color: #0d7554;
  background: #f5f8f6;
}

.activity-bar svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.skill-file-rail,
.skill-config-rail {
  padding: 11px;
  background: #f6f8f6;
}

.skill-editor-pane {
  background: #fff;
}

.skill-editor-bar {
  min-height: 38px;
  padding: 6px 12px;
  background: #f7f9f7;
}

.skill-workspace-foot {
  min-height: 34px;
  padding: 4px 10px;
  color: #e8f3ed;
  background: #126146;
  border: 0;
}

.skill-workspace-status,
.skill-workspace-status strong {
  color: #e8f3ed;
}

.skill-workspace-foot .button.primary {
  min-height: 25px;
  padding: 2px 9px;
  color: #0c4a36;
  background: #fff;
  border-color: #fff;
  font-size: 12px;
}

body[data-page="editor"] .content:not(.signed-out):not(.consent-required),
body[data-page="verify"] .content:not(.signed-out):not(.consent-required) {
  visibility: hidden;
}

body[data-page="verify"]:has(#test-dialog[open]) {
  overflow: hidden;
}

body[data-page="verify"] #test-dialog {
  position: fixed;
  inset: 82px 24px 24px 248px;
  width: auto;
  height: calc(100dvh - 106px);
  max-width: none;
  max-height: none;
  margin: 0;
  border: 1px solid var(--workbench-line);
  border-radius: 8px;
  box-shadow: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 1050px) {
  .skill-workspace-body {
    grid-template-columns: 44px 210px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: auto;
  }

  .skill-config-rail {
    grid-column: 2 / -1;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 8px 12px;
  }

  .brand,
  .nav-label,
  .rail-note {
    display: none;
  }

  .nav {
    display: flex;
    overflow-x: auto;
  }

  .nav a {
    width: auto;
    min-width: max-content;
  }

  .topbar {
    min-height: 52px;
    padding: 8px 12px;
  }

  .content {
    padding: 22px 14px;
  }

  .detail-route-head {
    align-items: flex-start;
  }

  .detail-route-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .toolbar,
  .skill-card {
    grid-template-columns: 1fr;
  }

  .skill-workspace-dialog {
    inset: 112px 0 0;
  }

  .skill-workspace-body {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    overflow: auto;
  }

  .activity-bar {
    grid-row: 1 / 4;
  }

  .skill-file-rail,
  .skill-editor-pane,
  .skill-config-rail {
    grid-column: 2;
  }

  .skill-file-rail {
    max-height: 240px;
  }

  .skill-editor-pane {
    min-height: 55dvh;
  }

  .skill-workspace-head,
  .skill-workspace-foot {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  body[data-page="verify"] #test-dialog {
    inset: 124px 10px 10px;
    height: calc(100dvh - 134px);
  }
}

/* A signed-out console must not expose stale management views. */
#authenticated-content:is(.signed-out, .consent-required) .view,
#authenticated-content:is(.signed-out, .consent-required) .session-banner { display: none; }
