:root {
  color-scheme: light;
  --bg: #f4f1ec;
  --paper: #fffdf8;
  --paper-2: #f9f6ef;
  --ink: #202420;
  --muted: #656b63;
  --line: #ddd6c8;
  --green: #1e6b56;
  --green-2: #d8ebe2;
  --gold: #a66d12;
  --gold-2: #f4e5c6;
  --red: #9a3d2f;
  --teal: #2f7284;
  --shadow: 0 18px 45px rgba(48, 42, 30, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(244, 241, 236, 0.92), rgba(244, 241, 236, 1)),
    repeating-linear-gradient(90deg, rgba(32, 36, 32, 0.04) 0 1px, transparent 1px 96px);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.95;
  font-weight: 850;
}

.sync-meta {
  flex: 0 0 auto;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.78);
  color: var(--muted);
  font-size: 0.82rem;
}

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

.metric {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.metric.accent {
  background: #24352f;
  color: #fffdf8;
  border-color: #24352f;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric.accent .metric-label {
  color: #d8ebe2;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

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

.filters,
.results {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.filters {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 18px;
  padding: 14px;
}

.filters h2,
.results-head h2 {
  font-size: 0.95rem;
  font-weight: 850;
}

.search-box {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #cfc6b7;
  background: #fff;
}

.search-box svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-linecap: round;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

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

.filter-pill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d4cbbb;
  background: var(--paper-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.filter-pill[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green-2);
}

.filter-pill span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-pill .count {
  min-width: 28px;
  padding: 2px 6px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-size: 0.75rem;
}

.compact {
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.results {
  min-height: 640px;
  padding: 14px;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.results-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

select {
  min-width: 136px;
  height: 38px;
  border: 1px solid #cfc6b7;
  background: #fff;
  color: var(--ink);
}

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

.skill-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 238px;
  padding: 14px;
  border: 1px solid #d8d0c0;
  background: #fff;
}

.skill-card:hover {
  border-color: #b9aa95;
}

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

.skill-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.04rem;
  font-weight: 850;
  line-height: 1.2;
}

.category {
  flex: 0 0 auto;
  max-width: 130px;
  padding: 4px 7px;
  background: var(--gold-2);
  color: #65440e;
  font-size: 0.72rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purpose {
  margin-top: 10px;
  color: #3e443f;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.host-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  margin-top: 12px;
}

.host-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 4px 7px;
  background: #eef3f0;
  color: #26332e;
  font-size: 0.72rem;
  font-weight: 750;
}

.host-badge.codex {
  background: #d8ebe2;
  color: #154d3d;
}

.host-badge.claude {
  background: #efe2d2;
  color: #75431e;
}

.host-badge.agent {
  background: #dfeaf0;
  color: #24576a;
}

.host-badge.source {
  background: #f4e5c6;
  color: #65440e;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.status-line span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.empty-state {
  padding: 60px 16px;
  border: 1px dashed #c8bdaa;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .sync-meta {
    max-width: none;
    width: 100%;
  }

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

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

  .filters {
    position: static;
  }

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

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

  .results-head {
    align-items: stretch;
    flex-direction: column;
  }

  select {
    width: 100%;
  }
}
