@font-face {
  font-family: "Flow Symbols";
  src: url("./flow-icons.ttf") format("truetype");
  font-display: block;
}
.f-icon {
  font: 400 20px/1 "Flow Symbols";
  font-feature-settings: "liga";
  white-space: nowrap;
  flex: none;
}
.desk:has(#flows:not([hidden])) .metrics { display: none; }
.flow-upload-status { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 16px; margin:12px 0; background:#edf5ef; border:1px solid #cfdfd2; border-radius:10px; }
.flow-upload-status > div { flex:1; min-width:0; }
.flow-upload-status strong,.flow-upload-status small { display:block; overflow-wrap:anywhere; font-size:13px; line-height:1.5; }
.flow-upload-status small { color:var(--muted); font-size:12px; margin-top:4px; }
.flow-upload-status button { flex:none; }
.flow-upload-status progress { display:block; width:100%; height:5px; margin-top:10px; accent-color:var(--green); }
#flows {
  --f-forest: #195840;
  --f-line: #d9e3db;
  --f-muted: #53685c;
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  color: #1b3528;
}
#flows button, .f-dialog button { cursor: pointer; }
#flows button:disabled, .f-dialog button:disabled { opacity: .45; cursor: default; }
#flows :focus-visible, .f-dialog :focus-visible { outline: 3px solid #4b9478; outline-offset: 2px; }
#flows :is(input, select, textarea), .f-dialog :is(input, select) {
  font: inherit; font-size: 14px; color: inherit;
}
#flows select, .f-dialog select, .f-field :is(input:not([type=checkbox]), textarea), .guest-answer input {
  min-width: 0;
  background: white;
  border: 1px solid #c9d6cd;
  border-radius: 8px;
  padding: 10px 12px;
}
#flows textarea { resize: vertical; min-height: 70px; line-height: 1.55; }
.f-primary, .f-outline, .f-quiet, .f-icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; border-radius: 8px; padding: 8px 14px;
  font-size: 14px; font-weight: 620; line-height: 1.25;
}
.f-primary { color: #fff; background: #205c45; border: 1px solid #205c45; }
.f-primary:hover:enabled { background: #12452f; }
.f-outline { color: #244d38; background: white; border: 1px solid #cbd8ce; }
.f-outline:hover:enabled, .f-quiet:hover:enabled { background: #edf3ed; }
.f-quiet { color: #335e48; padding-inline: 9px; }
.f-icon-button { width: 40px; padding: 6px; background: #f1f5ef; }
.library-tools, .editor-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.library-tools > .f-primary { margin-left: auto; }
.flow-search {
  display: flex; align-items: center; gap: 9px; width: min(390px, 50%); min-height: 42px;
  background: #fff; border: 1px solid #c9d6cd; border-radius: 9px; padding: 0 12px; color: #627569;
}
.flow-search input { width: 100%; flex: 1; min-width: 0; padding: 10px 0; border: 0; background: none; }
.flow-search:focus-within { outline: 2px solid #4b9478; }
#flows .flow-search input:focus-visible { outline: 0; }
#flow-count { margin: 20px 0 12px; font-size: 13px; color: var(--f-muted); }
#flow-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,260px),1fr)); gap: 18px; padding: 2px 3px 18px; }
.library-card {
  display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; color: inherit;
  border: 1px solid var(--f-line); border-radius: 14px; background: #fff; text-align: left;
}
.library-card:hover { border-color: #8daa96; box-shadow: 0 4px 16px #193e2814; }
.library-cover { display: block; position: relative; width: 100%; height: clamp(124px,11vw,180px); overflow: hidden; background: #dce8db; }
.library-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.library-cover.no-photo {
  display: grid; place-items: center;
  background-color: #dceade; background-image: radial-gradient(#b9cebd 1px, transparent 1px); background-size: 10px 10px;
}
.no-photo > .f-icon { display: grid; place-items: center; height: 56px; width: 56px; background: #f6fbf4; color:#33664a; font-size: 32px; border: 1px solid #bfd2c2; border-radius: 15px; }
.flow-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 99px; background: #f0f0e8; color: #605f4a; font-size: 11px; font-weight: 680; white-space: nowrap; line-height: 1.2; }
.flow-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #86816b; }
.flow-status.is-active { background: #e6f3e9; color: #245d3e; }
.flow-status.is-active::before { background: #32784d; }
.library-cover .flow-status { position: absolute; top: 10px; right: 10px; background: #f8f9f1f2; }
.library-detail { padding: 17px 17px 0; display: flex; flex: 1; flex-direction: column; min-width: 0; }
.library-title { font-size: clamp(17px,1.4vw,22px); line-height: 1.25; letter-spacing: -.6px; font-weight: 650; }
.library-trigger { display: flex; align-items: flex-start; gap: 7px; margin: 9px 0 16px; color: #526759; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.library-trigger .f-icon { margin-top: 1px; font-size: 15px; }
.library-footer { display: flex; margin-top: auto; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid #e7ede6; color: #496252; font-size: 12px; font-weight: 600; }
.library-footer .f-icon { font-size: 18px; }
.f-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 12px; padding: 64px 20px; background: white; border: 1px dashed #c5d4c7; border-radius: 12px; }
#flow-editor:not([hidden]) { height:100%; min-height:0; display:flex; flex-direction:column; }
#flow-fields { flex:1; min-height:0; display:flex; flex-direction:column; }
.editor-tools { gap: 8px; padding: 2px; }
#all-flows { margin-right: auto; }
#flow-note { font-size: 13px; color: #526b58; }
#flow-note.has-error { color: #922e30; }
.flow-summary { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:18px 0; }
.flow-summary h2 { font-size: clamp(22px,2.1vw,31px); line-height: 1.16; letter-spacing: -.9px; overflow-wrap: anywhere; }
.step-total { font-size: 13px; color:var(--f-muted); }
.flow-board { flex:1; display:grid; grid-template-columns: minmax(260px,.92fr) minmax(0,1.25fr); min-height:340px; overflow:hidden; border:1px solid var(--f-line); border-radius:14px; background:white; }
.sequence { display:flex; flex-direction:column; min-width:0; min-height:0; border-right:1px solid var(--f-line); }
.sequence-head, .detail-head { display:flex; align-items:center; gap:10px; }
.sequence-head { padding:16px 20px; border-bottom:1px solid var(--f-line); color:#365942; }
#flows h3 { font-size:17px; line-height:1.2; letter-spacing:-.35px; margin:0; }
.sequence-scroll { flex:1; min-height:0; overflow:auto; background-color:#f3f6f1; background-image:radial-gradient(#dce4db 1px,transparent 1px); background-size:12px 12px; }
.sequence-path { position:relative; display:flex; flex-direction:column; gap:14px; padding:20px; }
.sequence-path::before { position:absolute; content:""; width:2px; top:30px; bottom:30px; left:53px; background:#bdcfc1; }
.step-node, .trigger-node { position:relative; display:flex; gap:12px; align-items:center; width:100%; padding:11px 12px; text-align:left; background:white; border:1px solid #cfdcd0; border-radius:10px; min-height:56px; }
.trigger-node { border-style:dashed; background:#f8fcf6; }
.trigger-node > .f-icon:first-child { width:40px; text-align:center; color:#2d6044; }
.trigger-node > .f-icon:last-child { font-size:18px; color:#758777; }
.step-node:hover, .trigger-node:hover { border-color:#88ab91; }
.sequence-path [aria-pressed=true] { border:2px solid #377b54; padding:10px 11px; box-shadow:0 1px 5px #234f2d12; }
.node-text { flex:1; min-width:0; display:grid; gap:3px; }
.node-text strong { font-size:13px; color:#264a33; font-weight:680; }
.node-caption { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12px; color:#546958; }
.type-icon { display:inline-grid; flex:none; place-items:center; height:40px; width:40px; border-radius:10px; color:#3b6655; background:#e7f0e7; }
.type-image { color:#3a6d81; background:#e5f0f4; }
.type-gallery { color:#315e6d; background:#e1edf0; }
.gallery-picker { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; }
.gallery-panel { min-width:0; }
.gallery-hint { margin:0 0 10px; color:var(--f-muted); font-size:13px; line-height:1.45; }
.gallery-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,126px),1fr));
  gap:6px; padding:0; margin:0; list-style:none;
}
.gallery-photo { min-width:0; aspect-ratio:1; list-style:none; }
#flows .gallery-tile {
  display:block; position:relative; width:100%; height:100%; padding:0; border:0; overflow:hidden;
  border-radius:7px; background:#e3ebe5; color:white; cursor:grab;
  user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent;
}
.gallery-thumb { display:block; width:100%; height:100%; object-fit:cover; pointer-events:none; }
.gallery-number, .gallery-has-caption {
  position:absolute; display:grid; place-items:center; pointer-events:none; color:#fff;
  background:rgba(16,28,23,.78); border:1px solid rgba(255,255,255,.4); border-radius:20px;
}
.gallery-number { top:6px; left:6px; min-width:24px; height:24px; padding:0 5px; box-sizing:border-box; font:600 12px/1 system-ui; }
.gallery-has-caption { bottom:6px; right:6px; width:23px; height:23px; }
.gallery-has-caption[hidden] { display:none; }
.gallery-has-caption .f-icon { font-size:14px; }
.gallery-chosen .gallery-tile { outline:3px solid var(--f-forest); outline-offset:-3px; }
.gallery-placeholder { background:#c9dfd1; border-radius:7px; outline:2px dashed #46765a; outline-offset:-3px; }
.gallery-placeholder .gallery-tile { opacity:.20; }
.gallery-lifted { opacity:.94 !important; box-shadow:0 8px 24px #10291e55; border-radius:7px; }
#flows .gallery-lifted .gallery-tile { cursor:grabbing; opacity:1; }
.gallery-dialog.f-dialog { width:min(500px,92vw); padding:0; }
.gallery-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; }
.gallery-dialog-head > div { min-width:0; display:grid; gap:3px; }
.gallery-dialog-title { overflow-wrap:anywhere; font-size:15px; }
.gallery-dialog-index { font-size:12px; color:var(--f-muted); }
.gallery-full-photo { display:block; width:100%; height:min(40dvh,350px); object-fit:contain; background:#15221b; }
.gallery-dialog .gallery-caption { display:grid; gap:6px; padding:14px 16px 0; }
#flows .gallery-caption textarea { box-sizing:border-box; width:100%; min-height:48px; padding:8px 10px; border:1px solid #c9d6cd; border-radius:7px; }
.gallery-actions { display:flex; align-items:center; flex-wrap:wrap; gap:2px; padding:8px 10px 12px; }
.gallery-actions .f-quiet { font-size:12px; min-height:44px; }
.gallery-actions .f-quiet:last-child { margin-left:auto; color:#904342; }
.gallery-empty { margin:0; padding:20px; border:1px dashed var(--f-line); border-radius:8px; color:var(--f-muted); }
@media (max-width:480px) {
  .gallery-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
  #flows .gallery-tile { border-radius:5px; }
}
.type-document { color:#945d2a; background:#f8edda; }
.type-video { color:#6d5489; background:#f0eaf7; }
.type-question { color:#8d4768; background:#f7e7ed; }
.node-photo { width:44px; height:40px; border-radius:6px; object-fit:cover; }
.add-step-bar { padding:12px 16px; display:flex; gap:8px; border-top:1px solid var(--f-line); }
.add-step-bar select { flex:1; }
.step-detail { min-width:0; min-height:0; overflow:auto; padding:clamp(17px,2vw,32px); display:flex; flex-direction:column; gap:20px; }
.detail-head { min-height:40px; }
.detail-head small { margin-left:auto; color:var(--f-muted); font-size:12px; }
.detail-head h3:focus { outline:0!important; }
.f-field { display:grid; gap:7px; min-width:0; }
.field-title, .f-dialog label { font-size:13px; font-weight:640; color:#32513c; }
.field-hint, .f-dialog small { color:#58705f; font-size:12px; line-height:1.5; font-weight:400; }
.f-toggle { display:grid; grid-template-columns:1fr auto; border-top:1px solid var(--f-line); padding-top:18px; }
.f-toggle input { grid-area:1 / 2 / 3; width:20px; height:20px; accent-color:#245e43; }
.f-toggle small { grid-column:1; }
.inspector-media { flex:none; border-radius:10px; overflow:hidden; background:#eff3ee; text-align:center; }
.inspector-media img { display:block; width:100%; max-height:250px; object-fit:contain; }
.stored-video { display:block; width:100%; max-height:320px; background:#142c27; }
.stored-video-status { display:flex; align-items:center; gap:10px; padding:13px 16px; text-align:left; color:#28714a; }
.stored-video-status div { display:grid; gap:4px; }
.stored-video-status strong { font-size:13px; }
.stored-video-status small { color:#607569; font-size:12px; }
.stored-video-error { padding:0 16px 14px; margin:0; font-size:13px; color:#904342; }
.branch-section { display:grid; gap:12px; }
.branch-section h4 { margin:0; font-size:15px; }
.flow-branch { display:grid; gap:10px; padding:14px; background:#f5f7f3; border-radius:8px; }
.branch-section button { justify-self:start; }
.step-tools { display:flex; flex-wrap:wrap; gap:4px; padding-top:10px; border-top:1px solid var(--f-line); }
.step-tools button { font-size:12px; min-height:36px; }
.step-tools .remove-step { color:#904342; margin-left:auto; }
.mobile-sequence { display:none; }
.f-dialog { color:#213e2b; border:1px solid #cfddcf; border-radius:16px; padding:22px; width:min(480px,92vw); max-height:88dvh; overflow:auto; box-shadow:0 20px 80px #142d2833; }
.f-dialog::backdrop { background:#112f2680; }
.f-dialog h2 { font-size:23px; letter-spacing:-.6px; overflow-wrap:anywhere; }
.f-dialog label { display:grid; gap:8px; }
#launch-peer, #launch-status { margin:8px 0 16px; color:#596d60; font-size:13px; line-height:1.5; }
#launch-preview:not(:empty){ margin:16px 0; padding:14px; border-radius:9px; background:#f1f5ef; font-size:13px; }
.launch-steps { display:grid; gap:7px; padding:0; margin:9px 0; list-style:none; }
.launch-steps li { min-width:0; display:flex; gap:9px; align-items:center; }
.launch-steps li > span:last-child { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.launch-steps .type-icon { width:27px; height:27px; border-radius:6px; }
.launch-steps .f-icon { font-size:17px; }
.flow-actions { display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
#guest-preview { padding:0; }
.f-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:18px 20px; border-bottom:1px solid #d6e4d7; }
.f-label { font-size:12px; color:#576d5d; }
.f-chat-preview { max-height:62dvh; overflow:auto; padding:18px; display:grid; justify-items:start; gap:10px; background:#ecf2e9; }
.guest-message, .guest-reply { border-radius:10px; max-width:92%; padding:10px 12px; background:white; border:1px solid #dce5da; overflow-wrap:anywhere; }
.guest-text { white-space:pre-wrap; font-size:14px; line-height:1.5; }
.guest-photo { display:block; max-height:240px; max-width:100%; object-fit:contain; border-radius:6px; }
.guest-photo + p, .guest-file + p { margin-top:8px; }
.guest-file, .guest-answer { display:flex; align-items:center; gap:10px; font-size:13px; }
.guest-answer input { min-width:0; width:100%; }
.guest-reply { justify-self:end; background:#daecd9; }
.preview-end { justify-self:center; padding:6px; font-size:12px; color:#506557; }
@media (max-width:1000px) {
  .flow-board { grid-template-columns:minmax(225px,.87fr) minmax(0,1fr); }
  .sequence-path { padding:14px; }
  .sequence-path::before { left:47px; }
}
@media (max-width:760px) {
  #flows { scrollbar-gutter:auto; }
  #flow-editor:not([hidden]), #flow-fields { display:block; height:auto; }
  .library-tools { gap:8px; }
  .library-tools .flow-search { width:100%; }
  #flow-count { margin:12px 0 8px; }
  #flow-cards { grid-template-columns:repeat(auto-fill,minmax(min(100%,215px),1fr)); gap:12px; }
  .library-cover { height:150px; }
  .editor-tools { gap:5px; }
  .editor-tools button { font-size:13px; padding-inline:9px; }
  #flow-note:not(:empty) { order:4; width:100%; }
  .flow-summary { margin:14px 0; gap:7px; }
  .flow-board { display:block; min-height:0; height:auto; }
  .sequence { border-right:0; }
  .sequence-scroll { max-height: max(230px, 47dvh); }
  .step-detail { overflow:visible; }
  .mobile-sequence { display:inline-flex; align-self:flex-start; padding:0 5px; min-height:34px; }
  [data-pane=sequence] .step-detail, [data-pane=detail] .sequence { display:none; }
  .step-tools .remove-step { margin-left:0; }
}
@media (max-width:450px) {
  .sidebar { gap:4px; padding-inline:8px; }
  .sidebar nav button, .sidefoot button { padding:9px 6px; }
  #flow-cards { grid-template-columns:1fr; }
  .library-card { display:grid; grid-template-columns:100px minmax(0,1fr); }
  .library-cover { height:100%; min-height:106px; }
  .library-cover .flow-status { top:6px; right:6px; }
  .library-detail { padding:12px 12px 0; }
  .library-title { font-size:17px; }
  .library-trigger { margin:5px 0 8px; font-size:12px; }
  .library-footer { padding:6px 0; }
  .desk:has(#flows:not([hidden])) { padding-inline:10px; }
}
@media (max-width:360px) {
  .sidebar .brand { font-size:0; gap:0; }
}
