/* Каркас робочого екрана «Вишиванка» — лише токени. Компоненти — у freya.css */
.topbar__tools { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4) var(--space-6); }
.page-head--tight { align-items: center; }
.page-head h1:not([class]) { font-size: 36px; line-height: 42px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.page-head__sub { font-size: 15px; line-height: 22px; color: var(--label-secondary); margin: var(--space-1) 0 0; }
.page-head__tools { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.page-head__tools form { margin: 0; }
.back { display: inline-block; font-size: 13px; line-height: 18px; font-weight: 500; margin-bottom: var(--space-2); }
.back-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); }
.back-row .back-sep { color: var(--label-tertiary); font-size: 13px; }
.cols { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: flex-start; }
.cols__main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.cols__side { flex: 1 1 300px; max-width: 360px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.section-title { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 var(--space-3); }
.stats { display: flex; flex-wrap: wrap; gap: var(--space-6) var(--space-8); }
.stats .fr-stat { flex: 1 1 160px; }
.cell-sub { display: block; font-size: 13px; line-height: 18px; color: var(--label-secondary); font-weight: 400; }
.fr-table td a:not([class]) { color: var(--label); font-weight: 700; text-decoration: none; }
.fr-table td a:not([class]):hover { color: var(--accent-text); }
.fr-table td.fr-num--light { font-weight: 400; color: var(--label-secondary); }
.fr-row__title--plain { font-weight: 500; }
.mono { font-family: var(--font-mono); font-size: 13px; }

/* Вхід */
.login { min-height: calc(100vh - 16px); display: grid; place-items: center; padding: var(--space-12) var(--space-4); box-sizing: border-box; }
.login__box { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: var(--space-8); }
.login__head { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); text-align: center; }
.login__tag { font-size: 17px; line-height: 26px; color: var(--label-secondary); margin: calc(-1 * var(--space-2)) 0 0; }
.login form { display: flex; flex-direction: column; gap: var(--space-5); }
.login .fr-input { height: 48px; font-size: 16px; }
.login .fr-btn { width: 100%; margin-top: var(--space-1); }
.login__foot { font-size: 13px; line-height: 18px; color: var(--label-secondary); text-align: center; }

@media (max-width: 640px) {
  .topbar__tools .fr-btn--secondary { display: none; }
  .cols { gap: var(--space-8); }
  .cols__side { max-width: none; }
  .login .fr-avatar--xl { width: 120px; height: 120px; }
}

/* Модальні вікна */
.modal { border: 0; padding: 0; border-radius: var(--radius-xl); background: var(--surface-raised); color: var(--label); box-shadow: var(--shadow-pop); width: min(420px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(26,26,26,0.32); }
.modal__body { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); margin: 0; }
.modal__title { font-size: 19px; line-height: 26px; font-weight: 700; margin: 0; }
.modal__text { height: 96px; padding: var(--space-2) var(--space-3); resize: vertical; }
.modal__check { display: flex; align-items: center; gap: var(--space-3); }
.modal__actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.modal p { margin: 0; }

