/* ==========================================================================
   SIMPLEFUNCTIONS.HTML

   The same shape as rtm.html and facsimile.html: a settings panel on the
   left, a drag handle, and a work area of tabs. Colours are the tokens in
   kvot.css, so the page follows the theme toggle. Class prefix: sf-.
   ========================================================================== */

.sf {
  display: grid;
  grid-template-columns: var(--sf-side-width, 340px) 8px minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
  font-family: verdana, sans-serif;
  font-size: 13px;
}

/* ---- the settings column ------------------------------------------------ */
.sf-side {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
  background: var(--bg-surface);
}
.sf-side-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 14px 10px; }
.sf-side-foot {
  flex: 0 0 auto;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.sf-resize {
  cursor: col-resize;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: transparent;
  position: relative;
  z-index: 1;
}
.sf-resize::after { content: ''; width: 3px; border-radius: 2px; transition: background 0.15s; }
.sf-resize:hover::after, .sf-resize.active::after { background: var(--color-kvot-accent); }

/* ---- a folding section -------------------------------------------------- */
.sf-sec { margin: 0 0 4px; }
.sf-sec > summary {
  margin: 10px 0 6px;
  padding: 0 0 4px 16px;
  border-bottom: 1px solid var(--border-color);
  font: 700 0.95rem RawengulkSans, sans-serif;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  position: relative;
}
.sf-sec > summary::-webkit-details-marker { display: none; }
.sf-sec > summary::before {
  content: '▸';
  position: absolute;
  left: 0;
  transition: transform 0.15s;
  color: var(--text-muted);
}
.sf-sec[open] > summary::before { transform: rotate(90deg); }
.sf-sec > summary .sf-count {
  float: right;
  font: 11px verdana, sans-serif;
  color: var(--text-muted);
}
.sf-about { margin: 0 0 8px; font-size: 11px; line-height: 1.5; color: var(--text-muted); }

/* ---- a labelled control ------------------------------------------------- */
.sf-row { display: block; margin: 0 0 8px; }
.sf-row[hidden] { display: none; }
.sf-row label { display: block; margin: 0 0 2px; color: var(--text-primary); }
.sf-row .sf-name, .sf-check .sf-name {
  display: block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.sf-row input, .sf-row select, .sf-row textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 3px 5px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.sf-row textarea { min-height: 80px; resize: vertical; }
.sf-row input.changed, .sf-row select.changed { border-color: var(--color-kvot-bright); }
.sf-row input:invalid { border-color: var(--color-kvot-accent); }
.sf-unit { color: var(--text-muted); font-size: 11px; margin-left: 4px; }
.sf-check { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 6px; cursor: pointer; line-height: 1.35; }
.sf-check[hidden] { display: none; }
.sf-check input { margin-top: 2px; }
.sf-check.changed > span { text-decoration: underline; text-decoration-color: var(--color-kvot-bright); text-underline-offset: 3px; }
.sf-desc { display: block; font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.sf-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sf-muted { color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.sf-muted[hidden] { display: none; }
.sf-warn { color: var(--text-primary); font-size: 11px; line-height: 1.5; border-left: 3px solid var(--color-kvot-bright); padding-left: 6px; margin: 4px 0; }

/* ---- the hydro file list ------------------------------------------------ */
.sf-drop {
  border: 1px dashed var(--input-border);
  border-radius: 6px;
  padding: 8px;
  margin: 0 0 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
}
.sf-drop.over { border-color: var(--color-kvot-accent); background: var(--bg-secondary); color: var(--text-primary); }
.sf-files { list-style: none; margin: 0 0 8px; padding: 0; }
.sf-files li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 5px 6px;
  margin: 0 0 4px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  font-size: 11px;
}
.sf-files .sf-file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-files .sf-file-meta { grid-column: 1 / -1; color: var(--text-muted); }
.sf-files .sf-file-warn { grid-column: 1 / -1; color: var(--text-primary); border-left: 3px solid var(--color-kvot-bright); padding-left: 6px; }
.sf-files button { padding: 0 6px; border: 0; background: none; color: var(--text-muted); font-size: 14px; cursor: pointer; line-height: 1; }
.sf-files button:hover { color: var(--color-kvot-accent); }
.sf-files:empty::after { content: 'No hydro data yet.'; display: block; color: var(--text-muted); font-size: 11px; padding: 2px 0 6px; }

/* ---- buttons ------------------------------------------------------------ */
.sf-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 6px; }
.sf-btn {
  padding: 5px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent-fill);
  color: #fff;
  font: 600 12px verdana, sans-serif;
  cursor: pointer;
}
.sf-btn.secondary { background: var(--bg-primary); color: var(--text-primary); border-color: var(--border-color); }
.sf-btn.small { padding: 3px 8px; font-size: 11px; font-weight: 400; }
.sf-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sf-btn:focus-visible { outline: 2px solid var(--color-kvot-bright); outline-offset: 1px; }

/* The status well under the buttons: fixed height, scrolls, so the buttons
   above it do not move when the message changes length. */
.sf-status {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  height: 4.35em;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}
.sf-status.ok { border-color: var(--accent-success); }
.sf-status.error { border-color: var(--color-kvot-accent); color: var(--text-primary); }
.sf-status.warn { border-color: var(--color-kvot-bright); color: var(--text-primary); }

/* ---- the work area ------------------------------------------------------ */
.sf-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  margin-left: -8px;
  padding-left: 8px;
}
.sf-tabs {
  display: flex;
  gap: 2px;
  margin-left: -8px;
  padding: 6px 10px 0 18px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex: 0 0 auto;
  overflow-x: auto;
}
.sf-tabs button {
  padding: 6px 12px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--text-secondary);
  font: 12px verdana, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.sf-tabs button:hover { color: var(--text-primary); }
