/* C «Схема»: чертёжный лист. Unbounded для цифр и заголовков, Manrope для текста,
   ультрамариновые чернила по бледно-голубой сетке, коралловые аффилиаты и кобальтовый стаф.
   Главная деталь — машина времени над схемой. */
[data-variant='flow'] {
  --bg: #EAF0FA; --surface: #FFFFFF; --surface-2: #F4F7FD; --ink: #1B2559; --muted: #5B6591; --line: #D3DCEE; --line-2: #E6ECF7;
  --accent: #2D5BFF; --accent-ink: #FFFFFF; --accent-soft: #E4EBFF;
  --aff: #D9513C; --aff-soft: #FCE7E2; --staff: #2D5BFF; --staff-soft: #E4EBFF;
  --sched: #B07A00; --sched-soft: #FFF3D6; --danger: #C42B2B; --danger-soft: #FDE8E8;
  --head: #1B2559; --tl: #2D5BFF; --mgr: #6F8CFF;
  --radius: 14px; --radius-sm: 8px; --shadow: 0 2px 0 rgba(27, 37, 89, .06), 0 14px 30px -18px rgba(27, 37, 89, .35);
  --font: 'Manrope', system-ui, sans-serif; --font-display: 'Unbounded', 'Manrope', sans-serif;
}
[data-variant='flow'] body {
  background-color: var(--bg);
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px), linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 28px 28px;
}
[data-variant='flow'] .seg button.on { background: var(--accent); color: #fff; }
[data-variant='flow'] .btn { border-radius: 99px; }
[data-variant='flow'] .btn-primary { box-shadow: 0 6px 16px -8px var(--accent); }

.F-top { display: flex; gap: 16px; align-items: center; padding: 12px 24px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.F-brand { font-family: var(--font-display); font-weight: 700; font-size: 17px; text-decoration: none; letter-spacing: -.01em; }
.F-brand span { color: var(--accent); }
.F-nav { display: flex; gap: 4px; }
.F-nav a { text-decoration: none; padding: 6px 12px; border-radius: 99px; color: var(--muted); font-weight: 600; }
.F-nav a.on { background: var(--ink); color: #fff; }
.F-find { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 8px 5px 14px; cursor: pointer; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.F-main { padding: 22px 24px 60px; }
.F-page { max-width: 1280px; margin: 0 auto; }
.F-narrow { max-width: 860px; }
.F-h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 18px; }

/* карта трейдеров */
.F-boardhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.F-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; align-items: start; }
.F-col > header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.F-col h2 { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.F-col header small { margin-left: auto; color: var(--muted); }
.F-tile { display: grid; gap: 8px; padding: 14px 16px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.F-tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.F-tile.empty { border-style: dashed; box-shadow: none; background: rgba(255, 255, 255, .6); }
.F-tname { font-weight: 700; font-size: 15px; }
.F-tnums { display: flex; align-items: baseline; gap: 4px; }
.F-tnums b { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.F-tnums small { color: var(--muted); margin-right: 12px; }
.F-tflow { display: flex; gap: 14px; }
.F-tl { display: flex; }
.F-tl .avatar { margin-right: -4px; border: 2px solid var(--surface); }
.F-tnone { color: var(--sched); font-size: 13px; }
.F-tplan { font-size: 12px; font-weight: 700; color: var(--sched); background: var(--sched-soft); padding: 3px 10px; border-radius: 99px; justify-self: start; }

/* машина времени */
.F-trader-page { max-width: 1400px; margin: 0 auto; }
.F-tm { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 16px 22px 12px; margin-bottom: 18px; box-shadow: var(--shadow); }
.F-tmhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.F-tmwhen small { display: block; color: #AEB9E8; font-size: 12px; }
.F-tmwhen b { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.F-tmwhen b::first-letter { text-transform: uppercase; }
.F-tmbtns { display: flex; gap: 6px; }
.F-tm .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff; }
.F-track { position: relative; height: 44px; border-radius: 10px; background: rgba(255, 255, 255, .06); cursor: pointer; touch-action: none; user-select: none; }
.F-seg { position: absolute; top: 6px; bottom: 6px; border-left: 2px solid var(--ink); background: #3E5BD8; }
.F-seg:first-child { border-radius: 6px 0 0 6px; }
.F-seg.st-scheduled { background: repeating-linear-gradient(135deg, #F5C44E 0 6px, #E3AE2E 6px 12px); }
.F-seg:nth-child(odd).st-active { background: #5673F0; }
.F-seglabel { position: absolute; top: 100%; left: 0; margin-top: 8px; font-size: 11px; color: #AEB9E8; white-space: nowrap; }
.F-now { position: absolute; top: -6px; bottom: -6px; width: 2px; background: #FF6B5B; }
.F-handle { position: absolute; top: 50%; width: 22px; height: 54px; margin-left: -11px; transform: translateY(-50%); border-radius: 11px; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .25), 0 6px 16px rgba(0, 0, 0, .4); cursor: grab; }
.F-handle::after { content: ''; position: absolute; inset: 14px 9px; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); opacity: .35; }
.F-handle:focus-visible { box-shadow: 0 0 0 4px #FF6B5B; }
.F-tmhint { font-size: 11.5px; color: #AEB9E8; margin: 26px 0 0; }

/* холст со схемой */
.F-canvas-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.editing .F-canvas-wrap { grid-template-columns: minmax(0, 1fr) 280px; }
.F-canvas { background: rgba(255, 255, 255, .72); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 22px; }
.editing .F-canvas { border: 2px dashed var(--accent); background: rgba(255, 255, 255, .85); }
.F-canvas-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.F-mode { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--accent); }
.F-diagram { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 0; align-items: stretch; }
.F-nothing { display: block; padding: 40px; text-align: center; color: var(--sched); font-weight: 600; }
.F-trader { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; align-self: center; position: relative; }
.F-trader::after { content: ''; position: absolute; right: -34px; top: 50%; width: 34px; border-top: 2px solid var(--ink); }
.F-trader small { color: #AEB9E8; }
.F-trader h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.F-trates { display: flex; gap: 18px; }
.F-trates b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.1; }
.F-trates b.chg { color: #F5C44E; }
.F-trates span { font-size: 12px; color: #AEB9E8; }
.F-snap { font-size: 11.5px; }
.F-lanes { display: flex; flex-direction: column; gap: 26px; margin-left: 34px; padding-left: 26px; border-left: 2px solid var(--ink); justify-content: center; }
.F-lane { position: relative; }
.F-lane::before { content: ''; position: absolute; left: -26px; top: 40px; width: 26px; border-top: 2px solid var(--ink); }
.F-lanename { display: block; font-family: var(--font-display); font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.F-lane.aff .F-lanename { color: var(--aff); } .F-lane.staff .F-lanename { color: var(--staff); }
.F-lanename b { color: var(--ink); margin-left: 6px; }
.F-lane ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 26px; }
.F-node { position: relative; display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 170px; box-shadow: var(--shadow); }
.F-node + .F-node::before { content: ''; position: absolute; left: -26px; top: 50%; width: 22px; border-top: 2px dashed var(--line); }
.F-node + .F-node::after { content: ''; position: absolute; left: -8px; top: calc(50% - 4px); border: 4px solid transparent; border-left-color: var(--muted); }
.F-lane.aff .F-node { border-top: 3px solid var(--aff); }
.F-lane.staff .F-node { border-top: 3px solid var(--staff); }
.F-node.chg { outline: 2px solid #F5C44E; outline-offset: 2px; }
.F-node.ghost { color: var(--muted); border-style: dashed; box-shadow: none; display: block; }
.F-lvl { font-family: var(--font-display); font-size: 11px; color: var(--muted); }
.F-nn { font-weight: 700; display: flex; flex-direction: column; }
.F-nn small { font-weight: 500; color: var(--muted); }
.F-node .rate-val { font-family: var(--font-display); font-size: 15px; font-weight: 600; }

/* режим правки */
.F-edit { display: grid; grid-template-columns: 250px repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.F-etrader { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 16px; }
.F-etrader h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 10px; color: #fff; }
.F-etrader .rate-big > span:first-child { color: #AEB9E8; }
.F-etrader .rate-input { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); }
.F-etrader .rate-input input { color: #fff; }
.F-etrader .rate-big.ch-rate .rate-input { background: rgba(245, 196, 78, .2); border-color: #F5C44E; }
.F-etrader .rate-big .was { color: #F5C44E; }
.F-etrader .sb-legend { color: #AEB9E8; }
.F-edit .chain-ed { margin: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.F-edit .chain-aff { border-top: 3px solid var(--aff); } .F-edit .chain-staff { border-top: 3px solid var(--staff); }
.F-edit .chain-head h3 { font-family: var(--font-display); font-size: 13px; }
.F-edit .chain-row { grid-template-columns: 24px 22px minmax(0, 1fr) auto auto; }
.F-edit .row-tools .icon-btn:not(.danger) { display: none; }
.F-edit .chain-rows { min-height: 60px; }
.F-edit .add-member button:last-child { flex-basis: 100%; }

.F-palette { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: sticky; top: 76px; max-height: calc(100vh - 230px); overflow: auto; box-shadow: var(--shadow); }
.F-palette .seg { width: 100%; margin-bottom: 10px; }
.F-palette .seg button { flex: 1; }
.F-palette input { width: 100%; min-width: 0; }
.F-phint { font-size: 12px; color: var(--muted); margin: 8px 0; }
.F-plist { list-style: none; margin: 0; padding: 0; }
.F-pitem { display: flex; gap: 8px; align-items: center; width: 100%; border: 1px solid transparent; background: none; border-radius: 10px; padding: 5px 6px; margin-left: calc(var(--depth, 0) * 14px); width: calc(100% - var(--depth, 0) * 14px); cursor: grab; text-align: left; }
.F-pitem:hover:not(:disabled) { border-color: var(--line); background: var(--surface-2); }
.F-pitem small { margin-left: auto; color: var(--muted); }
.F-pitem.used { opacity: .35; cursor: default; }
.F-pitem.inactive span:not(.avatar) { text-decoration: line-through; }

.F-dock { position: sticky; bottom: 12px; z-index: 15; margin-top: 16px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 12px 18px; box-shadow: 0 20px 40px -16px rgba(27, 37, 89, .6); }
.F-dock .date-field { margin: 0; }
.F-dock .field > label > span, .F-dock .hint { color: #AEB9E8; }
.F-dock .hint.err { color: #FFB4A8; }
.F-dock input { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; color-scheme: dark; }
.F-dock .preset { color: #AEB9E8; border-color: rgba(255, 255, 255, .25); }
.F-dock .preset.on { color: #fff; border-color: #fff; }
.F-dockmid { flex: 1; min-width: 200px; }
.F-dockmid b { font-family: var(--font-display); font-size: 15px; }
.F-dock .chk { color: var(--ink); }
.F-dock .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }

.F-below { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }

@media (max-width: 1100px) {
  .F-diagram { grid-template-columns: 1fr; }
  .F-trader::after { display: none; }
  .F-lanes { margin: 20px 0 0; padding-left: 16px; }
  .F-edit { grid-template-columns: 1fr; }
  .editing .F-canvas-wrap { grid-template-columns: 1fr; }
  .F-palette { position: static; max-height: 320px; }
}
@media (max-width: 640px) {
  .F-main { padding: 14px 16px 60px; }
  .F-top { padding: 10px 16px; }
  .F-lane ol { flex-direction: column; gap: 10px; }
  .F-node + .F-node::before, .F-node + .F-node::after { display: none; }
}
.F-nav { flex-wrap: wrap; } .F-nav a { white-space: nowrap; }
.F-seg.clipped { border-left: 0; border-radius: 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
.F-seg.clipped .F-seglabel { left: 34px; }
.F-tm .hist-toggle.on { background: #fff; color: var(--ink); border-color: #fff; }

/* изменения между снимками на схеме */
.F-node { grid-template-columns: auto auto 1fr auto; row-gap: 4px; }
.F-rate { display: inline-flex; gap: 6px; align-items: baseline; }
.F-rate s { color: var(--muted); font-size: 12px; }
.F-badge { grid-column: 1 / -1; justify-self: start; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.b-new { background: #DDF5E8; color: #11764A; }
.b-rate, .b-moved { background: #FFF1CC; color: #8A5F00; }
.b-gone { background: var(--danger-soft); color: var(--danger); }
.b-soon { background: transparent; color: var(--sched); border: 1px dashed currentColor; }
.F-node.was-new { border-color: #3BB273; box-shadow: 0 0 0 3px rgba(59, 178, 115, .15), var(--shadow); }
.F-node.was-rate, .F-node.was-moved { outline: 2px solid #F5C44E; outline-offset: 2px; }
.F-node.will-gone { background: repeating-linear-gradient(135deg, #fff 0 8px, #FFF7E4 8px 16px); }
.F-node.gone { background: transparent; border: 1.5px dashed var(--danger); box-shadow: none; opacity: .75; }
.F-node.gone .F-nn, .F-node.gone .rate-val { text-decoration: line-through; color: var(--danger); }
.F-node.gone .avatar { filter: grayscale(1); opacity: .6; }
.F-node.coming { background: transparent; border: 1.5px dashed var(--sched); box-shadow: none; opacity: .8; }
.F-lane .F-node.gone, .F-lane .F-node.coming { border-top-width: 1.5px; }
.F-trates span { display: block; }
.F-tsoon { display: block; font-style: normal; font-size: 11.5px; color: #F5C44E; margin-top: 2px; }
.F-changes { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 16px; }
.F-changes > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.F-chlabel { font-size: 12px; color: var(--muted); margin-right: 4px; }
.F-chip { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: #FFF1CC; color: #8A5F00; }
.F-chip.plus { background: #DDF5E8; color: #11764A; }
.F-chip.minus { background: var(--danger-soft); color: var(--danger); }
.F-chip.soon { background: transparent; border: 1px dashed currentColor; }
.F-chip.soon.plus { color: #11764A; } .F-chip.soon.minus { color: var(--danger); }
.F-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: 18px 0 0; flex-wrap: wrap; }
.F-legend .lg::before { content: ''; display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.F-legend .new::before { border: 2px solid #3BB273; }
.F-legend .gone::before { border: 1.5px dashed var(--danger); }
.F-legend .soon::before { border: 1.5px dashed var(--sched); }
.F-iv { grid-column: 1 / -1; justify-self: start; font-size: 11px; color: var(--muted); }
.F-iv.fin { color: var(--sched); font-weight: 700; }
.F-iv.fin::before { content: '⏱ '; }
.F-here { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 3px 4px 3px 10px; }
.F-legend .fin::before { border: 0; background: var(--sched-soft); }
.F-dock .until-field { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .25); }
.F-dock .until-field.on { background: rgba(245, 196, 78, .15); border-color: #F5C44E; }
.F-dock .until-field .check span, .F-dock .until-field label > span { color: #AEB9E8; }
.F-node.pick { cursor: pointer; transition: transform .1s; }
.F-node.pick:hover { transform: translateY(-2px); border-color: var(--accent); }
.F-trbtn { margin-top: 4px; align-self: flex-start; border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff; border-radius: 99px; padding: 4px 12px; cursor: pointer; font-size: 12.5px; }
.F-trbtn:hover { background: rgba(255, 255, 255, .12); }
.F-hint { font-size: 12.5px; color: var(--muted); }