/* Рішення по рядках «?» і пропозиції */
.decide { flex-wrap: wrap; }
.decide__sel { width: 130px; }
.decide__note { width: 200px; }
.req { align-items: flex-start; }
.req__text { margin: var(--space-1) 0; }
.req__reply { margin-top: var(--space-1); color: var(--accent-text); }
.req__form { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.req__form .fr-input { width: auto; flex: 1 1 160px; }
.decide .fr-row__title, .decide .fr-row__sub { white-space: normal; }
.fr-table th.fr-num + th.fr-num, .fr-table td.fr-num + td.fr-num { padding-left: var(--space-6); }
.fr-topnav a { white-space: nowrap; }
.letter-text { height: 320px; padding: var(--space-3); line-height: 22px; resize: vertical; }
.fr-row__sub { overflow-wrap: anywhere; }
.prev-decl { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-top: var(--space-4); padding: var(--space-4) var(--space-5); background: var(--linen); border-radius: var(--radius-md); }
.prev-decl__text { flex: 1 1 100%; display: flex; flex-direction: column; gap: var(--space-1); }
.prev-decl .fr-input { flex: 1 1 240px; width: auto; padding-top: 7px; }
.fop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.fop-new-only { display: flex; flex-direction: column; gap: var(--space-8); }
.fop-new-only[hidden] { display: none; }
.fop-files { display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-5); background: var(--linen); border-radius: var(--radius-md); }
.inbox-actions { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
@media (max-width: 640px) { .fop-grid { grid-template-columns: 1fr; } }
.invite__box { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: var(--space-8); }
.invite__form { display: flex; flex-direction: column; gap: var(--space-6); }
.invite__steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: var(--space-6); }
.invite__steps > li { counter-increment: s; position: relative; padding-left: 40px; }
.invite__steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: var(--radius-sm, 4px); background: var(--label); color: var(--surface, #fff); font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.invite__steps p { margin: var(--space-1) 0 var(--space-3); color: var(--label-secondary); }
.invite__qr { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: var(--radius-md); border: 1px solid var(--separator, #e7e4df); }
.invite__qr svg { width: 100%; height: 100%; display: block; }
.invite__key summary { cursor: pointer; color: var(--accent-text); font-weight: 500; margin-top: var(--space-3); }
.invite__secret { font-size: 16px; letter-spacing: .06em; user-select: all; }
.invite__code { max-width: 200px; font-size: 18px; letter-spacing: .2em; }

/* Перегляд файлу (виписка, книга) у браузері */
.fv-name { word-break: break-word; }
.fv-tabs { flex-wrap: wrap; margin-bottom: var(--space-4); }
.fv-tab { display: inline-flex; align-items: center; height: 30px; padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--label-secondary); font-size: 13px; font-weight: 700; text-decoration: none; }
.fv-tab:hover { color: var(--label); }
.fv-tab[aria-current="page"] { background: var(--fill-selected); color: var(--label); box-shadow: 0 1px 2px rgba(26,26,26,0.12); }
.fv-wrap { overflow: auto; max-height: calc(100vh - 220px); border: 1px solid var(--separator); border-radius: var(--radius-md); background: var(--surface); }
.fv-table { border-collapse: collapse; font-size: 13px; line-height: 18px; color: var(--label); }
.fv-table td, .fv-table th { border-right: 1px solid var(--separator); border-bottom: 1px solid var(--separator); padding: 6px var(--space-2); vertical-align: top; max-width: 300px; }
.fv-table td { white-space: pre-wrap; }
.fv-table .fv-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fv-table .fv-n { position: sticky; left: 0; background: var(--linen); color: var(--label-tertiary); font-weight: 500; text-align: right; min-width: 32px; }
.fv-text { white-space: pre-wrap; font-family: var(--font-mono); font-size: 13px; line-height: 20px; background: var(--linen); border-radius: var(--radius-md); padding: var(--space-5); overflow: auto; }

/* Окремі податки: позначка «сплачено» і число без пробілів для декларації */
.copy-num{user-select:all;-webkit-user-select:all;font-weight:600;color:var(--label)}
.fr-stat .paid-form{margin-top:6px}
.fr-stat__note.paid{color:var(--label)}
.fr-table td.tax .fr-xs{vertical-align:-2px}
.fr-table--stitch td.tax{font-weight:500;white-space:nowrap}
.fr-table--stitch td.tax--paid{color:var(--label)}
.fr-table--stitch td:first-child{min-width:200px}
.req-tabs{display:inline-flex;width:auto;margin:0 0 8px}
.req-tabs__n{color:var(--label-secondary);font-weight:500;margin-left:4px}

/* Рішення Фреї по рядках «?» */
.fr-notice--info{background:var(--accent-tint)} .fr-notice--info .fr-notice__mark{background:var(--blue)}
.freya-dec{display:block;margin-top:4px;font-size:13px;color:var(--label-secondary)}
.freya-dec__tag{display:inline-block;font-size:11px;font-weight:700;letter-spacing:.02em;color:var(--on-blue);background:var(--blue);border-radius:3px;padding:0 5px;margin-right:4px}
.freya-dec__form{display:inline;margin-left:6px}
button.fr-link{background:none;border:0;padding:0;font:inherit;cursor:pointer}
.ov-find{display:flex;gap:8px;flex:1 1 260px;min-width:0}
.ov-find__q{flex:1 1 180px;min-width:0}
.ov-find__g{flex:0 1 220px;min-width:0}
.fr-stat__note--alert{color:var(--danger)}
.rem{display:grid;gap:14px}
.rem__body{min-height:180px;font:inherit}
.rem__actions{display:flex;flex-wrap:wrap;gap:8px}
.fe{display:grid;gap:14px;max-width:640px}
.fe__two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:560px){.fe__two{grid-template-columns:1fr}}
.fe__check{display:flex;gap:8px;align-items:center}
.owner-note{font-size:13px;color:var(--label-secondary);background:var(--accent-tint);border-radius:var(--radius-md);padding:8px 12px;margin:0 0 16px}
.esv{display:grid;gap:12px}
.esv__bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.esv__q{flex:1 1 200px;min-width:0}
.esv__miss{color:var(--warning)}
.esv-text{margin:0 0 12px}.esv-text pre{white-space:pre-wrap;font:inherit;color:var(--label-secondary);background:var(--fill, #f4f2ee);padding:10px 12px;border-radius:6px}
.esv__undo{margin-left:6px;font-size:13px}
/* Мій список — таблиця Галини по когортах */
.ml-tabs{display:flex;flex-wrap:wrap;gap:4px;margin:0 0 12px;border-bottom:1px solid var(--separator)}
.ml-tabs a{padding:8px 12px;color:var(--label-secondary);text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px}
.ml-tabs a span{font-size:12px;color:var(--label-tertiary, var(--label-secondary));margin-left:4px}
.ml-tabs a[aria-current=page]{color:var(--accent-text);border-bottom-color:var(--accent-text);font-weight:600}
.ml-bar{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin:0 0 12px}
.ml-q{flex:0 1 280px;min-width:0}
.ml-sum{font-size:14px;color:var(--label-secondary)}
.ml{font-size:14px}
.ml th,.ml td{vertical-align:top}
.ml-groups th{text-align:center}
.ml-g{border-bottom:2px solid var(--accent-text)}
.ml-head th{background:var(--accent-tint);color:var(--label);text-align:left;font-weight:700;font-size:13px}
.ml-head th span{font-weight:400;color:var(--label-secondary);margin-left:6px}
.ml-done{color:var(--success)!important;font-weight:600}
.ml-pay--ok{background:var(--success-tint);color:var(--success)}
/* оплачена сума — звичайне число, без підкреслення; посилання на Фінанси лишається */
.ml-paid{color:inherit;text-decoration:none}
.ml-paid:hover{text-decoration:underline;text-underline-offset:3px}
.ml-pay .fr-xs{width:18px;height:18px}
.ml-kep--soon{background:var(--warning-tint);color:var(--warning)}
.ml-kep--expired{background:color-mix(in srgb, var(--danger) 14%, transparent);color:var(--danger)}
.ml-chip{padding:0 6px;border-radius:3px}
.ml-note{max-width:240px;color:var(--label-secondary)}
.ml-edit summary{cursor:pointer;list-style:none}
.ml-edit[open]{position:relative}
.ml-form{position:absolute;right:0;z-index:5;width:min(520px,90vw);display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px;
  background:var(--bg, #fff);border:1px solid var(--separator);border-radius:8px;box-shadow:0 6px 24px rgba(0,0,0,.12)}
.ml-form label{display:grid;gap:4px;font-size:13px;color:var(--label-secondary)}
.ml-form__wide{grid-column:1/-1}
.ml-legend{display:flex;flex-wrap:wrap;gap:16px;margin:12px 0;font-size:13px;color:var(--label-secondary)}
.ml[data-more="0"] .ml-more{display:none}
.ml-toggle{display:flex;gap:6px;align-items:center;font-size:14px;color:var(--label-secondary)}
.ml-form__hint{margin:0;font-size:12px;color:var(--label-secondary)}
.ml td .fr-xs{vertical-align:-2px}
.ml th{white-space:nowrap;padding-left:8px;padding-right:8px}
.ml td{padding-left:8px;padding-right:8px}
.ml td:nth-child(3),.ml td.fr-num,.ml td.ml-kep{white-space:nowrap}
.ml td:nth-child(2){min-width:190px}
.ml .ml-pay{text-align:center}
.ml-groups th.ml-g{text-align:center}
.ml[data-more="1"] .fr-table__sub .ml-kep{display:none}
.ml-file{white-space:nowrap}
.ml-sent{display:block;margin-top:4px}
.ml-sent__undo{font-size:12px}
.fee-card{display:flex;flex-wrap:wrap;gap:12px 24px;align-items:flex-start;justify-content:space-between;margin:12px 0}
.fee-card__main{display:grid;gap:2px}
.fee-card__value{font-size:22px;font-weight:700;font-variant-numeric:tabular-nums}
.fee-card__edit{flex:1 1 100%}
.fee-card__edit summary{cursor:pointer;list-style:none;display:inline-block}
.fee-form{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.fee-form__wide{grid-column:1/-1}
@media (max-width:640px){.fee-form{grid-template-columns:1fr}}
tr.row-link{cursor:pointer}
tr.row-link:hover>td{background:var(--accent-tint)}
.sel-col{width:28px;padding-right:0!important}
.sel-hint{margin:0 0 8px;font-size:13px}
.sel-table tr:has(.sel:checked)>td{background:var(--accent-tint)}
.sub-total td{color:var(--label-secondary);font-size:13px}
.sel-bar{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:20;display:flex;gap:16px;align-items:center;
  max-width:calc(100vw - 32px);padding:10px 16px;border-radius:10px;background:var(--label);color:var(--bg);box-shadow:0 6px 24px rgba(0,0,0,.2);font-variant-numeric:tabular-nums}
.sel-bar .fr-link{color:var(--bg)}
.ml-st{min-width:120px}
.ml-st__one{font-weight:600;margin-right:4px}
.ml-st__via{display:block;font-size:12px;color:var(--label-secondary)}
.ml-st__need{display:block;color:var(--danger);font-size:13px;margin-top:2px}
.fe--wide{max-width:760px}
.fe .section-title{margin:8px 0 0}
.fops__gap{color:var(--warning)}
.acc-add{display:grid;gap:8px;margin-top:10px}
.acc-add__row{display:grid;grid-template-columns:90px 1fr;gap:8px}
.page-head__actions{display:flex;gap:8px;flex-wrap:wrap}
.hist__when{display:grid;justify-items:end;gap:2px;white-space:nowrap}
.cols__side .fr-row__title--plain{word-break:break-all;font-size:13px}
.fops td.fr-num{padding-right:16px}
/* Статистика */
.st-nav{position:sticky;top:0;z-index:4;background:var(--bg)}
.st-sec{display:grid;gap:14px;margin:8px 0 28px;scroll-margin-top:56px}
.st-sub{font-size:15px;margin:8px 0 6px}
.st-note{margin:0;font-size:13px}
.st-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.st-tile{padding:12px 14px;border:1px solid var(--separator);border-radius:8px}
.st-tile--soon{border-color:var(--warning);background:var(--warning-tint)}
.st-tile--late{border-color:var(--danger);background:color-mix(in srgb, var(--danger) 10%, transparent)}
.st-bars{display:grid;gap:8px}
.st-bar{display:grid;grid-template-columns:minmax(120px,190px) 1fr auto;gap:10px;align-items:center}
.st-bars--small .st-bar{grid-template-columns:minmax(90px,150px) 1fr auto}
.st-bar__label{font-size:14px}
.st-bar__track{position:relative;height:10px;border-radius:5px;background:var(--fill, #f1eee9)}
.st-bar__fill{position:absolute;inset:0 auto 0 0;border-radius:5px;background:var(--accent-text)}
.st-bar__prev{position:absolute;top:-4px;bottom:-4px;width:2px;margin-left:-1px;background:var(--label);border-radius:1px;box-shadow:0 0 0 2px var(--bg)}
.st-bar__num{font-size:14px;white-space:nowrap;font-variant-numeric:tabular-nums;min-width:120px;text-align:right}
.st-bar__cmp{color:var(--label-secondary)}
.st-bar__cmp--behind{color:var(--warning)}
.st-table td,.st-table th{white-space:nowrap}
.st-cell--all{font-weight:700}
.st-cell--none{color:var(--label-secondary)}
.st-two{display:grid;grid-template-columns:1fr 1fr;gap:24px}
.st-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:24px}
.st-scroll{max-height:360px;overflow:auto}
@media (max-width:760px){.st-two{grid-template-columns:1fr}.st-bar{grid-template-columns:1fr auto}.st-bar__track{grid-column:1/-1;order:3}}
/* Фінанси */
.fin__tag{font-size:12px;font-weight:700;color:var(--accent-text);background:var(--accent-tint);border-radius:3px;padding:0 5px}
.fin__warn{color:var(--warning)}
.fin__bal--debt{color:var(--danger);font-weight:600}
.fin__bal--adv{color:var(--success)}
.fr-seg__a{display:inline-block;padding:6px 12px;color:var(--label-secondary);text-decoration:none;border-radius:6px}
.fr-seg__a[aria-current]{background:var(--accent-tint);color:var(--accent-text);font-weight:600}
.fin-form{display:grid;gap:12px;padding:16px;margin:0 0 20px}
.fin-form .section-title{margin:0}
.fin-kind{display:flex;flex-wrap:wrap;gap:6px}
.fin-kind label{display:inline-flex;gap:6px;align-items:center;padding:6px 10px;border:1px solid var(--separator);border-radius:6px;cursor:pointer}
.fin-kind label:has(input:checked){border-color:var(--accent-text);background:var(--accent-tint)}
.fin-form__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.fin-form__wide{grid-column:1/-1}
.fin-led__void td{color:var(--label-secondary);text-decoration:line-through}
.fin-led__void td .fr-table__sub{text-decoration:none}
.fin-void summary{cursor:pointer;list-style:none;font-size:13px}
.fin-void form{display:grid;gap:6px;margin-top:6px;min-width:200px}
.fin-terms{display:grid;gap:10px}
@media (max-width:640px){.fin-form__grid{grid-template-columns:1fr}}
@media (min-width:901px){.fr-topnav{gap:var(--space-1) var(--space-4)}}
@media (min-width:901px) and (max-width:1360px){.fr-topnav{gap:var(--space-1) 14px}.fr-topnav a{font-size:15px}}
.fin-led td:last-child{padding-left:12px;white-space:nowrap}
.fin-led td.fin__bal{white-space:nowrap}
.sel-bar[hidden]{display:none}
.qh{align-items:flex-start}
.qh__views{display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.qh .page-head__sub b{color:var(--label)}
.fe__ro{display:block;padding:8px 0;color:var(--label)}
.fe-q__decl{padding-left:var(--space-6,24px)}
.jr-filters{display:grid;grid-template-columns:1fr 2fr 1.1fr 1.3fr 1fr 1.6fr;gap:var(--space-3);margin:0 0 var(--space-3)}
@media (max-width:1100px){.jr-filters{grid-template-columns:repeat(3,1fr)}}
.jr-f{display:flex;flex-direction:column;gap:4px;min-width:0}
.jr-f>span{font-size:13px;color:var(--label-secondary)}
.jr-f .fr-input{width:100%;height:40px;min-width:0}
@media (max-width:640px){.jr-filters{grid-template-columns:1fr 1fr}}
.jr-count{margin:0 0 var(--space-3);font-size:14px}

/* аркуш Excel у браузері: сітка як в Excel; кольори клітинок — з самого файлу */
.fv-grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; font-family: Calibri, Carlito, Arial, sans-serif; font-size: 14px; line-height: 1.25; color: var(--label); background: var(--surface); }
.fv-grid td { padding: 1px 4px; border-right: 1px solid var(--separator); border-bottom: 1px solid var(--separator); white-space: nowrap; overflow: hidden; text-overflow: clip; vertical-align: bottom; background-clip: padding-box; }
.fv-grid td:not([style*="background"]) { background: var(--surface); }
.fv-grid .fv-num { font-variant-numeric: tabular-nums; }
.fv-grid thead th { position: sticky; top: 0; z-index: 3; height: 22px; background: var(--linen); color: var(--label-secondary); font: 500 12px/22px var(--font-sans); text-align: center; border-right: 1px solid var(--separator); border-bottom: 1px solid var(--separator); }
.fv-grid .fv-corner { left: 0; z-index: 5; }
.fv-grid .fv-n { position: sticky; left: 0; z-index: 2; width: 40px; background: var(--linen); color: var(--label-tertiary); font: 500 12px var(--font-sans); text-align: center; border-right: 1px solid var(--separator); border-bottom: 1px solid var(--separator); }
.fv-tab__c { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

.mono-box{margin-top:var(--space-6)}
.mono-box p{margin:var(--space-2) 0;font-size:14px}
.mono-box__state{display:flex;gap:var(--space-2);align-items:center}
.mono-box__url{font-size:13px;margin-bottom:var(--space-2)}

/* «Мій список» — щільна таблиця на всю ширину: закріплені шапка й колонки №/ФОП, прокрутка всередині */
.fr-page--wide { max-width: none; padding: var(--space-6) var(--space-6) var(--space-12); gap: var(--space-4); }
@media (max-width: 900px) { .fr-page--wide { padding: var(--space-4) var(--space-4) var(--space-8); } }
.fr-page--wide .ml-tabs { margin-bottom: 0; }
.fr-page--wide .ml-bar { margin: 0; }
.ml-wrap { overflow: auto; max-height: calc(100vh - 150px); border: 1px solid var(--separator); border-radius: var(--radius-md); background: var(--surface); }
.ml { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; line-height: 18px; color: var(--label); }
.ml th, .ml td { padding: 5px 8px; border-bottom: 1px solid var(--separator); vertical-align: middle; background: var(--surface); white-space: nowrap; }
.ml thead th { position: sticky; z-index: 3; background: var(--linen); color: var(--label-secondary); font-weight: 600; font-size: 13px; text-align: center; }
.ml thead .ml-groups th { top: 0; color: var(--label); font-size: 13px; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--separator); }
.ml thead .ml-sub th { top: 29px; font-weight: 500; }
.ml thead .ml-g { border-bottom: 2px solid var(--accent-text); }
.ml thead th + th, .ml td + td { border-left: 1px solid color-mix(in srgb, var(--separator) 55%, transparent); }
.ml .ml-stick { position: sticky; z-index: 2; }
.ml .ml-stick--n { left: 0; width: 34px; min-width: 34px; text-align: right; }
.ml .ml-stick--name { left: 34px; min-width: 170px; max-width: 230px; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--separator); }
.ml thead .ml-stick { z-index: 4; }
.ml-head th { background: var(--accent-tint) !important; color: var(--label); text-align: left; font-weight: 700; font-size: 12px; padding: 4px 8px; }
.ml-head th span { font-weight: 400; color: var(--label-secondary); margin-left: 6px; }
.ml td.ml-c, .ml th.ml-c { text-align: center; }
.ml td .fr-xs { width: 16px; height: 16px; vertical-align: -3px; }
.ml .fr-table__name { font-weight: 600; color: var(--label); text-decoration: none; }
.ml .fr-table__name:hover { color: var(--accent-text); }
.ml .ml-none { color: var(--label-tertiary); }
.ml .ml-zero { font-size: 12px; font-weight: 700; color: var(--success); margin-left: 2px; }
.ml .ml-d { color: var(--label-secondary); font-variant-numeric: tabular-nums; }
.ml .ml-pay--ok { background: var(--success-tint); }
.ml tbody tr:hover td { background: color-mix(in srgb, var(--accent-tint) 50%, var(--surface)); }
.ml tbody tr.ml-hit td { background: var(--accent-tint); }
.ml tr[id] { scroll-margin-top: 80px; }
.ml .ml-file { display: inline-flex; gap: 8px; align-items: center; }
.ml .ml-sent { display: inline; margin: 0; }
.ml .ml-sent .fr-btn--sm { height: 24px; padding: 0 8px; font-size: 12px; }
.ml .ml-sent__ok { background: none; border: 0; padding: 2px; cursor: pointer; }
.ml[data-src="0"] .ml-src { display: none; }
.ml .ml-src__list { font-size: 12px; color: var(--label-secondary); white-space: normal; min-width: 180px; }
.ml-form__check { display: flex !important; grid-template-columns: none !important; gap: 8px; align-items: flex-start; color: var(--label) !important; }
/* компактна шапка над таблицею «Мого списку» */
.fr-page--wide .qh h1 { font-size: 28px; line-height: 34px; }
.fr-page--wide .qh .page-head__sub { margin-top: 2px; }
.fr-page--wide > .fr-notice { padding: 8px 14px; font-size: 13px; }
.fr-page--wide > .fr-notice .fr-notice__title { display: inline; margin-right: 6px; }
.fr-page--wide .fr-today { padding: 10px 16px; gap: 4px 16px; }
.fr-page--wide .fr-today .fr-avatar { display: none; }
@media (max-width: 640px) { .fr-page--wide .fr-today { grid-template-columns: minmax(0, 1fr); } .fr-page--wide .fr-today__list { grid-column: 1; } }
@media (min-width: 641px) { .fr-page--wide .fr-today { grid-template-columns: 170px minmax(0, 1fr); } .fr-page--wide .fr-today__list { grid-column: 2; } }
.fr-page--wide .fr-today__item:first-child { border-top: 0; }
.fr-page--wide .fr-today__title { font-size: 15px; margin: 0; }
.fr-page--wide .fr-today__sub { font-size: 13px; margin: 0; }
.fr-page--wide .fr-today__item { padding: 6px 0; }
.fr-page--wide .fr-today__note { display: inline; margin-left: 6px; }
.ml .ml-head th { text-align: left !important; }

/* Вісім звірок: причина й ручне підтвердження */
.ck-why { display: block; margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--danger); }
.ck-why b { font-weight: 600; }
.ck-ok { margin-top: 6px; }
.ck-ok summary { cursor: pointer; color: var(--accent-text); font-size: 14px; }
.ck-ok__form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 4px; }
.ck-ok__form .fr-input { flex: 1 1 260px; min-width: 0; }

/* Попрощатися з ФОПом */
.bye-start { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--separator); }
.bye-start__del { color: var(--danger); font-size: 14px; }
.bye-head { display: flex; align-items: center; gap: 12px; }
.bye-wave { width: 48px; height: 48px; flex: none; transform-origin: 70% 90%; animation: bye-wave 1.4s ease-in-out 3; }
@keyframes bye-wave { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .bye-wave { animation: none; } }
.bye-why { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.bye-note { font-size: 13px; line-height: 18px; margin: 0; }
.bye-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 8px 0 16px; border-radius: 12px; background: var(--accent-tint); flex-wrap: wrap; }
.bye-banner__ball { width: 36px; height: 36px; flex: none; }
.bye-banner__text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }

/* «Зібрати ФОПу валізу»: чорна кнопка; при наведенні напис зсувається, а валізка «перебігає» за нього
   й на коліщатах котиться за правий край */
.bye-btn { position: relative; overflow: hidden; background: var(--accent); color: var(--on-accent); padding-left: calc(var(--space-5) + 28px); }
.bye-btn:hover { background: var(--accent-hover); }
.bye-btn__bag { position: absolute; left: var(--space-5); top: 50%; transform: translateY(-55%); }
.bye-btn__text { transition: transform .25s ease; }
.bye-btn:hover .bye-btn__text { transform: translateX(-28px); }
.bye-btn:hover .bye-btn__bag { animation: bye-roll 1.6s ease-in-out forwards; }
@keyframes bye-roll {
  0%   { left: var(--space-5); opacity: 1; transform: translateY(-55%) scale(1); }
  12%  { left: var(--space-5); opacity: 0; transform: translateY(-55%) scale(.6); }
  18%  { left: calc(100% - var(--space-5) - 20px); opacity: 0; transform: translateY(-55%) scale(.6); }
  32%  { left: calc(100% - var(--space-5) - 20px); opacity: 1; transform: translateY(-55%) scale(1); }
  55%  { left: calc(100% - var(--space-5) - 20px); transform: translateY(-62%) rotate(-10deg); }
  65%  { left: calc(100% - var(--space-5) - 20px); transform: translateY(-55%) rotate(4deg); }
  100% { left: calc(100% + 8px); opacity: 1; transform: translateY(-55%) rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .bye-btn:hover .bye-btn__bag { animation: none; } .bye-btn:hover .bye-btn__text { transform: none; } }
.bye-btn--plain { padding-left: var(--space-5); }

.fin-price { display: flex; gap: 8px; }
.fin-price .fr-input:first-child { flex: 1 1 auto; min-width: 0; }
.fin-price select { flex: 0 0 auto; width: auto; }
.ml-form { white-space: normal; }          /* таблиця «Мого списку» не переносить рядки — форма «Змінити» має переносити */
/* шаблон файлу для ФОПа в картці ФОПа */
.tpl-box{margin-top:var(--space-6)}
.tpl-box__hint{font-size:13px;margin:var(--space-2) 0}
.tpl-box__form{display:flex;flex-direction:column;gap:var(--space-2);align-items:flex-start}
.tpl-box__form .fr-input{font-size:13px}
/* перевірка файлу для ФОПа */
.file-check__list{margin:var(--space-1) 0 var(--space-2);padding-left:1.2em}
.file-check__list li{margin:2px 0}
/* групові дії «Мого списку» */
.ml-pick{display:inline-flex;align-items:center;gap:4px;cursor:pointer;justify-content:flex-end;width:100%}
.ml-pick input{margin:0;width:14px;height:14px;accent-color:var(--blue)}
.ml .ml-stick--n{width:46px;min-width:46px}
.ml .ml-stick--name{left:46px}
.ml tr:has(.ml-sel:checked)>td{background:var(--accent-tint)}
.ml-bulk{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:20;display:flex;flex-wrap:wrap;width:max-content;gap:8px 10px;align-items:center;
  max-width:calc(100vw - 32px);padding:10px 14px;border-radius:12px;background:var(--bg);border:1px solid var(--separator);box-shadow:0 8px 28px rgba(0,0,0,.16)}
.ml-bulk[hidden]{display:none}
.ml-bulk__n{font-size:14px;margin-right:4px}
/* ID ФОПа («Ф-042») */
.fop-code{display:inline-block;vertical-align:middle;line-height:1.5;margin-left:6px;padding:1px 7px;border:1px solid var(--separator);border-radius:6px;
  font-size:13px;font-weight:600;color:var(--label-secondary);font-variant-numeric:tabular-nums;letter-spacing:.02em;white-space:nowrap}
.fop-code--sm{margin-left:0;font-size:12.5px;padding:0 5px}
.ml-code{font-size:12.5px;color:var(--label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap}

/* числова колонка, за якою текстова: не злипаються («Баланс | Остання оплата») */
.fr-table td.fr-num + td:not(.fr-num), .fr-table th.fr-num + th:not(.fr-num) { padding-left: var(--space-5); }
/* вкладки на телефоні: видно, що їх можна гортати */
@media (max-width: 640px) {
  .fr-topnav { gap: var(--space-4); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); padding-right: 28px; }
  .fr-topnav.is-end { -webkit-mask-image: none; mask-image: none; }
}
/* «Надіслано» в «Моєму списку»: тонке кільце замість кнопки в кожному рядку; підпис — при наведенні */
.ml-ring{appearance:none;display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 4px;border:0;background:none;cursor:pointer;
  font:inherit;font-size:12.5px;font-weight:600;color:var(--accent-text);border-radius:var(--radius-pill);vertical-align:middle}
.ml-ring::before{content:"";flex:none;width:14px;height:14px;border-radius:50%;box-shadow:inset 0 0 0 1.5px var(--label-tertiary);background:var(--surface)}
.ml-ring__txt{display:none}
.ml-ring:hover,.ml-ring:focus-visible{background:var(--accent-tint);padding:0 8px 0 4px}
.ml-ring:hover::before,.ml-ring:focus-visible::before{box-shadow:inset 0 0 0 1.5px var(--accent-text)}
.ml-ring:hover .ml-ring__txt,.ml-ring:focus-visible .ml-ring__txt{display:inline}
.ml-ring:disabled{cursor:default;opacity:.7}
.ml-ring:disabled:hover{background:none;padding:0 4px}.ml-ring:disabled:hover .ml-ring__txt{display:none}
.ml-ring--legend{cursor:default;padding:0;height:auto}
/* тіньовий режим — позначка біля назви кварталу замість банера */
.shadow-chip{display:inline-flex;align-items:center;gap:6px;vertical-align:middle;margin-left:10px;padding:2px 9px;border-radius:var(--radius-pill);
  background:var(--fill);color:var(--label-secondary);font-size:13px;font-weight:600;letter-spacing:0;cursor:help;white-space:nowrap}
.shadow-chip::before{content:"";width:7px;height:7px;background:var(--label);transform:rotate(45deg)}
/* «Справи на сьогодні» — згорнуто в один рядок, розгортається */
details.today-fold{display:block;padding:0;background:var(--linen);border-radius:var(--radius-md)}
.today-fold__sum{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 16px;cursor:pointer;list-style:none}
.today-fold__sum::-webkit-details-marker{display:none}
.today-fold__ball{width:28px;height:28px}
.today-fold__title{font-weight:700;font-size:15px}
.today-fold__counts{display:inline-flex;align-items:center;gap:6px;font-size:14px}
.today-fold__alert{color:var(--danger);font-weight:600;margin-left:4px}
.today-fold__more{margin-left:auto;font-size:13px;color:var(--accent-text);font-weight:600}
.today-fold__more::after{content:"показати"}
details[open] > .today-fold__sum .today-fold__more::after{content:"згорнути"}
details.today-fold .fr-today__list{grid-column:auto;padding:0 16px 8px 56px}
details.today-fold .fr-today__item:first-child{border-top:1px solid var(--separator)}
@media (max-width:640px){details.today-fold .fr-today__list{padding:0 12px 8px}.today-fold__more{margin-left:0}}
.fr-page--wide details.today-fold{padding:0}
/* верхня панель: головна дія — «+ Виписка», «Запропонувати» — тихе посилання з лампочкою */
.topbar__idea{appearance:none;border:0;background:none;display:inline-flex;align-items:center;gap:6px;padding:4px 8px;margin-right:4px;cursor:pointer;
  font:inherit;font-size:14px;font-weight:600;color:var(--label-secondary);border-radius:var(--radius-md)}
.topbar__idea:hover{color:var(--accent-text);background:var(--accent-tint)}
@media (max-width:640px){.topbar__idea span{display:none}}
/* теми: те, що не зводиться до кольорів */
[data-theme="len"] body { font-size: 16px; line-height: 24px; }
[data-theme="len"] .ml th, [data-theme="len"] .ml td { padding-top: 8px; padding-bottom: 8px; }
[data-theme="len"] .ml thead .ml-sub th { top: 35px; }
[data-theme="briz"] .ml th, [data-theme="briz"] .ml td { padding-top: 7px; padding-bottom: 7px; }
[data-theme="briz"] .ml thead .ml-sub th { top: 33px; }
[data-theme="focus"] .ml th, [data-theme="focus"] .ml td { padding-top: 3px; padding-bottom: 3px; }
[data-theme="focus"] .ml thead .ml-sub th { top: 25px; }
[data-theme="focus"] .ml tbody tr:not(:has(.fr-xs--alert)) td { color: var(--label-secondary); }
[data-theme="focus"] .ml tbody tr:has(.fr-xs--alert) td { background: var(--danger-tint); }
/* перемикач теми */
.theme-pick{position:relative}
.theme-pick > summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--radius-md);color:var(--label-secondary)}
.theme-pick > summary::-webkit-details-marker{display:none}
.theme-pick > summary:hover,.theme-pick[open] > summary{background:var(--fill);color:var(--label)}
.theme-pick__menu{position:absolute;right:0;top:38px;z-index:30;min-width:250px;padding:8px;border-radius:var(--radius-xl);background:var(--surface-raised);box-shadow:var(--shadow-pop),var(--shadow-card)}
.theme-pick__menu p{margin:4px 8px 8px;font-size:13px;color:var(--label-secondary)}
.theme-pick__opt{appearance:none;display:flex;align-items:center;gap:10px;width:100%;padding:7px 8px;border:0;border-radius:var(--radius-md);background:none;cursor:pointer;font:inherit;font-size:14px;color:var(--label);text-align:left}
.theme-pick__opt:hover{background:var(--fill)}
.theme-pick__opt[aria-pressed="true"]{background:var(--accent-tint);font-weight:700}
.theme-pick__sw{flex:none;width:30px;height:20px;border-radius:5px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
.theme-pick__opt small{display:block;font-size:12px;font-weight:400;color:var(--label-secondary)}
.fin-link{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:6px}
.fin-link .fr-input{width:auto;font-size:13px;padding:2px 6px;height:28px}
.fin-link .fr-table__sub{flex-basis:100%}

/* «шаблон?» у колонці файлу — немає файлу для ФОПа, бо немає шаблону; стан «потрібна дія», не оздоблення */
.ml-tpl{color:var(--warning);font-weight:600;font-size:12px;text-decoration:underline;text-underline-offset:3px;margin-right:4px}
.ml-nofile{margin:0 0 var(--space-3)}
.tpl-bulk{display:grid;gap:var(--space-2);max-width:640px;margin:0 0 var(--space-5)}
.tpl-bulk .fr-btn{justify-self:start}

/* Календар Галини */
.cal-add{display:grid;grid-template-columns:2fr 1fr 1fr 1.4fr auto;gap:var(--space-3);align-items:end;margin:0 0 var(--space-5)}
@media (max-width:900px){.cal-add{grid-template-columns:1fr 1fr}.cal-add__text{grid-column:1/-1}}
.cal-add .fr-btn{height:40px}
.cal-task__date{min-width:92px;font-variant-numeric:tabular-nums;font-weight:600;color:var(--label-secondary)}
.cal-task__date--late{color:var(--danger)}
.cal-month{padding:var(--space-3) var(--space-4) var(--space-1);font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--label-tertiary)}
.cal-strip{border:1px solid var(--separator);border-radius:8px;padding:var(--space-2) var(--space-4);margin:0 0 var(--space-4);background:var(--surface)}
.cal-strip__head{display:flex;gap:var(--space-2);align-items:baseline;font-size:13px;margin-bottom:var(--space-1)}
.cal-strip__title{font-weight:700}
.cal-strip__item{display:flex;gap:var(--space-2);align-items:center;padding:var(--space-1) 0;border-top:1px solid var(--separator)}
.cal-strip__item:first-of-type{border-top:0}
.cal-strip__text{flex:1;font-size:14px}
.cal-strip__item--late .cal-strip__text b{color:var(--danger)}

/* «Не стосується» у «Вхідних»: розкривний вибір — лише лист чи й відправник */
.inbox-ignore{margin-top:var(--space-1)}
.inbox-ignore summary{font-size:13px;cursor:pointer}
.inbox-ignore form{display:grid;gap:var(--space-1);margin-top:var(--space-1);font-size:13px}
.inbox-ignore label{display:flex;gap:6px;align-items:center}
.inbox-ignore .fr-btn{justify-self:start}

/* лічильник листів, що потребують уваги, на закладці «Вхідні» */
.nav-count { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px;
  background: var(--red); color: var(--on-red); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
  vertical-align: 2px; font-variant-numeric: tabular-nums; }

/* «Фінанси», вкладка когорти: хто платить — кожен сам або когорта за всіх */
.fin-who { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-raised); border: 1px solid var(--separator); }
.fin-who__label { font-weight: 700; }
.fin-who__note { flex: 1 1 260px; font-size: 14px; }
