:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-panel: #f6f6f6;
  --bg-hover: #ececec;
  --fg: #242424;
  --fg-muted: #5a5a5a;
  --fg-dim: #8a8a8a;
  --line: #c8c8c8;
  --line-dim: #e2e2e2;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
}

*, *::before, *::after {
  border-radius: 0;
  box-sizing: border-box;
}


html, body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100dvh;
}

.view-header {
  position: relative;
  padding: 0.55rem 9.5rem 0.55rem 0.75rem;
  font-family: var(--font-mono);
  background: var(--bg-panel);
  color: var(--fg);
  border-bottom: 1px solid var(--line);
}

#crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  font-size: 12px;
  margin: 0;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#crumb a {
  color: var(--fg);
  text-decoration: none;
}

#crumb a:hover {
  color: var(--fg-muted);
  text-decoration: underline;
}

#crumb .crumb-sep {
  color: var(--fg-dim);
  user-select: none;
}

#crumb [aria-current="page"] {
  color: var(--fg);
  font-weight: 500;
}

.shape-nav {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 2;
}

.shape-nav[hidden] {
  display: none;
}

.shape-nav a {
  color: var(--fg);
  text-decoration: none;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  white-space: nowrap;
}

.shape-nav a:hover {
  color: var(--fg-muted);
  border-color: var(--fg-dim);
}

#title {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
}

#title[hidden] {
  display: none;
}

#title .view-status {
  font-size: 13px;
  color: var(--fg);
}

#title.error .view-status {
  color: var(--fg-muted);
}

.globe-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

.left-column {
  flex: 0 0 22rem;
  max-width: 24rem;
  min-width: 16rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.browse-panel {
  flex: 1 1 55%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--line-dim);
  background: var(--bg-panel);
}

.panel-meta {
  font-size: 10px;
  color: var(--fg-muted);
  text-transform: none;
  letter-spacing: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-links {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}

.browse-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.5rem;
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid var(--line-dim);
}

.browse-row.is-active {
  background: var(--bg-hover);
}

.browse-row a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}

.browse-row a:hover {
  text-decoration: underline;
}

.browse-path {
  grid-column: 1 / -1;
  color: var(--fg-muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-path::before {
  content: './';
  color: var(--fg-dim);
}

.browse-note {
  color: var(--fg-muted);
  font-size: 10px;
  border: 1px solid var(--line);
  padding: 0.05rem 0.3rem;
  background: var(--bg);
}

.json-panel {
  flex: 1 1 45%;
  min-height: 8rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.json-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--line-dim);
  background: var(--bg-panel);
}

.json-panel-raw {
  color: var(--fg);
  text-decoration: none;
}

.json-panel-raw:hover {
  color: var(--fg-muted);
  text-decoration: underline;
}

.json-code {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 0.65rem 0.75rem;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg);
  background: var(--bg);
  white-space: pre-wrap;
  word-break: break-word;
}

.json-code .json-key {
  color: #0b6e99;
}

.json-code .json-string {
  color: #1a7f37;
}

.json-code .json-number {
  color: #953800;
}

.json-code .json-boolean {
  color: #6f42c1;
}

.json-code .json-null {
  color: #6f42c1;
}

.json-code .json-punct {
  color: var(--fg-dim);
}

#map-host {
  flex: 1 1 auto;
  min-height: 16rem;
  min-width: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg-panel);
}

#map-host gk-map {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 720px) {
  .globe-body {
    flex-direction: column;
  }

  .left-column {
    flex: 0 0 52%;
    max-width: none;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}