.sf-tabs button.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-color);
  font-weight: 600;
  margin-bottom: -1px;
}
.sf-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 14px;
  background: var(--bg-primary);
}
.sf-pane[hidden] { display: none; }

.sf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
  font-size: 12px;
}
.sf-toolbar label { display: flex; gap: 5px; align-items: center; }
.sf-toolbar label[hidden] { display: none; }
.sf-toolbar input[type="text"], .sf-toolbar select {
  padding: 2px 5px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.sf-toolbar .sf-spacer { flex: 1 1 auto; }

/* ---- charts and the empty state ----------------------------------------- */
.plot { width: 100%; height: 460px; }
.plot[hidden] { display: none; }
.sf-empty { margin: 0; padding: 24px 12px 40px; color: var(--text-muted); font-size: 12px; }
.sf-empty[hidden] { display: none; }

/* ---- tables ------------------------------------------------------------- */
.sf-table-wrap { overflow: auto; max-width: 100%; }
.sf-table {
  border-collapse: collapse;
  font-size: 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  white-space: nowrap;
}
.sf-table th, .sf-table td {
  padding: 3px 10px 3px 6px;
  text-align: right;
  border-bottom: 1px solid var(--table-border);
}
.sf-table th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  cursor: pointer;
  user-select: none;
  z-index: 1;
}
.sf-table th.sorted::after { content: ' ▾'; color: var(--color-kvot-accent); }
.sf-table th.sorted.asc::after { content: ' ▴'; }
.sf-table th:first-child, .sf-table td:first-child { text-align: left; }
.sf-table td.text, .sf-table th.text { text-align: left; }
.sf-table tbody tr:nth-child(even) { background: var(--table-stripe); }
.sf-table tbody tr:hover { background: var(--bg-surface); }
.sf-table td.flag { color: var(--color-kvot-accent); }
.sf-table td.dim { color: var(--text-muted); }

