/* ArchiFlow — раздел «График» (schedule-v13.js, 18.11.2026).
   Компьютер: шкала времени с липкой колонкой названий; телефон: список по неделям. Цвета — из общей палитры (золото, тёмно-серый). */

.afpl { position: relative; padding-bottom: 24px; width: 100%; min-width: 0; max-width: 100%; container-type: inline-size; }
.afpl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.afpl-sp { flex: 1 1 auto; }
.afpl-br { flex: 0 0 100%; height: 0; }
.afpl-sum { min-width: 0; font-size: 12.5px; color: var(--muted); }
.afpl-sum.bad { color: #e0867c; }
.afpl-seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; }
.afpl-seg button { height: 30px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.afpl-seg button.on { background: var(--gold-soft); color: var(--gold); }
.afpl-bar .afg-btn, .afpl-bar .afp-btn { height: 32px; display: inline-flex; align-items: center; cursor: pointer; font: inherit; font-size: 13px; padding: 0 14px; border-radius: 16px; }
.afpl-bar .afp-btn { background: transparent; color: var(--text); border: 1px solid var(--line2); }
.afpl-bar .afg-btn { border: 1px solid var(--gold); color: #1c1c1e; }
.afpl-more { padding: 0 12px !important; }
/* узкая правая панель: «◆» без слова, подсказка — на кнопке */
@container (max-width: 480px) { .afpl-msb { padding: 0 12px !important; } .afpl-msb span { display: none; } .afpl-seg button { padding: 0 10px; } }

/* шкала */
.afpl-tl { min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.afpl-scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 160px; position: relative; -webkit-overflow-scrolling: touch; }
.afpl-canvas { position: relative; }
.afpl-head { position: sticky; top: 0; z-index: 6; display: flex; height: 50px; background: #262629; border-bottom: 1px solid var(--line2); }
.afpl-corner { position: sticky; left: 0; z-index: 7; flex: none; width: var(--lab, 236px); box-sizing: border-box; padding: 0 12px; display: flex; align-items: flex-end; padding-bottom: 6px; font-size: 12px; color: var(--dim); background: #262629; border-right: 1px solid var(--line2); }
.afpl-scale { position: relative; flex: none; height: 50px; }
.afpl-months, .afpl-days { position: relative; height: 25px; }
/* overflow: clip, а не hidden: hidden сделал бы месяц своей областью прокрутки, и подпись перестала бы «липнуть» к краю */
.afpl-mon { position: absolute; top: 0; height: 25px; box-sizing: border-box; border-left: 1px solid var(--line2); font-size: 11.5px; color: var(--muted); overflow: clip; }
.afpl-mon span { position: sticky; left: calc(var(--lab, 236px) + 10px); padding: 5px 6px; display: inline-block; white-space: nowrap; }
.afpl-dy { position: absolute; top: 0; height: 25px; box-sizing: border-box; text-align: center; font-size: 11px; line-height: 12px; padding-top: 1px; color: var(--muted); border-left: 1px solid #ffffff0d; }
.afpl-dy i { display: block; font-style: normal; font-size: 9.5px; color: var(--dim); }
.afpl-dy.we { color: var(--dim); }
.afpl-dy.wk { text-align: left; padding: 6px 4px 0; border-left: 1px solid var(--line2); }
.afpl-dy.now { color: var(--gold); font-weight: 600; }

.afpl-rows { position: relative; }
.afpl-we { position: absolute; top: 0; bottom: 0; background: #ffffff08; pointer-events: none; }
.afpl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed var(--gold); z-index: 3; pointer-events: none; }
.afpl-deps { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
.afpl-deps path { fill: none; stroke: #8d8d92; stroke-width: 1.2; }
.afpl-deps path.bad { stroke: #e0867c; }
.afpl-deps marker path { fill: #8d8d92; stroke: none; }
.afpl-row { position: absolute; left: 0; right: 0; height: 34px; border-bottom: 1px solid #ffffff0a; }
.afpl-gr { background: #ffffff05; }
.afpl-lab { position: sticky; left: 0; z-index: 5; box-sizing: border-box; width: var(--lab, 236px); height: 34px; padding: 3px 12px; background: var(--card); border-right: 1px solid var(--line2); display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.afpl-gr .afpl-lab { flex-direction: row; align-items: center; justify-content: space-between; background: #2a2a2d; }
.afpl-gr .afpl-lab b { font-size: 12.5px; font-weight: 600; color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afpl-gr .afpl-lab small { color: var(--dim); font-size: 11px; margin-left: 8px; }
.afpl-gspan { position: absolute; top: 14px; height: 6px; border-radius: 3px; background: var(--gold-soft); border: 1px solid var(--gold-line); box-sizing: border-box; }
.afpl-it { cursor: pointer; }
.afpl-it:hover { background: #2d2d30; }
.afpl-t { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afpl-it small { font-size: 10.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afpl-it.late small { color: #e0867c; }

/* полосы */
.afpl-b { position: absolute; top: 6px; height: 22px; box-sizing: border-box; border-radius: 6px; z-index: 4; cursor: grab; touch-action: none; user-select: none; overflow: hidden;
  background: #4a4a50; border: 1px solid #5d5d64; color: var(--text); display: flex; align-items: center; }
.afpl-b > span { position: relative; padding: 0 10px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.afpl-b > u { position: absolute; left: 0; top: 0; bottom: 0; background: #ffffff1f; pointer-events: none; }
.afpl-b.drag { cursor: grabbing; opacity: .85; box-shadow: 0 4px 14px #000a; z-index: 8; }
.afpl-b:focus-visible, .afpl-ms:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.afpl-h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; opacity: 0; }
.afpl-h.l { left: 0; } .afpl-h.r { right: 0; }
.afpl-b:hover .afpl-h { opacity: 1; background: #ffffff33; }
.afpl-after { position: absolute; top: 9px; z-index: 4; font-size: 11px; color: var(--muted); white-space: nowrap; pointer-events: none; }
.afpl-b.st-doing { background: #6b5a32; border-color: #9c8446; }
.afpl-b.st-done { background: #3b4a3d; border-color: #567259; color: #bcd0bd; }
.afpl-b.st-late { background: #6d3a35; border-color: #b0564d; }
.afpl-b.conf { box-shadow: 0 0 0 1.5px #e0867c; }
.afpl-ms { position: absolute; top: 5px; height: 24px; z-index: 4; cursor: grab; touch-action: none; user-select: none; display: flex; align-items: center; transform: translateX(-9px); }
.afpl-ms i { display: block; width: 14px; height: 14px; margin: 0 2px; transform: rotate(45deg); background: var(--gold); border-radius: 2px; }
.afpl-ms span { margin-left: 8px; font-size: 11.5px; color: var(--text); white-space: nowrap; pointer-events: none; }
.afpl-ms.st-done i { background: #6f9873; }
.afpl-ms.st-late i { background: #d6685d; }
.afpl-dragtip { position: fixed; z-index: 90; padding: 4px 9px; border-radius: 8px; background: #323237; border: 1px solid var(--gold-line); font-size: 12px; color: var(--text); pointer-events: none; }

/* телефон */
.afpl-ag { display: flex; flex-direction: column; gap: 14px; }
.afpl-pastb { align-self: flex-start; min-height: 36px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 18px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.afpl-wk h3 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.afpl-wk.now h3 { color: var(--gold); }
.afpl-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.afpl-card.st-late { border-color: #b0564d; background: #2f2524; }
.afpl-card.st-done { opacity: .62; }
.afpl-card.conf { border-style: dashed; }
.afpl-ck { flex: none; width: 28px; height: 28px; padding: 0; border: 1.5px solid var(--line2); border-radius: 14px; background: transparent; color: #1c1c1e; font-size: 15px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.afpl-ck.on { background: var(--gold); border-color: var(--gold); }
.afpl-ck.ms { border: 0; color: var(--gold); cursor: default; }
.afpl-ct { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.afpl-ct b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.afpl-ct small { font-size: 12px; color: var(--muted); }
.afpl-ct small.bad { color: #e0867c; }
.afpl-pg { height: 3px; margin-top: 5px; border-radius: 2px; background: #ffffff1a; overflow: hidden; }
.afpl-pg i { display: block; height: 100%; background: var(--gold); }
.afpl-chip { flex: none; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #3a3a3e; color: var(--muted); }
.afpl-chip.st-doing { background: #4a3f22; color: var(--gold); }
.afpl-chip.st-done { background: #2f3d31; color: #9bc29f; }

/* окна */
.afpl-box { position: relative; box-sizing: border-box; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line2); border-radius: 16px; padding: 18px 18px 14px; color: var(--text); }
.afpl-box h3 { margin: 0 34px 12px 0; font-size: 16px; font-weight: 600; }
.afpl-box .afg-x { position: absolute; top: 8px; right: 8px; border: 0; background: none; cursor: pointer; }
.afpl-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.afpl-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12px; color: var(--muted); }
.afpl-f.wide, .afpl-form .wide { grid-column: 1 / -1; }
.afpl-f input, .afpl-f select, .afpl-f textarea { box-sizing: border-box; width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 10px; background: #1f1f21; color: var(--text); font: inherit; font-size: 14px; }
.afpl-f textarea { resize: vertical; }
.afpl-f input:focus, .afpl-f select:focus, .afpl-f textarea:focus { outline: 1px solid var(--gold); border-color: var(--gold-line); }
.afpl-f input:disabled, .afpl-f select:disabled, .afpl-f textarea:disabled { opacity: .7; }
.afpl-dur { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.afpl-ck2 { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); min-height: 32px; }
.afpl-ck2 input { width: 18px; height: 18px; min-height: 0; accent-color: var(--gold); }
.afpl-tk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.afpl-tk select { flex: 1 1 160px; }
.afpl-tk b { font-weight: 500; color: var(--text); font-size: 13.5px; }
.afpl-hint { margin: 0; font-size: 12px; color: var(--dim); }
.afpl-mbtn { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.afpl-mbtn button { min-height: 36px; padding: 0 16px; border-radius: 18px; font: inherit; font-size: 13px; cursor: pointer; }
.afpl-mbtn .afp-btn { background: transparent; color: var(--text); border: 1px solid var(--line2); }
.afpl-mbtn .afg-btn { border: 1px solid var(--gold); color: #1c1c1e; }
.afpl-mbtn .afpl-danger { color: #e0867c; border-color: #6d3a35; margin-left: auto; }
.afpl-edit .afpl-tk .afp-btn { min-height: 32px; padding: 0 12px; border-radius: 16px; background: transparent; color: var(--text); border: 1px solid var(--line2); font: inherit; font-size: 12.5px; cursor: pointer; }
.afpl-radio { display: flex; gap: 18px; font-size: 14px; color: var(--text); }
.afpl-radio label { display: flex; align-items: center; gap: 6px; min-height: 32px; }
.afpl-radio input { accent-color: var(--gold); }
.afpl-askp { margin: 0 0 4px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.afpl-ask { z-index: 80; }
.afpl-ask .afpl-mbtn { flex-direction: column; align-items: stretch; }
.afpl-ask .afpl-mbtn button { justify-content: center; }
.afpl-lk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.afpl-lk > div:first-child { flex: 1 1 140px; display: flex; flex-direction: column; }
.afpl-lk small { color: var(--dim); font-size: 12px; }
.afpl-lk input { flex: 1 1 200px; min-width: 0; min-height: 34px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 10px; background: #1f1f21; color: var(--text); font: inherit; font-size: 12.5px; }
.afpl-lk .afp-btn { min-height: 32px; padding: 0 12px; border-radius: 16px; background: transparent; color: var(--text); border: 1px solid var(--line2); font: inherit; font-size: 12.5px; cursor: pointer; }
.afpl-menu { position: fixed; z-index: 85; min-width: 190px; padding: 6px; background: #2b2b2e; border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 10px 30px #0000008c; display: flex; flex-direction: column; }
.afpl-mi { display: block; box-sizing: border-box; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; text-decoration: none; cursor: pointer; }
.afpl-mi:hover { background: #38383c; }
.afpl-toast { z-index: 95; }

@media (max-width: 760px) {
  .afpl-modal { align-items: flex-end; padding: 0; }
  .afpl-box { width: 100%; max-height: 90vh; border-radius: 18px 18px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .afpl-ask .afpl-box { border-radius: 18px 18px 0 0; }
  .afpl-form { grid-template-columns: 1fr; }
  .afpl-dur { grid-template-columns: 1fr 1fr; }
  .afpl-f input, .afpl-f select, .afpl-f textarea { font-size: 16px; }
  .afpl-mbtn .afpl-danger { margin-left: 0; }
  /* «Сохранить» всегда под пальцем: кнопки липнут к низу листа, форма прокручивается над ними */
  .afpl-edit .afpl-box { padding-bottom: 0; }
  .afpl-edit .afpl-mbtn { position: sticky; bottom: 0; z-index: 2; flex-wrap: nowrap; margin: 14px -18px 0; padding: 10px 18px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
  .afpl-edit .afpl-mbtn button { flex: 1 1 0; justify-content: center; }
}
