/* SunRise — base styles (Arabic, RTL, mobile first) */
:root {
  --primary: #0f5e73;
  --primary-dark: #0a4656;
  --primary-soft: #e6f1f4;
  --accent: #e8833a;
  --accent-dark: #c96a24;
  --bg: #f3f5f7;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7785;
  --border: #dde3e8;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --success: #1e8449;
  --success-soft: #e8f6ee;
  --warning-soft: #fff6e5;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.ltr { direction: ltr; unicode-bidi: embed; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--primary);
  color: #fff;
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem 1rem;
}
.brand { color: #fff; font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .sun { color: #ffc56b; }
.nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.nav a {
  color: #dceef3; padding: .35rem .7rem; border-radius: 6px; white-space: nowrap;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.nav .badge { margin-inline-start: .25rem; }
.userbox { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.userbox a { color: #fff; }
.userbox form { margin: 0; }
.linkbtn {
  background: none; border: 1px solid rgba(255,255,255,.4); color: #fff;
  border-radius: 6px; padding: .25rem .6rem; cursor: pointer; font: inherit; font-size: .85rem;
}
.linkbtn:hover { background: rgba(255,255,255,.12); }
.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; }
  .menu-toggle { display: block; margin-inline-start: auto; }
  .nav, .userbox { display: none; width: 100%; }
  .topbar.open .nav, .topbar.open .userbox { display: flex; }
  .nav { flex-direction: column; flex: 0 0 100%; }
  .userbox { justify-content: space-between; padding: .4rem 0; border-top: 1px solid rgba(255,255,255,.2); }
}

/* ---------- layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem; margin-bottom: 1rem;
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- guest (auth) pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 1rem; }
.auth-logo .brand { color: var(--primary); font-size: 1.8rem; }
.auth-logo .brand .sun { color: var(--accent); }
.auth-logo p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.auth-links { text-align: center; margin-top: 1rem; font-size: .92rem; }
.auth-links a { margin: 0 .4rem; }

/* ---------- forms ---------- */
.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; padding: .55rem .7rem; font: inherit;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input.ltr-input { direction: ltr; text-align: left; }
input.code-input { direction: ltr; text-align: center; font-size: 1.6rem; letter-spacing: .5rem; font-weight: 700; }
.choices { display: flex; gap: .5rem; flex-wrap: wrap; }
.choice {
  flex: 1; min-width: 120px; border: 1px solid var(--border); border-radius: 8px;
  padding: .55rem .7rem; cursor: pointer; display: flex; gap: .45rem; align-items: center; background: #fff;
}
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.check { display: flex; gap: .45rem; align-items: center; cursor: pointer; }
.row-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.inline-form { display: inline; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  border: 1px solid transparent; border-radius: 8px; padding: .5rem 1rem;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-light { background: #fff; color: var(--text); border-color: var(--border); }
.btn-light:hover { background: #f1f4f6; }
.btn-danger { background: #fff; color: var(--danger); border-color: #efc2bd; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: .3rem .65rem; font-size: .85rem; }

/* ---------- alerts & badges ---------- */
.alert { border-radius: 8px; padding: .7rem .9rem; margin-bottom: 1rem; border: 1px solid; }
.alert ul { margin: 0; padding-inline-start: 1.1rem; }
.alert-error { background: var(--danger-soft); border-color: #f3c3bd; color: #8e2a1f; }
.alert-success { background: var(--success-soft); border-color: #bfe3cd; color: #17643a; }
.alert-info { background: var(--primary-soft); border-color: #c3dde4; color: var(--primary-dark); }
.badge {
  display: inline-block; min-width: 1.4rem; padding: 0 .45rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; text-align: center; line-height: 1.4rem;
  background: var(--accent); color: #fff;
}
.tag { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .8rem; background: #eef1f4; color: var(--muted); }
.tag-admin { background: #fde9dc; color: #a24f12; }
.tag-doctor { background: var(--primary-soft); color: var(--primary-dark); }
.tag-lab { background: #ede7f6; color: #5b3d99; }
.tag-off { background: var(--danger-soft); color: var(--danger); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; }
.table th { background: #f7f9fa; font-size: .85rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.table tr:hover td { background: #fafcfd; }
.table .actions { white-space: nowrap; text-align: left; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1rem; }
.tabs a { padding: .5rem 1rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; font-weight: 600; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.tabs a:hover { text-decoration: none; color: var(--primary); }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.toolbar .field { margin: 0; min-width: 150px; flex: 1; }
.toolbar .field label { font-size: .8rem; }

/* ---------- pending request card ---------- */
.request { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: #fff; margin-bottom: .75rem; }
.request-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.request-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.request-form select { width: auto; min-width: 140px; }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: .25rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; padding: 0; list-style: none; }
.pagination a, .pagination span { display: block; padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { color: #b8c1ca; }

/* ---------- audit values ---------- */
.kv { font-size: .82rem; margin: 0; padding: 0; list-style: none; }
.kv li { direction: ltr; text-align: left; }
.kv .old { color: var(--danger); text-decoration: line-through; }
.kv .new { color: var(--success); }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.stat { text-align: center; }
.stat .num { font-size: 1.8rem; font-weight: 700; color: var(--primary); }

/* ---------- patients ---------- */
.search-big { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-big input { font-size: 1.05rem; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.seg a { padding: .35rem .9rem; color: var(--muted); font-weight: 600; font-size: .9rem; }
.seg a.active { background: var(--primary); color: #fff; }
.seg a:hover { text-decoration: none; }
.pt-name { font-weight: 700; }
.bed { display: inline-block; min-width: 2.2rem; text-align: center; font-weight: 700; background: var(--primary-soft); color: var(--primary-dark); border-radius: 6px; padding: 0 .4rem; }
.sex-M { color: #1f5fa8; }
.sex-F { color: #b0417a; }
.status-in { background: var(--success-soft); color: var(--success); }
.status-out { background: #eef1f4; color: var(--muted); }
.pt-header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: start; }
.pt-header h1 { margin-bottom: .3rem; }
.pt-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--muted); }
.pt-meta strong { color: var(--text); }
.adm { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .75rem; background: #fff; }
.adm.open { border-inline-start: 4px solid var(--success); }
.adm.closed { border-inline-start: 4px solid #c5ced6; }
.adm-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: center; }
.adm-body { margin-top: .5rem; font-size: .92rem; }
.adm-body dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: 0; }
.adm-body dt { color: var(--muted); }
.adm-body dd { margin: 0; }
.adm-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; align-items: center; }
.adm-actions form { display: flex; gap: .4rem; align-items: center; margin: 0; flex-wrap: wrap; }
.adm-actions input[type=datetime-local] { width: auto; padding: .3rem .5rem; }
.dup-box { border: 1px solid #f0d49a; background: var(--warning-soft); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.dup-box ul { margin: .5rem 0; padding-inline-start: 1.2rem; }
.doctors-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .4rem; }
.section-title { font-size: 1rem; font-weight: 700; color: var(--primary); border-bottom: 1px solid var(--border); padding-bottom: .3rem; margin: 1.2rem 0 .8rem; }
.clinical { background: #fbfaf5; border-radius: 8px; padding: .5rem .7rem; white-space: pre-line; }

/* ---------- tests catalogue ---------- */
.group-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tests-table td, .tests-table th { padding: .4rem .55rem; }
.tests-table tr.inactive td { opacity: .55; }
.tag-calc { background: #fff1e0; color: #a15a12; }
.range-grid { display: grid; grid-template-columns: max-content 1fr 1fr; gap: .4rem .8rem; align-items: center; }
.range-grid input { max-width: 160px; }
.range-grid .head { font-size: .8rem; color: var(--muted); font-weight: 700; }
fieldset[disabled] { opacity: .65; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ---------- live search ---------- */
.live-results {
  position: absolute; top: calc(100% + 4px); inset-inline: 0; z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .14); max-height: 60vh; overflow-y: auto;
}
.live-item { display: grid; grid-template-columns: 1fr auto; gap: 0 .6rem; padding: .55rem .8rem; border-bottom: 1px solid #eef1f4; color: var(--text); }
.live-item:last-child { border-bottom: 0; }
.live-item:hover, .live-item.active { background: var(--primary-soft); text-decoration: none; }
.live-name { font-weight: 700; color: var(--primary-dark); }
.live-meta { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); }
.live-item .tag { align-self: center; }
.live-empty { padding: .8rem; color: var(--muted); text-align: center; }
.search-big .search-field { flex: 1; position: relative; }
.live-results.stale { opacity: .45; }

/* ---------- results entry ---------- */
.entry-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; flex-wrap: wrap; }
.entry-head input { max-width: 240px; }
.sample-box { border-color: #f0d49a; background: var(--warning-soft); }
.entry-group { padding: 0; }
.entry-group > summary { padding: .75rem 1rem; cursor: pointer; list-style: none; display: flex; gap: .4rem; align-items: center; }
.entry-group > summary::-webkit-details-marker { display: none; }
.entry-group > summary::before { content: '◂'; color: var(--muted); transition: transform .15s; }
.entry-group[open] > summary::before { transform: rotate(-90deg); }
.entry-group[open] > summary { border-bottom: 1px solid var(--border); }
.entry-rows { padding: .3rem .6rem; }
.entry-row {
  display: grid; grid-template-columns: minmax(140px, 1.3fr) minmax(120px, 1fr) minmax(110px, 1fr);
  gap: .2rem .7rem; align-items: center; padding: .35rem .4rem; border-radius: 8px;
}
.entry-row:nth-child(even) { background: #fafbfc; }
.entry-row.sub { padding-inline-start: 1.6rem; }
.entry-sub { font-weight: 700; color: var(--primary); padding: .5rem .4rem .2rem; }
.entry-label { display: flex; flex-direction: column; line-height: 1.25; }
.entry-label .ltr { text-align: right; }
.entry-input { display: flex; gap: .35rem; align-items: center; }
.entry-input input, .entry-input select { padding: .4rem .55rem; }
.entry-input .titre { max-width: 110px; }
.entry-flag { min-width: 1.1rem; font-weight: 800; font-size: 1.1rem; }
.entry-range { color: var(--text); text-align: left; }
.entry-error { grid-column: 1 / -1; color: var(--danger); font-size: .85rem; }
.entry-row.r-high input, .entry-row.r-high select { border-color: #e2a29a; background: #fff6f5; color: #b42318; font-weight: 700; }
.entry-row.r-low input, .entry-row.r-low select { border-color: #9dbbe0; background: #f3f8ff; color: #1d4ed8; font-weight: 700; }
.entry-row.r-crit input, .entry-row.r-crit select { border-color: #b42318; background: #b42318; color: #fff; font-weight: 700; }
.entry-row.r-abn input, .entry-row.r-abn select { border-color: #e9b27a; background: #fff7ed; color: #b45309; font-weight: 700; }
.entry-row.r-bad input { border-color: #7c3aed; background: #f5f3ff; }
.entry-row.r-high .entry-flag, .entry-row.r-crit .entry-flag { color: #b42318; }
.entry-row.r-low .entry-flag { color: #1d4ed8; }
.entry-row.r-abn .entry-flag { color: #b45309; }
.entry-row.r-bad .entry-flag { color: #7c3aed; }
.entry-bar {
  position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem 1rem;
  box-shadow: 0 -4px 14px rgba(16, 24, 40, .08); margin-top: 1rem;
}
@media (max-width: 600px) {
  .entry-row { grid-template-columns: 1fr 1fr; }
  .entry-range { grid-column: 1 / -1; text-align: right; margin-top: -.2rem; }
}

/* ---------- patient results table ---------- */
.rt-card { padding: 0; }
.rt-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .8rem 1rem; }
.rt-tools { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; padding: 0 1rem .7rem; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: .15rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--muted); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.rt-wrap { overflow: auto; max-height: 72vh; border-top: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
table.rt { border-collapse: separate; border-spacing: 0; font-size: .9rem; min-width: 100%; }
.rt th, .rt td { border-bottom: 1px solid #edf0f2; border-inline-start: 1px solid #f2f4f6; padding: .35rem .5rem; text-align: center; white-space: nowrap; }
.rt thead th { position: sticky; top: 0; z-index: 2; background: #f7f9fa; font-weight: 700; vertical-align: bottom; }
.rt thead th small { display: block; font-weight: 400; color: var(--muted); font-size: .68rem; }
.rt .rt-date { position: sticky; inset-inline-start: 0; z-index: 1; background: #fff; text-align: right; font-size: .82rem; box-shadow: -1px 0 0 var(--border) inset; }
.rt thead .rt-date { z-index: 3; background: #f7f9fa; }
.rt .rt-date a { color: var(--text); display: flex; flex-direction: column; line-height: 1.2; }
.rt .rt-time { color: var(--muted); font-size: .75rem; text-align: right; }
.rt td a { color: inherit; display: block; }
.rt td a:hover { text-decoration: none; background: rgba(15, 94, 115, .07); border-radius: 4px; }
.rt tbody tr:hover td { background: #fbfcfd; }
.rt tbody tr:hover td.rt-date { background: #f6f9fa; }
.r-high { color: #b42318; font-weight: 700; }
.r-low { color: #1d4ed8; font-weight: 700; }
.rt td.r-crit, span.r-crit { background: #b42318 !important; color: #fff; font-weight: 800; }
.r-abn { color: #b45309; font-weight: 700; }
.rt-comp { max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; }
.rt sup { color: var(--muted); font-weight: 400; }
.rt-mark td { font-size: .8rem; font-weight: 700; text-align: right; padding: .25rem .6rem; }
.rt-mark.admit td { background: #e6f1f4 !important; color: var(--primary-dark); }
.rt-mark.discharge td { background: #eef0f2 !important; color: #52606d; }
.rt-mark td[colspan] { position: sticky; inset-inline-start: 0; }
.rt-legend { display: flex; gap: 1rem; flex-wrap: wrap; padding: .6rem 1rem; border-top: 1px solid var(--border); align-items: center; }
.big-value { font-size: 2rem; font-weight: 800; margin-bottom: .6rem; text-align: right; }
.big-value small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.big-value.r-crit { background: #b42318; color: #fff; border-radius: 8px; padding: .2rem .7rem; display: inline-block; }
.big-value.r-crit small { color: #fde2df; }
.kv-list { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.kv-list dt { color: var(--muted); }
.kv-list dd { margin: 0; }

/* ---------- alerts (phase 5) ---------- */
.nav { order: 1; }
.bell { order: 2; position: relative; color: #fff; font-size: 1.15rem; padding: .2rem .45rem; border-radius: 6px; line-height: 1; }
.bell:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.bell .badge { position: absolute; top: -.35rem; inset-inline-end: -.45rem; background: var(--accent); color: #fff; font-size: .7rem; min-width: 1.2rem; text-align: center; }
.bell.has { animation: bell-pulse 2.5s ease-in-out 2; }
@keyframes bell-pulse { 0%, 100% { transform: none; } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } 50% { transform: none; } }
.userbox { order: 3; }
@media (max-width: 760px) {
  .bell { margin-inline-start: auto; order: 1; }
  .menu-toggle { order: 2; margin-inline-start: 0; }
  .nav { order: 3; }
  .userbox { order: 4; }
}
.nbadge { display: inline-block; white-space: nowrap; background: #fff1e0; color: #a15a12; border-radius: 999px; padding: .05rem .5rem; font-size: .8rem; font-weight: 700; }
.nbadge.crit { background: var(--danger); color: #fff; }
.notif-box { border-inline-start: 4px solid var(--accent); }
.notif-list { list-style: none; margin: .5rem 0; padding: 0; }
.notif-list li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.notif-list li:last-child { border-bottom: 0; }
.notif-type { display: inline-block; border-radius: 999px; padding: .05rem .55rem; font-size: .78rem; background: #eef1f4; color: var(--muted); white-space: nowrap; }
.notif-critical .notif-type, .notif-type.notif-critical { background: var(--danger); color: #fff; }
.notif-first_abnormal .notif-type, .notif-type.notif-first_abnormal { background: #fff1e0; color: #a15a12; }
.notif-egfr_drop .notif-type, .notif-type.notif-egfr_drop, .notif-change .notif-type, .notif-type.notif-change { background: var(--primary-soft); color: var(--primary-dark); }
.notif-critical a { color: var(--danger); font-weight: 700; }
tr.notif-unread td { background: #fffaf3; }
.rt td.r-new { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- backups (phase 6) ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; align-items: end; }
.form-grid .field { margin: 0; }
.ok-text { color: var(--success); }
.err-text { color: var(--danger); }