/* The key-output table on the summary tab. */
.sf-key { border-collapse: collapse; font-size: 12px; margin: 0 0 14px; }
.sf-key th, .sf-key td { padding: 4px 14px 4px 0; border-bottom: 1px solid var(--table-border); vertical-align: top; }
.sf-key th { text-align: left; font-weight: 600; color: var(--text-primary); }
.sf-key td { text-align: right; font-family: ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; }
.sf-key td.text { text-align: left; font-family: verdana, sans-serif; }
.sf-key thead th { text-align: right; color: var(--text-secondary); font-weight: 400; font-size: 11px; }
.sf-key thead th:first-child { text-align: left; }
.sf-key tr.total td, .sf-key tr.total th { font-weight: 700; }
.sf-key .sf-desc { font-weight: 400; max-width: 34em; white-space: normal; }
.sf-summary h3 { margin: 14px 0 6px; font: 700 1rem RawengulkSans, sans-serif; color: var(--text-primary); }
.sf-summary h3:first-child { margin-top: 2px; }
.sf-summary .sf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0 0 14px; }
.sf-card {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface);
}
.sf-card .sf-card-value { font: 700 1.35rem ui-monospace, Menlo, Consolas, monospace; color: var(--text-primary); }
.sf-card .sf-card-label { font-size: 11px; color: var(--text-secondary); line-height: 1.4; margin-top: 2px; }
.sf-settings-list { font-size: 12px; line-height: 1.6; columns: 2; column-gap: 28px; margin: 0; padding: 0; list-style: none; }
.sf-settings-list li { break-inside: avoid; }
.sf-settings-list code { font-size: 11px; color: var(--text-secondary); }
@media (max-width: 900px) { .sf-settings-list { columns: 1; } }

/* ---- help --------------------------------------------------------------- */
.sf-help { max-width: 64rem; line-height: 1.65; }
.sf-help h2 { margin: 4px 0 10px; font: 700 1.3rem RawengulkSans, sans-serif; color: var(--text-primary); }
.sf-help h3 { margin: 22px 0 6px; font: 700 1.05rem RawengulkSans, sans-serif; color: var(--text-primary); }
.sf-help h4 { margin: 16px 0 4px; font: 700 0.95rem verdana, sans-serif; color: var(--color-kvot-accent); }
.sf-help p { margin: 0 0 10px; }
.sf-help pre {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
}
.sf-help code { padding: 1px 4px; border-radius: 3px; background: var(--code-bg); font-size: 0.92em; }
.sf-help pre code { padding: 0; background: none; }
.sf-help .sf-eq {
  margin: 4px 0 12px 1.5em;
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.05em;
  line-height: 1.8;
}
.sf-help .sf-eq i { font-style: italic; }
.sf-help table.sf-ref { border-collapse: collapse; margin: 4px 0 14px; font-size: 12px; }
.sf-help table.sf-ref td, .sf-help table.sf-ref th {
  padding: 4px 16px 4px 0;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle, rgba(128, 128, 128, 0.25));
}
.sf-help table.sf-ref th { font-weight: 600; }
.sf-help table.sf-ref code { white-space: nowrap; }

/* ---- narrow screens ----------------------------------------------------- */
@media (max-width: 760px) {
  .sf { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow: auto; }
  .sf-side { height: auto; max-height: 50vh; border-right: 0; border-bottom: 1px solid var(--border-color); }
  .sf-resize { display: none; }
  .sf-main { margin-left: 0; padding-left: 0; }
  .sf-tabs { margin-left: 0; padding-left: 10px; }
  .plot { height: 360px; }
}

/* ==========================================================================
   What this page adds to the shared layout
   ========================================================================== */

/* A section heading with a count and an (i) on the right. */
.sf-sec > summary { display: flex; align-items: center; gap: 6px; }
.sf-sec > summary .sf-sec-title { flex: 1 1 auto; }
.sf-sec > summary .sf-count { float: none; order: 2; }
.sf-sec > summary .sf-info-slot { order: 3; }
.sf-label-line { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; }
.sf-label-line label { flex: 1 1 auto; margin: 0; }
.sf-check-line { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 6px; }
.sf-check-line .sf-check { flex: 1 1 auto; margin: 0; }
.sf-check.inline { display: inline-flex; margin: 0; align-items: center; }
.sf-check.inline input { margin-top: 0; }
.sf-info-slot { display: inline-flex; flex: none; }
.sf-info-slot:empty { display: none; }

