/* Studyflow planner — hi-fi card (Observable + CSS + Quarto).
   Pairs with planner.qmd. Reuses --bp-mono from planner.css if present. */

.sf-card {
  --ac: #2f6f98;
  max-width: 760px;
  margin: 1.4rem 0;
  background: #fff;
  border: 1px solid #e7e9ec;
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(14, 34, 51, .10);
  overflow: hidden;
  color: #1f2123;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.sf-mono { font-family: var(--bp-mono, ui-monospace, "IBM Plex Mono", monospace); }

/* editable input + presets (live planner) */
.sf-input { display: block; width: 100%; max-width: 760px; box-sizing: border-box; margin-top: 7px; padding: 11px 13px; border: 1px solid #e1e4e8; border-radius: 10px; background: #fff; color: #1f2123; font-family: var(--bp-mono, ui-monospace, "IBM Plex Mono", monospace); font-size: 13px; line-height: 1.5; resize: none; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; }
.sf-input:focus { outline: none; border-color: #2f6f98; box-shadow: 0 0 0 3px rgba(47, 111, 152, .14); }
.sf-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; max-width: 760px; }
.sf-preset { font: 500 11px var(--bp-mono, ui-monospace, "IBM Plex Mono", monospace); border: 1px solid #e1e4e8; background: #fff; border-radius: 999px; padding: 3px 10px; cursor: pointer; color: #6b7075; }
.sf-preset:hover { border-color: #2f6f98; color: #2f6f98; }

/* header */
.sf-bar { display: flex; align-items: center; gap: 11px; padding: 17px 22px; border-bottom: 1px solid #f0f1f3; }
.sf-badge { font: 600 11px var(--bp-mono, ui-monospace, "IBM Plex Mono", monospace); color: var(--ac); background: #eef5f9; border: 1px solid #d8e6ef; border-radius: 6px; padding: 3px 8px; }
.sf-title { font: 600 14px system-ui; letter-spacing: -.01em; color: #1f2123; }
.sf-path { margin-left: auto; font: 400 11px var(--bp-mono, ui-monospace, "IBM Plex Mono", monospace); color: #b5babf; }

.sf-body { padding: 20px 22px 22px; }

/* query + download */
.sf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.sf-label { font: 600 9px system-ui; letter-spacing: .1em; text-transform: uppercase; color: #9aa0a6; }
.sf-query { margin-top: 7px; border: 1px solid #e1e4e8; border-radius: 10px; padding: 11px 13px; background: #fbfcfd; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-family: var(--bp-mono, ui-monospace, "IBM Plex Mono", monospace); font-size: 12.5px; line-height: 1.5; }
.q-scheme { color: #9aa0a6; }
.q-sep { color: #cfd3d7; }
.q-subj { color: var(--ac); font-weight: 600; }
.q-term { background: #e9f1f6; color: var(--ac); border-radius: 4px; padding: 1px 5px; }
.q-qual { background: #f1f4f6; color: #6b7075; border-radius: 4px; padding: 1px 5px; }
.q-coord { background: #fdf3e3; color: #9a6b1f; border-radius: 4px; padding: 1px 5px; }
.sf-goal { margin-top: 9px; font: 400 12px system-ui; color: #6b7075; }

/* resolved-query status chips */
.sf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.sf-chip { font: 500 11px var(--bp-mono, ui-monospace, "IBM Plex Mono", monospace); border: 1px solid #e1e4e8; border-radius: 6px; padding: 2px 7px; background: #fff; color: #1f2123; white-space: nowrap; }
.sf-chip i { font-style: normal; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; color: #9aa0a6; margin-right: 5px; }
.sf-chip.s-resolved { border-color: #d8e6ef; background: #f4f9fc; color: #2f6f98; }
.sf-chip.s-wildcard { border-style: dashed; border-color: #2f6f98; color: #2f6f98; }
.sf-chip.s-unresolved, .sf-chip.s-unknown { border-color: #e7d49b; background: #fdf8ec; color: #9a6b1f; }
.sf-dl { flex: none; display: inline-flex; align-items: center; gap: 7px; font: 600 12px system-ui; color: #fff; background: var(--ac); border-radius: 9px; padding: 10px 15px; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 2px rgba(47, 111, 152, .35); }
.sf-dl:hover { background: #2a6189; }

/* controls: cache switch + metrics */
.sf-controls { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid #f0f1f3; }
.sf-cache-row { display: inline-flex; align-items: center; gap: 9px; }
.sf-switch { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #cfd3d7; display: inline-block; cursor: pointer; transition: background .15s; }
.sf-switch.is-on { background: var(--ac); }
.sf-switch-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .15s; }
.sf-switch.is-on .sf-switch-knob { left: 20px; }
.sf-switch:focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; }
.sf-cache-k { font: 600 13px system-ui; color: #1f2123; }
.sf-state { font: 600 11px system-ui; border-radius: 5px; padding: 2px 7px; }
.sf-state.is-on { color: var(--ac); background: #eef5f9; }
.sf-state.is-off { color: #9aa0a6; background: #f1f2f4; }
.sf-cache-cap { font: 400 11px system-ui; color: #9aa0a6; margin-top: 5px; }
.sf-metrics { text-align: right; }
.sf-metrics-row { display: flex; align-items: baseline; gap: 14px; justify-content: flex-end; font: 400 12px system-ui; color: #6b7075; }
.sf-metrics-row b { font-weight: 700; color: #1f2123; }
.sf-metrics-row b.ac { color: var(--ac); }
.sf-metrics-row .mut { color: #b5babf; }
.sf-meter { width: 210px; height: 4px; border-radius: 2px; background: #eef0f2; margin-top: 7px; margin-left: auto; overflow: hidden; }
.sf-meter-fill { height: 100%; background: var(--ac); border-radius: 2px; }

/* plan table */
.sf-plan { margin-top: 18px; border: 1px solid #eceef0; border-radius: 10px; overflow: hidden; }
.sf-row { display: grid; grid-template-columns: 34px 1.15fr 58px 1fr 1.5fr 1.15fr 62px; align-items: center; }
.sf-row + .sf-row { border-top: 1px solid #f3f4f6; }
.sf-row.sf-h { background: #fafbfc; }
.sf-row.sf-h > div { padding: 9px 10px; font: 600 9px system-ui; letter-spacing: .07em; text-transform: uppercase; color: #9aa0a6; }
.sf-row.sf-h .sf-cost-h { text-align: right; }
.sf-row > div { padding: 8px 10px; }
.sf-c-n { font: 400 12px system-ui; color: #9aa0a6; }
.sf-c-op { font-size: 12px; color: var(--ac); }
.sf-c-mut { font-size: 11px; color: #8a8f94; }
.sf-reused { opacity: .5; }
.sf-run { box-shadow: inset 2px 0 0 var(--ac); }
.sf-run .sf-c-op { font-weight: 500; color: var(--ac); }
.sf-run .sf-c-mut { color: #6b7075; }
.sf-pill { display: inline-block; font: 600 9px system-ui; letter-spacing: .03em; text-transform: uppercase; border-radius: 5px; padding: 2px 6px; }
.sf-pill-m { background: #e9f1f6; color: var(--ac); }
.sf-pill-w { background: #fdf3e3; color: #9a6b1f; }
.sf-pill-r { background: #eef0e9; color: #5d6b3f; }
.sf-cost { padding: 8px 10px; }
.sf-cost-n { font: 600 12px system-ui; color: #1f2123; text-align: right; }
.sf-reused .sf-cost-n { color: #3a3d40; }
.sf-cost-bar { height: 3px; border-radius: 2px; background: #eef0f2; margin-top: 4px; overflow: hidden; }
.sf-cost-fill { height: 100%; border-radius: 2px; }
.sf-cost-fill.is-ac { background: var(--ac); }
.sf-cost-fill.is-mut { background: #c4c8cd; }

/* reused / run split divider */
.sf-split { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: #fbfcfd; border-top: 1px solid #eceef0; border-bottom: 1px solid #eceef0; }
.sf-split-l { font: 500 10px system-ui; color: #b5babf; }
.sf-split-r { font: 600 10px system-ui; letter-spacing: .04em; text-transform: uppercase; color: var(--ac); }

/* target + notes + error */
.sf-target { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.sf-target-k { font: 600 9px system-ui; letter-spacing: .08em; text-transform: uppercase; color: #9aa0a6; }
.sf-target .sf-mono { font-size: 11px; color: #6b7075; }
.sf-notes { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.sf-note-li { font: 400 11px system-ui; color: #9aa0a6; padding-left: 14px; position: relative; }
.sf-note-li::before { content: "•"; position: absolute; left: 3px; color: #cfd3d7; }
.sf-err { margin-top: 4px; border: 1px solid #e6c0c0; background: #fdf4f4; color: #9a3b3b; border-radius: 10px; padding: 11px 13px; font: 400 13px system-ui; }

/* footer */
.sf-foot { margin-top: 14px; font: 400 11px system-ui; color: #9aa0a6; }
.sf-foot .sf-mono { color: #6b7075; }
