:root {
  --bg: #efeae1;
  --paper: #fffcf6;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e4dccf;
  --accent: #1f4d46;
  --accent-weak: #e7f0ee;
  --warn: #9a3412;
  --warn-weak: #f6e7de;
  --sel: #e8f0ee;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 8px;
}

.drag { -webkit-app-region: drag; }
.nodrag { -webkit-app-region: no-drag; }

.kicker {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  outline: none;
}

.search input:focus { border-color: var(--accent); }

.intents, .facets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip, .intent {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.intent { background: #fff; }

.chip[aria-pressed="true"], .intent[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip .n {
  color: inherit;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.list {
  flex: 1;
  overflow: auto;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.row[aria-selected="true"] { background: var(--sel); }

.title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta, .why {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.why { text-align: right; }
.num { font-variant-numeric: tabular-nums; }

.badge {
  font-size: 11px;
  border-radius: 999px;
  padding: 0 7px;
  margin-left: 6px;
}

.badge.local { background: var(--accent-weak); color: var(--accent); }
.badge.pointer { background: var(--warn-weak); color: var(--warn); }

.empty {
  margin: 24px 8px;
  color: var(--muted);
}

footer {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.section {
  margin: 10px 8px 4px;
  font-size: 11px;
  color: var(--muted);
}

body.login {
  overflow: auto;
  height: auto;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 360px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 18px 18px;
}

.login-card h1 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 650;
}

.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
}

.login-card button {
  margin-top: 12px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.login-err {
  margin: 0 0 10px;
  color: var(--warn);
  font-size: 13px;
}

.logout {
  float: right;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

html[data-remote] .shell { padding-top: 10px; }