/* ---- the (i) and its panel (the Kompartment pattern) ------------------- */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 17px;
  height: 17px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  vertical-align: middle;
}
.info-btn:hover { color: var(--color-kvot-accent); background: color-mix(in oklab, var(--color-kvot-accent) 12%, transparent); }
.info-btn.is-open { color: #fff; background: var(--accent-fill); }
.info-btn:focus-visible { outline: 2px solid var(--color-kvot-bright); outline-offset: 1px; }
.info-btn svg { display: block; }
.info-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 24px));
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 28px var(--shadow-color);
  animation: sf-info-in 140ms ease-out;
  font-family: verdana, sans-serif;
}
@keyframes sf-info-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .info-panel { animation: none; } }
.info-panel-head { display: flex; align-items: flex-start; gap: 8px; padding: 12px 10px 10px 16px; border-bottom: 1px solid var(--border-color); }
.info-panel-heading { flex: 1; min-width: 0; }
.info-panel-kicker { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.info-panel-title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--text-primary); }
.info-panel-close { flex: none; width: 28px; height: 28px; padding: 0; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--text-secondary); cursor: pointer; }
.info-panel-close:hover { color: var(--text-primary); }
.info-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 20px; font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); outline: none; }
.info-panel-body p { margin: 0 0 10px; }
.info-panel-body .info-lead { color: var(--text-primary); }
.info-panel-body h3 { margin: 16px 0 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.info-panel-body ul { margin: 0 0 10px; padding-left: 18px; }
.info-panel-body li { margin-bottom: 5px; }
.info-panel-body code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; padding: 0 3px; border-radius: 3px; background: var(--code-bg); color: var(--text-primary); }
.info-panel-body b { color: var(--text-primary); font-weight: 600; }
.info-facts { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 3px 12px; margin: 0 0 10px; }
.info-facts dt { color: var(--text-muted); }
.info-facts dd { margin: 0; color: var(--text-primary); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; overflow-wrap: anywhere; }
.info-choices dt { margin-top: 6px; color: var(--text-primary); font-weight: 600; }
.info-choices dt.is-current::after { content: ' · chosen'; font-weight: 400; color: var(--color-kvot-accent); }
.info-choices dd { margin: 0 0 4px 0; }
.info-panel-more-line { margin: 16px 0 0; padding-top: 10px; border-top: 1px solid var(--border-color); }
.info-panel-more { padding: 0; border: 0; background: none; font: inherit; font-size: 12px; text-align: left; color: var(--link-color); cursor: pointer; }
.info-panel-more:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---- the run's progress ------------------------------------------------- */
.sf-progress { height: 4px; margin: 6px 0 0; border-radius: 2px; background: var(--border-color); overflow: hidden; }
.sf-progress[hidden] { display: none; }
.sf-progress-bar { height: 100%; width: 0; background: var(--color-kvot-accent); transition: width 0.1s linear; }

/* ---- summary ------------------------------------------------------------ */
.sf-summary .sf-el-table td.phase { text-align: left; font-family: verdana, sans-serif; font-size: 11px; white-space: normal; min-width: 14em; }
.sf-phasebar { display: flex; height: 10px; min-width: 120px; border-radius: 2px; overflow: hidden; margin-top: 3px; background: var(--border-color); }
.sf-phasebar span { display: block; height: 100%; }
.sf-legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.sf-warnings { margin: 0 0 12px; padding: 0; list-style: none; }
.sf-warnings li { font-size: 12px; line-height: 1.5; border-left: 3px solid var(--color-kvot-bright); padding: 2px 0 2px 8px; margin: 0 0 4px; }
.sf-table td.el, .sf-table th.el { font-family: verdana, sans-serif; font-weight: 600; }
.sf-table tr.clickable { cursor: pointer; }
.sf-table tr.selected { background: color-mix(in oklab, var(--color-kvot-bright) 25%, transparent) !important; }
.plot.tall { height: 720px; }
.plot.short { height: 340px; }

