:root {
  --ink: #18202a;
  --muted: #667085;
  --line: #d8dee8;
  --paper: #f7f8fa;
  --panel: #ffffff;
  --accent: #0f766e;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Aptos", sans-serif;
}

.navbar {
  background: #fff;
}

.page-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
}

h2 {
  font-size: 1rem;
  font-weight: 700;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.sync-meta {
  font-size: .88rem;
  margin: -.5rem 0 1rem;
}

.table-wrap,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.panel {
  padding: 1rem;
}

.table th {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mono {
  font-family: "Cascadia Mono", Consolas, monospace;
}

.actions {
  white-space: nowrap;
}

.actions form {
  display: inline;
}

.status-error-wrap {
  display: inline-flex;
  position: relative;
}

.status-error {
  background: #fff4ed;
  border: 1px solid #f4b29b;
  border-radius: 999px;
  color: #b42318;
  cursor: default;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  padding: .16rem .5rem;
}

.status-error-popover {
  background: #111827;
  border: 1px solid #293447;
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(16, 24, 40, .24);
  color: #f9fafb;
  display: none;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: .78rem;
  left: 0;
  line-height: 1.45;
  max-width: min(520px, 72vw);
  min-width: 300px;
  padding: .75rem .85rem;
  position: absolute;
  text-align: left;
  top: calc(100% + .45rem);
  user-select: text;
  white-space: pre-wrap;
  z-index: 20;
}

.status-error-popover::before {
  bottom: 100%;
  content: "";
  height: .55rem;
  left: 0;
  position: absolute;
  right: 0;
}

.status-error-wrap:hover .status-error-popover,
.status-error-wrap:focus-within .status-error-popover {
  display: block;
}

.note-form {
  align-items: center;
  display: flex;
  gap: .45rem;
  min-width: 180px;
}

.note-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  min-height: 2rem;
  padding: .25rem .45rem;
  width: 100%;
}

.note-input:hover,
.note-input:focus {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
  outline: 0;
}

.note-input::placeholder {
  color: #98a2b3;
}

.note-saved {
  color: var(--muted);
  font-size: .75rem;
  min-width: 2.4rem;
}

.empty {
  color: var(--muted);
  padding: 2rem !important;
  text-align: center;
}

.edit-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.facts .metric {
  color: var(--accent);
  font-size: 2.5rem;
  font-weight: 750;
}

.settings-list div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: .8rem 0;
}

.settings-list div:last-child {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .edit-grid,
  .page-head {
    display: block;
  }

  .page-head .btn,
  .page-head form {
    margin-top: 1rem;
  }

  .head-actions {
    justify-content: flex-start;
  }
}
