@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg-top: #f6f2ea;
  --bg-bottom: #d9e8cf;
  --panel: rgba(255, 255, 255, 0.9);
  --ink: #1e2a1f;
  --muted: #4a5b4d;
  --border: #c2d9b6;
  --accent: #2f7d4d;
  --accent-2: #4da66a;
  --danger: #ad3d3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Sora', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, #ffe4bc 0, transparent 35%),
    radial-gradient(circle at 8% 12%, #d9e7ff 0, transparent 30%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
  min-height: 100vh;
}

.app {
  width: min(1180px, 92vw);
  margin: 1.5rem auto 2.8rem;
  display: grid;
  gap: 0.9rem;
}

.hero {
  padding: 0.2rem 0;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0.24rem 0 0;
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  line-height: 1.08;
}

.subtitle {
  margin: 0.55rem 0 0;
  max-width: 72ch;
  color: var(--muted);
}

.grid.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: 0 10px 28px rgba(30, 42, 31, 0.12);
}

.panel h2 {
  margin: 0;
  font-size: 1.02rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.inline-form,
.search-add {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
  align-items: center;
}

.search-add > * {
  min-width: 0;
}

.search-add input,
.search-add select {
  width: 100%;
  min-width: 0;
}

.search-add button {
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.field span,
.field-head span {
  font-size: 0.84rem;
  font-weight: 600;
}

.ratio-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.ratio-head span:last-child {
  text-align: right;
}

.ratio-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.1rem 0.35rem;
  background: #fff;
}

#importanceRatio {
  accent-color: var(--accent);
  padding: 0;
}

.ratio-ticks {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  font-size: 0.74rem;
  color: var(--muted);
}

.ratio-ticks span:nth-child(2) {
  text-align: center;
}

.ratio-ticks span:nth-child(3) {
  text-align: right;
}

input,
select,
button {
  font: inherit;
  color: inherit;
  border-radius: 10px;
}

input,
select {
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.5rem 0.6rem;
}

button {
  border: none;
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 0.52rem 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

button.ghost {
  background: #fff;
  color: var(--danger);
  border: 1px solid #e6b9b9;
  font-weight: 600;
  padding: 0.34rem 0.6rem;
}

button.tiny {
  padding: 0.2rem 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.check-grid {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0.45rem;
  max-height: 11rem;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.18rem 0.25rem;
  border-radius: 8px;
}

.check-item:hover {
  background: #f3f8ef;
}

.check-item input {
  margin: 0;
}

.group-list {
  list-style: none;
  padding: 0;
  margin: 0.55rem 0 0;
  display: grid;
  gap: 0.42rem;
}

.group-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: flex-start;
  background: #fff;
}

.group-info {
  min-width: 0;
  width: 100%;
}

.group-title {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.1rem;
}

.group-item > button {
  flex-shrink: 0;
  padding: 0.24rem 0.46rem;
  border: 1px solid #f0c0c0;
  background: #fff;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 600;
}

.group-meta {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.1rem;
  word-break: break-word;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #e4eee0;
  vertical-align: top;
  font-size: 0.85rem;
}

th {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #35533f;
}

.add-from-rec {
  min-width: 3.3rem;
}

code {
  font-family: 'IBM Plex Mono', monospace;
}

.hint {
  color: var(--muted);
  margin: 0;
  font-size: 0.84rem;
}

.hint.small {
  margin-top: 0.5rem;
  font-size: 0.78rem;
}

.hint.tiny-text {
  font-size: 0.75rem;
}

.notes {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  display: grid;
  gap: 0.3rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 930px) {
  .grid.two-up {
    grid-template-columns: 1fr;
  }

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

  .search-add {
    grid-template-columns: 1fr;
  }
}