/* ---- one water ---------------------------------------------------------- */
.sf-water-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px 10px; margin: 0 0 12px; max-width: 64rem; }
.sf-water-form label { display: block; font-size: 11px; color: var(--text-secondary); }
.sf-water-form input { box-sizing: border-box; width: 100%; padding: 3px 5px; border: 1px solid var(--input-border); border-radius: 4px; font: 12px ui-monospace, Menlo, Consolas, monospace; }
.sf-water-form input.changed { border-color: var(--color-kvot-bright); }
.sf-water-form input:disabled { opacity: 0.55; }
.sf-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .sf-two { grid-template-columns: 1fr; } }
.sf-detail { border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 12px 10px; background: var(--bg-surface); }
.sf-detail h4 { margin: 2px 0 8px; font: 700 0.95rem RawengulkSans, sans-serif; color: var(--text-primary); }
.sf-detail .sf-table { width: 100%; }
.sf-bar { display: inline-block; height: 8px; background: var(--color-kvot-accent); border-radius: 1px; vertical-align: 0; }
.sf-bar.alt { background: var(--accent-line); }

/* ---- data editor -------------------------------------------------------- */
.sf-data-table input[type="text"] { box-sizing: border-box; width: 100%; padding: 2px 4px; border: 1px solid transparent; border-radius: 3px; background: transparent; font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--text-primary); }
.sf-data-table input[type="text"]:hover { border-color: var(--border-color); }
.sf-data-table input[type="text"]:focus { border-color: var(--input-border); background: var(--input-bg); }
.sf-data-table input.num { width: 6.5em; text-align: right; }
.sf-data-table input.rx, .sf-data-table input.name { width: auto; }
.sf-data-table input.changed { border-color: var(--color-kvot-bright); }
.sf-data-table td.kind { color: var(--text-muted); font-family: verdana, sans-serif; font-size: 11px; }
.sf-data-table td.derived { color: var(--text-secondary); font-size: 11px; }
.sf-data-table td.flagged { color: var(--color-kvot-accent); }
.sf-data-table tr.group td { background: var(--bg-secondary); font: 600 12px verdana, sans-serif; color: var(--text-primary); text-align: left; }
.sf-data-table button.del { padding: 0 6px; border: 0; background: none; color: var(--text-muted); font-size: 14px; cursor: pointer; }
.sf-data-table button.del:hover { color: var(--color-kvot-accent); }
.sf-issues { margin: 0 0 10px; padding: 0; list-style: none; }
.sf-issues li { font-size: 12px; line-height: 1.5; border-left: 3px solid var(--color-kvot-accent); padding: 2px 0 2px 8px; margin: 0 0 4px; }
.sf-issues li.warn { border-left-color: var(--color-kvot-bright); }

/* ---- help --------------------------------------------------------------- */
.sf-help table.sf-ref td:nth-child(3) { color: var(--text-muted); font-size: 11px; }
.sf-help ul { margin: 0 0 10px; padding-left: 20px; }
.sf-help li { margin: 0 0 6px; }
.sf-build { margin-top: 24px; padding-top: 8px; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 11px; }
.sf-h4 { margin: 2px 0 8px; font: 700 0.95rem RawengulkSans, sans-serif; color: var(--text-primary); }

.sf-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 22px; margin: 0 0 12px; max-width: 80rem; font-size: 12px; }
.sf-kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--table-border); }
.sf-kv b { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.sf-kv span { font-family: ui-monospace, Menlo, Consolas, monospace; text-align: right; color: var(--text-secondary); }
.sf-water-table td.text { font-family: verdana, sans-serif; font-size: 11px; }
.sf-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 8px; align-items: start; }
