:root {
  --bg:#f7f7f9;
  --card:#fff;
  --ink:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --ok:#0ea5e9;
}

* { box-sizing:border-box; }

body {
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font:14px/1.35 system-ui,Segoe UI,Roboto,Arial;
}
/* ===== CAPSTANAG HEADER + TOOL SELECTOR ===== */
.site-header{
  position:sticky;
  top:0;
  z-index:100;
  background:#000;
}

.header-inner{
  max-width:1100px;
  margin:0 auto;
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}

.brand-link{
  display:flex;
  align-items:center;
  text-decoration:none;
}

.brand-logo{
  height:34px;
  width:auto;
  display:block;
}

/* Tool navigation (RIGHT side) */
.tool-nav{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:14px;
  color:#e5e7eb;
}

.tool-label{
  opacity:0.9;
  font-weight:500;
  white-space:nowrap;
  margin-right:4px;
}

.tool-link{
  padding:5px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.35);
  color:#e5e7eb;
  text-decoration:none;
  font-size:13px;
  white-space:nowrap;
}

.tool-link:hover{
  background:rgba(255,255,255,0.12);
}

.tool-link.active{
  background:#ffffff;
  color:#000;
  border-color:#ffffff;
}

/* Mobile layout */
@media (max-width:720px){
  .header-inner{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }

  .tool-nav{
    flex-wrap:wrap;
    gap:8px;
  }
}


.wrap {
  max-width:980px;
  margin:24px auto;
  padding:0 12px;
}

h1 {
  margin:0 0 8px;
  font-size:20px;
}

.muted {
  color:var(--muted);
  font-size:12px;
}

.grid {
  display:grid;
  gap:12px;
}

.g2 { grid-template-columns:repeat(2,minmax(0,1fr)); }

@media (max-width:800px){
  .g2 { grid-template-columns:1fr; }
}

.card {
  background:var(--card);
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px;
}

label {
  display:block;
  font-weight:600;
  margin:8px 0 6px;
}

input, select, button {
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--ink);
  font:14px/1.3 inherit;
}

input[type="checkbox"],
input[type="radio"] {
  width:auto;
  padding:0;
}

.row {
  display:flex;
  gap:10px;
}
.row > * {
  flex:1;
}

.btn {
  cursor:pointer;
}
.btn.ok {
  background:var(--ok);
  color:#fff;
  border-color:var(--ok);
}

table {
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
th, td {
  padding:8px 10px;
  border-top:1px solid var(--line);
  text-align:left;
  vertical-align:top;
}

/* Rate table stacked & tight */
.rate-table {
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:13px;
}

.rate-table-row {
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr;
  gap:6px;
  align-items:center;
}


.rate-table-head {
  font-weight:600;
}

.rate-table-row input {
  width:100%;
  padding:6px 8px;
  font-size:13px;
}
.rate-table-row select {
  width:100%;
  padding:6px 8px;
  font-size:13px;
}


/* Pills for pattern quality */
.pill {
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
  border:1px solid var(--line);
}
.p-green {
  background:#ecfdf5;
  color:#065f46;
  border-color:#a7f3d0;
}
.p-yellow {
  background:#fffbeb;
  color:#7c2d12;
  border-color:#fde68a;
}
.p-red {
  background:#fef2f2;
  color:#7f1d1d;
  border-color:#fecaca;
}
.warn-banner {
  padding:8px 10px;
  border-radius:8px;
  background:#fef2f2;
  color:#7f1d1d;
  border:1px solid #fecaca;
  font-size:12px;
  margin-bottom:8px;
}
/* Target Droplet Table — color rows by RATE ROW */

.dsc-rate-1 { background: #fffbea; } /* very soft pastel yellow */
.dsc-rate-2 { background: #eef7ff; } /* very soft pastel blue   */
.dsc-rate-3 { background: #f0fbf0; } /* very soft pastel green  */

.dsc-rate-none { background: #fafafa; } /* neutral gray */

.dsc-colored td {
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;

}

/* Mobile-friendly behavior for droplet suggestions table */
#dropletSuggestions {
  overflow-x:auto;
}

#dropletSuggestions table {
  min-width:700px; /* wide enough for all columns; adjust if you want tighter */
}

/* Mobile layout fixes */
@media (max-width: 768px) {
  /* Stack 2-column grids into a single column on phones */
  .grid.g2 {
    grid-template-columns: 1fr;
  }
}

/* If content (tables) is wider than the card, allow horizontal scroll inside the card */
.card {
  overflow-x: auto;
}

