/* Wah-Kit Flowcharts: the editor and the shared view. Uses the panels and buttons in meds.css and site.css. */
main.wrap:has(> #flow) { max-width: min(1600px, 100%); }
.md.fc-page { max-width: none; gap: 10px; }
.fc-listhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fc-listhead h2 { margin: 0; font: 800 21px var(--font-display); }
.fc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fc-card { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.fc-card:hover { border-color: var(--ink-soft); }
.fc-card div { display: flex; flex-direction: column; min-width: 0; } .fc-card b { font-size: 16px; } .fc-card small { color: var(--ink-soft); }
.fc-ic { font-size: 28px; }
.fc-h3 { margin: 8px 0 0; font: 800 16px var(--font-display); }
.fc-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.fc-tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.fc-tpl:hover { border-color: var(--blue); }
.fc-tpl span { font-size: 22px; } .fc-tpl b { font-size: 14.5px; } .fc-tpl small { color: var(--muted); font-size: 12.5px; }
.fc-tpl.blank { border-style: dashed; }

/* editor */
.fc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fc-title { flex: 1; min-width: 160px; font: 800 20px var(--font-display); border: 1px solid transparent; border-radius: 10px; padding: 6px 8px; background: transparent; color: var(--ink); }
.fc-title:hover, .fc-title:focus { border-color: var(--line); background: #fff; outline: none; }
.fc-saved { font-size: 13px; font-weight: 700; color: #15803D; } .fc-saved.busy { color: var(--muted); }
.fc-shapes { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.fc-shape { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: grab; font: 600 13px var(--font-body); color: var(--ink); touch-action: none; user-select: none; }
.fc-shape:hover { border-color: var(--blue); }
.fc-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fc-tools .btn, .fc-ctx .btn { min-height: 36px; padding: 0 11px; font-size: 14px; }
.fc-tools .btn[disabled] { opacity: .4; }
.fc-gap { flex: 1; }
.fc-pct { min-width: 64px; }
.fc-ctx { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 40px; padding: 4px 8px; border-radius: 12px; background: #F8F8FB; border: 1px solid var(--line); font-size: 14px; }
.fc-ctx select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; font: 14px var(--font-body); background: #fff; }
.fc-lab { min-height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: 14px var(--font-body); width: 200px; max-width: 45vw; }
.fc-sw { display: flex; gap: 4px; flex-wrap: wrap; }
.fc-sw button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid; cursor: pointer; padding: 0; }
.fc-sw button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.fc-editing .page-intro { display: none; }
.fc-editing main.wrap { padding-top: 12px; }
.fc-stage { position: relative; height: calc(100vh - 290px); min-height: 380px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; outline: none;
  background-color: #FCFCFE; background-image: radial-gradient(circle, #D9D9E5 1px, transparent 1.2px); }
.fc-stage.can-pan, .fc-stage.panning { cursor: grab; }
.fc-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.fc-svg .fn { cursor: move; }
.fc-svg .fn.sel path { stroke: #1F5FD1; stroke-width: 3; filter: drop-shadow(0 0 4px rgba(31, 95, 209, .35)); }
.fc-svg .fn.drop path { stroke: #16A34A; stroke-width: 3.5; }
.fc-svg .fe { cursor: pointer; }
.fc-svg .fe:hover path:not(.hit) { stroke: #1F5FD1; }
.fc-dot { fill: #fff; stroke: #1F5FD1; cursor: crosshair; }
.fc-dot:hover { fill: #1F5FD1; }
.fc-plus { cursor: pointer; }
.fc-plus circle { fill: #1F5FD1; opacity: .9; }
.fc-plus path { stroke: #fff; }
.fc-plus:hover circle { opacity: 1; fill: #16A34A; }
.fc-guide { stroke: #DB2777; stroke-dasharray: 4 3; }
.fc-marq { fill: rgba(31, 95, 209, .08); stroke: #1F5FD1; stroke-dasharray: 4 3; }
.fc-tmp { fill: none; stroke: #1F5FD1; stroke-dasharray: 6 4; pointer-events: none; }
.fc-guide, .fc-marq { pointer-events: none; }
.fc-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(29, 26, 57, .85); color: #fff; font-size: 13px; padding: 7px 12px; border-radius: 999px; pointer-events: none; text-align: center; max-width: 92%; }
.fc-edit { position: absolute; z-index: 5; box-sizing: border-box; border: 2px solid #1F5FD1; border-radius: 8px; padding: 6px; resize: none; text-align: center; font-family: 'Segoe UI', Arial, sans-serif; line-height: 1.3; background: rgba(255, 255, 255, .97); color: #1D1A39; outline: none; }
.fc-ghost { position: fixed; z-index: 300; pointer-events: none; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #fff; border: 2px solid #1F5FD1; border-radius: 10px; font: 700 13px var(--font-body); box-shadow: 0 8px 20px rgba(0, 0, 0, .2); }
.fc-menu { position: absolute; z-index: 150; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); padding: 5px; display: flex; flex-direction: column; min-width: 230px; }
.fc-menu button { border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 8px; font: 14.5px var(--font-body); color: var(--ink); cursor: pointer; }
.fc-menu button:hover { background: #F1F1F7; }
#fc-flash:empty { display: none; }
@media (max-width: 720px) {
  .fc-shape span { display: none; }
  .fc-shape { padding: 0 8px; }
  .fc-stage { min-height: 300px; }
  .fc-top .btn { min-height: 38px; padding: 0 10px; font-size: 14px; }
  .fc-top { flex-wrap: nowrap; gap: 5px; }
  .fc-title { font-size: 16px; min-width: 0; padding: 4px; }
  .fc-saved { display: none; }
  .fc-ctx { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .fc-ctx > * { flex: none; }
  .fc-sw { flex-wrap: nowrap; }
  .fc-sw button { width: 22px; height: 22px; }
  .fc-tools .btn, .fc-ctx .btn { min-height: 34px; padding: 0 9px; }
  .fc-shape { min-height: 36px; }
  .fc-stage { height: calc(100vh - 270px); }
}

/* the shared view */
body.fc-view { background: var(--ground); }
#fcv { max-width: 1200px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.fc-load { text-align: center; color: var(--muted); padding: 40px; }
.fc-vt { margin: 0; font: 800 24px var(--font-display); }
.fc-vbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.fc-vnote { margin: 0; font-size: 14px; color: #15803D; min-height: 1em; }
.fc-vbox { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; overflow: auto; }
.fc-vsvg { display: block; width: 100%; height: auto; max-height: 80vh; }
.fc-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 24px; }
