:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --text: #17211d;
  --muted: #65706a;
  --line: #d7ded8;
  --accent: #0f766e;
  --accent-2: #7c3aed;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(18, 24, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.brand {
  color: var(--text);
  font-weight: 700;
}

.top-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-link {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
}

.nav-link.active,
.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.app-main {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 64px;
}

.hero-band,
.panel,
.document-body {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
  margin-bottom: 18px;
}

.hero-band h1,
.page-title h1,
.detail-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.hero-band p,
.page-title p {
  margin: 8px 0 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-action,
.secondary-action,
.search-form button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
}

.primary-action,
.search-form button {
  background: var(--accent);
  color: #fff;
}

.secondary-action {
  border-color: var(--line);
  color: var(--text);
  background: #fff;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.panel,
.document-body {
  padding: 20px;
  margin-bottom: 18px;
}

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

.section-heading h2,
.panel h2,
.document-body h2 {
  margin: 0;
  font-size: 18px;
}

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

.row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.row-item:last-child {
  border-bottom: 0;
}

.item-title {
  color: var(--text);
  font-weight: 650;
}

.item-meta,
.meta-line,
.eyebrow {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.row-actions,
.meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f4f1;
  color: #075e58;
  font-size: 12px;
  font-weight: 700;
}

.pill.tone {
  background: #f0eafd;
  color: #5b21b6;
}

.subtle-link {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.page-title,
.detail-header {
  margin: 0 0 18px;
}

.detail-layout {
  width: min(920px, 100%);
}

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

.brief-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.brief-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.brief-grid dd {
  margin: 4px 0 0;
  font-weight: 650;
}

.plain-list {
  margin: 8px 0 0;
  padding-left: 20px;
}

.derived-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.derived-item:last-child {
  border-bottom: 0;
}

.document-body {
  font-size: 16px;
}

.document-body h1 {
  margin-top: 0;
  font-size: 26px;
}

.document-body h2 {
  margin-top: 24px;
}

.document-body pre {
  overflow-x: auto;
  padding: 14px;
  border-radius: 6px;
  background: #17211d;
  color: #f5f6f2;
}

.document-body code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #eef3f1;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.document-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.document-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.document-body th,
.document-body td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.document-body th {
  background: var(--surface-2);
  font-weight: 700;
}

.document-body blockquote {
  margin: 16px 0;
  padding: 8px 14px;
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  color: var(--muted);
}

.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.search-form input {
  flex: 1;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-panel p {
  color: var(--muted);
}

.login-error {
  color: var(--danger) !important;
  font-weight: 700;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.login-form input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

.login-form button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
}

@media (max-width: 760px) {
  .app-header,
  .hero-band,
  .row-item,
  .split-grid {
    display: block;
  }

  .app-header {
    padding: 12px 16px;
  }

  .top-nav,
  .hero-actions,
  .row-actions {
    justify-content: flex-start;
    margin-top: 10px;
  }

  .split-grid {
    margin-bottom: 0;
  }

  .brief-grid {
    grid-template-columns: 1fr;
  }
}
