:root {
  --bg: #f4f6fb; /* Lighter background */
  --card: #ffffff; /* Light card */
  --text: #1c212a; /* Dark text */
  --muted: #5b6270; /* Muted text */
  --primary: #2a6ef2; /* Primary */
  --danger: #d0224b; /* Danger */
  --border: #e1e5ee; /* Subtle border */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1200px;
  padding: 32px 20px 60px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(17, 20, 31, 0.08);
}

.card__header h1 { margin: 0; font-size: 32px; font-weight: 700; }
.muted { color: var(--muted); margin-top: 6px; }

/* Fields overview */
.fields-overview { margin-top: 28px; }
.fields-overview > h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.fields-group {
  background: #f7f9fe;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.fields-group__title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.fields-group__badge {
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  background: var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.fields-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fields-list li { display: flex; align-items: baseline; gap: 6px; }
.field-name { font-size: 13px; font-weight: 500; white-space: nowrap; }
.field-desc { font-size: 12px; color: var(--muted); }

.form { margin-top: 16px; }
.form__row { display: grid; gap: 8px; margin-bottom: 14px; }
.label { font-weight: 500; }
.input {
  width: 100%;
  padding: 12px 12px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.input:focus { outline: none; border-color: #2a6ef2; box-shadow: 0 0 0 3px rgba(42,110,242,0.25); }

.form__actions { display: flex; gap: 10px; }
.btn {
  appearance: none;
  border: 1px solid #b5c1db; /* Stronger border to contrast on light bg */
  background: #f7f9fe;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(42,110,242,0.25); }
.btn--primary { background: linear-gradient(180deg, #3d6ae7, #2a6ef2); border-color: #2a6ef2; color: #fff; }

.hx-indicator {
  width: 12px; height: 12px; border-radius: 50%; margin-left: 8px; display: inline-block;
  background: transparent; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; animation: spin 1s linear infinite; opacity: 0;
}
.htmx-request .hx-indicator { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); margin: 12px 0; }
.alert--error { background: #ffe9ef; border-color: #ffc2d0; color: #941a36; }

.result { margin-top: 16px; }
.result__actions { display: flex; gap: 10px; margin-bottom: 12px; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.table thead th { position: sticky; top: 0; background: #eef2fb; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #1f2a44; color: #fff; padding: 10px 14px; border-radius: 10px; opacity: 0; transition: opacity .18s ease;
}
.toast.is-visible { opacity: 1; }

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: pre; /* Preserve tabs and newlines */
}


