/* Base styles ported from the Apps Script version (Index.html). */
:root {
  --navy: #1F3864; --blue: #3756B0; --green: #3FA535; --bg: #F3F5F9; --card: #FFFFFF; --text: #1D2433;
  --muted: #5B6475; --line: #D6DCE8; --soft: #EAF0F8; --warn-bg: #FFF4C2; --warn: #8A6100; --bad: #C62828;
  --bad-bg: #FDE7E7; --ok: #1E7B34; --ok-bg: #DDF3E2; --draft-bg: #FFF1D6; --draft: #8A5A00;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 Arial, Helvetica, sans-serif; }
[hidden] { display: none !important; }
a { color: var(--blue); }
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: #fff;
  border-bottom: 3px solid var(--navy); position: sticky; top: 0; z-index: 20; }
.topbar .logo-link { display: flex; align-items: center; gap: 14px; }
.topbar .logo { height: 34px; width: auto; display: block; }
.topbar .logo-pv { padding-left: 14px; border-left: 1px solid var(--line); }
.topbar .spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox .who { text-align: right; line-height: 1.2; }
.userbox .who small { color: var(--muted); display: block; }
.mainnav { background: #fff; padding: 0 16px; margin: 0; position: sticky; top: 57px; z-index: 19; }
.mainnav a { display: inline-block; padding: 11px 14px; font-weight: bold; color: var(--muted); text-decoration: none;
  border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.mainnav a.active { color: var(--navy); border-bottom-color: var(--green); }
main { max-width: 1240px; margin: 0 auto; padding: 18px 16px 60px; }
h1 { font-size: 22px; color: var(--navy); margin: 0 0 14px; }
h2 { font-size: 17px; color: var(--navy); margin: 0; }
h3 { font-size: 15px; color: var(--navy); margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.narrow { max-width: 420px; margin: 40px auto; }
label { display: block; font-size: 12px; font-weight: bold; color: var(--muted); margin-bottom: 10px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 9px; border: 1px solid #C3CBDB;
  border-radius: 6px; font: inherit; color: var(--text); background: #fff; }
textarea { resize: vertical; min-height: 54px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(55, 86, 176, .35); border-color: var(--blue); }
input:disabled, select:disabled, textarea:disabled { background: #F6F7FA; color: #3a4252; }
.missing { background: var(--warn-bg) !important; border-color: #E0B400 !important; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px;
  border-radius: 6px; border: 1px solid #C3CBDB; background: #fff; color: var(--navy); font: inherit;
  font-weight: bold; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #2C478F; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { background: #2F8A27; }
.btn.danger { color: var(--bad); border-color: #E7B4B4; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.wide { width: 100%; }
.error { color: var(--bad); font-weight: bold; min-height: 18px; margin: 4px 0 8px; white-space: pre-line; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.err-text { color: var(--bad); font-weight: bold; }
.section-head h3 { margin: 0; }
.ms-head { font-size: 12px; font-weight: bold; color: var(--muted); margin: 4px 0 6px; }
label.check.ms-update { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.mat-list .tbl td { vertical-align: middle; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 16px; font: inherit; font-weight: bold; color: var(--muted);
  cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--green); }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.toolbar label { margin: 0; }
.toolbar .spacer { flex: 1; }
.datebox { display: flex; align-items: flex-end; gap: 6px; }
.datebox input { width: 160px; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: bold;
  background: var(--draft-bg); color: var(--draft); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.wait { background: #E9EDF5; color: var(--muted); }
.chip.new { background: var(--soft); color: var(--blue); }
.banner { padding: 10px 14px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); font-weight: bold;
  margin-bottom: 14px; }
.banner.corr { background: var(--warn-bg); color: var(--warn); border: 1px solid #E0B400; }
.changes { margin: 6px 0 12px 18px; padding: 0; max-height: 260px; overflow-y: auto; }
.changes li { margin: 3px 0; }
.hist { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.hist-item { margin: 6px 0; }
.hist-item details { margin: 2px 0 0 0; }
.hist-item summary { cursor: pointer; color: var(--blue); font-size: 12px; }
.att-item.del-pending a { text-decoration: line-through; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }
.grid .span2 { grid-column: span 2; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; margin-bottom: 14px; }
.kpi { background: var(--soft); border-radius: 8px; padding: 10px 8px; text-align: center; }
.kpi-v { font-size: 20px; font-weight: bold; color: var(--navy); }
.kpi-l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.contact { border-left: 4px solid var(--blue); }
.contact-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.contact-head .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 13px; }
.contact-head input { margin: 0; font-weight: bold; font-size: 15px; }
.contact-head .company { flex: 1 1 240px; min-width: 0; }
.nipbox { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.contact-head .nipbox input { width: 150px; font-weight: normal; font-size: 14px; }
.nip-info { font-size: 12px; margin: -4px 0 10px 38px; color: var(--muted); }
.nip-info.ok { color: var(--ok); }
.nip-info.warn { color: var(--warn); font-weight: bold; }
.nip-info.err { color: var(--bad); font-weight: bold; }
.invalid { border-color: var(--bad) !important; background: var(--bad-bg) !important; }
.att { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; border-top: 1px dashed var(--line);
  padding-top: 10px; margin-top: 2px; }
.att-title { font-size: 12px; font-weight: bold; color: var(--muted); margin-right: 2px; }
.att-where { font-weight: normal; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: normal; color: var(--text); }
label.check input { display: inline-block; width: auto; margin: 0; }
.hint.ok { color: var(--ok); }
.hint.warn { color: var(--warn); font-weight: bold; }
.att-list { display: contents; }
.att-item { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; background: var(--soft);
  border: 1px solid #D5DEEE; border-radius: 999px; padding: 2px 2px 2px 10px; font-size: 12px; }
.att-item a { color: var(--navy); font-weight: bold; text-decoration: none; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 280px; }
.att-item a:hover { text-decoration: underline; }
.att-item .size { color: var(--muted); white-space: nowrap; margin-left: 4px; }
.att-del { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1;
  padding: 2px 7px; border-radius: 50%; }
.att-del:hover { background: var(--bad-bg); color: var(--bad); }
.att-add { position: relative; overflow: hidden; margin: 0; }
.att-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; margin: 0; padding: 0; }
.att-add.busy { opacity: .6; pointer-events: none; }
.att-status { font-size: 12px; color: var(--muted); }
.att-empty { font-size: 12px; color: var(--muted); }
.att-mini { margin-top: 4px; font-size: 12px; }
.att-mini a { display: inline-block; margin-right: 8px; color: var(--blue); }
.actions-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.tbl th { background: var(--navy); color: #fff; text-align: left; padding: 7px 8px; font-size: 12px; white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
.tbl tr:nth-child(even) td { background: #FAFBFD; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl td.clickable { cursor: pointer; }
.tbl td.clickable:hover { background: var(--soft); }
.tbl .overdue td:first-child { color: var(--bad); font-weight: bold; }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.person h3 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.person .stats { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.person .kpis { margin: 0; grid-template-columns: repeat(3, 1fr); }
.person.total { border-color: var(--navy); }
.linkbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkbox code { background: var(--soft); padding: 6px 8px; border-radius: 6px; word-break: break-all; flex: 1; min-width: 200px; }
.pwd { font: bold 22px/1.2 'Courier New', monospace; letter-spacing: 2px; color: var(--navy); background: var(--soft);
  padding: 10px; border-radius: 8px; text-align: center; margin: 8px 0 12px; }
.overlay { position: fixed; inset: 0; background: rgba(255, 255, 255, .55); z-index: 90; display: flex;
  align-items: center; justify-content: center; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--soft); border-top-color: var(--blue); border-radius: 50%;
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: min(680px, 92vw);
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 8px; z-index: 100; white-space: pre-line;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--bad); }
.toast.warn { background: #9A6A00; }
.toast .toast-action { margin-left: 10px; background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .6); }
.modal { position: fixed; inset: 0; background: rgba(20, 28, 45, .45); z-index: 80; display: flex;
  align-items: flex-start; justify-content: center; padding: 30px 12px; overflow-y: auto; }
.modal-card { background: #fff; border-radius: 10px; width: min(760px, 100%); padding: 18px 20px; }
.modal-card.wide { width: min(1180px, 100%); }
.modal-card h2 { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.pre { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.btn .sm { display: none; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
@media (max-width: 640px) {
  .topbar { padding: 8px 10px; gap: 8px; }
  .topbar .logo-link { gap: 8px; }
  .topbar .logo { height: 22px; }
  .topbar .logo-pv { padding-left: 8px; }
  .userbox .who, .btn .lg { display: none; }
  .btn .sm { display: inline; }
  .userbox { gap: 6px; }
  .mainnav { top: 45px; padding: 0 6px; }
  .mainnav a { padding: 10px 9px; }
  main { padding: 14px 10px 50px; }
  .tabs button { padding: 10px 10px; }
  .grid .span2 { grid-column: auto; }
  .contact-head .company { flex-basis: 120px; }
  .nipbox { order: 5; flex: 1 1 100%; }
  .contact-head .nipbox input { flex: 1; width: auto; }
  .nip-info { margin-left: 0; }
  .person .kpis { grid-template-columns: repeat(2, 1fr); }
  .datebox input { width: 140px; }
}
@media print {
  .topbar, .mainnav, .toolbar, .actions-bar, .btn { display: none !important; }
  main { max-width: none; padding: 0; }
}
/* View-specific sections are appended below by view authors. */
/* === report view === */
.contact-head .co-link { font-size: 12px; font-weight: bold; white-space: nowrap; text-decoration: none; }
.contact-head .co-link:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .contact-head .co-link { order: 6; }
  #reportView .toolbar > .btn { flex: 1 1 auto; }
}
/* === end report view === */

/* === auth, history, tasks, companies (Agent G2) === */
.auth-links { margin: 12px 0 0; text-align: center; font-size: 13px; }
.hist-export h3 { margin-bottom: 10px; }
.hist-export .toolbar { margin-bottom: 8px; }
.hist-export input[type=date] { width: 160px; }
.tbl .due-today td:first-child { color: var(--blue); font-weight: bold; }
.co-search .co-q { flex: 1 1 280px; }
.co-tbl tr.co-row { cursor: pointer; }
.co-tbl tr.co-row:hover td { background: var(--soft); }
.co-back { margin: 0 0 8px; }
.co-card .section-head { align-items: flex-start; flex-wrap: wrap; }
.co-title { margin: 0; word-break: break-word; }
.co-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.co-infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; margin-top: 6px; }
.co-info > span, .co-notes > span { display: block; font-size: 12px; font-weight: bold; }
.co-info div { word-break: break-word; }
.co-notes { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.co-task { border-left: 4px solid var(--green); }
.co-task.overdue { border-left-color: var(--bad); }
.co-task.none { border-left-color: var(--line); }
.co-task .section-head { margin-top: 0; }
.co-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.co-tl-item { position: relative; padding: 0 0 14px 12px; }
.co-tl-item::before { content: ''; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--blue); border: 2px solid #fff; }
.co-tl-head { margin-bottom: 2px; }
.co-tl-link { font-size: 12px; margin-left: 6px; }
.co-tl-outcome { margin: 4px 0; }
.co-tl-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.co-tl-desc { font-size: 13px; margin-top: 2px; }
.co-tl-item .att-mini .muted { margin-right: 8px; }
.co-merge-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.co-merge-list label.check { margin: 0 0 6px; align-items: flex-start; }
@media (max-width: 640px) {
  .hist-export input[type=date] { width: 140px; }
  .co-timeline { padding-left: 10px; }
}
/* === end auth, history, tasks, companies === */

/* === admin views (dashboard, reports, users, settings, email-log, import) === */
.dash-matrix td.clickable .chip { text-decoration: underline dotted; }
.set-guide { background: var(--soft); border-radius: 8px; padding: 10px 12px; margin-top: 14px; line-height: 1.5; }
.set-guide code { background: #fff; padding: 1px 5px; border-radius: 4px; }
.set-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 14px; }
.set-lists textarea { font: 13px/1.45 Arial, Helvetica, sans-serif; min-height: 180px; }
.set-audit { max-height: 520px; overflow-y: auto; }
.set-detail { word-break: break-word; max-width: 460px; font-size: 12px; }
.el-to { word-break: break-all; max-width: 240px; }
.el-extra { font-size: 12px; margin-top: 3px; }
.el-err { font-size: 12px; font-weight: normal; margin-top: 4px; max-width: 320px; word-break: break-word; }
.el-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.el-pm > td { background: var(--soft); }
.el-pm-box { display: grid; gap: 8px; justify-items: start; padding: 4px 0; }
.el-pm-head { font-size: 13px; }
.el-pm-rcpt { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.el-pm-ev { font-size: 12px; width: 100%; }
.el-pm-ev td { word-break: break-word; }
.imp-steps { margin: 0 0 6px 18px; padding: 0; }
.imp-steps li { margin: 4px 0; }
.imp-errors { max-height: 260px; overflow-y: auto; margin-bottom: 12px; }
.imp-preview { max-height: 480px; overflow: auto; }
.imp-preview td { font-size: 12px; max-width: 260px; word-break: break-word; }
@media (max-width: 640px) {
  .set-lists { grid-template-columns: 1fr; }
}
/* === nip check === */
.nc { max-width: 760px; margin: 0 auto; }
.nc-form { display: flex; gap: 8px; margin-bottom: 14px; }
.nc-form input { margin: 0; font-size: 20px; padding: 12px 14px; letter-spacing: 1px; }
.nc-form .btn { padding: 0 22px; }
.nc-result { border-left: 6px solid var(--line); }
.nc-free { border-left-color: var(--green); }
.nc-mine { border-left-color: var(--blue); }
.nc-taken { border-left-color: var(--bad); }
.nc-status { font-size: 24px; font-weight: bold; }
.nc-free .nc-status { color: var(--ok); }
.nc-mine .nc-status { color: var(--blue); }
.nc-taken .nc-status { color: var(--bad); }
.nc-line { font-size: 15px; margin: 2px 0 12px; }
.nc-company { margin-bottom: 10px; }
.nc-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 12px; }
.nc-facts dt { color: var(--muted); font-size: 12px; font-weight: bold; padding-top: 2px; }
.nc-facts dd { margin: 0; }
.nc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nip-info.taken { color: var(--bad); font-weight: bold; }
@media (max-width: 640px) { .nc-form input { font-size: 18px; } .nc-facts { grid-template-columns: 1fr; } }
@media (max-width: 400px) {
  .topbar .logo-pv { display: none; }
}

/* Do obdzwonienia */
.tbl.calls .call-due { width: 130px; padding: 4px 6px; }
.tbl.calls .overdue .call-due { color: var(--bad); font-weight: bold; }
.tbl.calls .due-today .call-due { color: var(--blue); font-weight: bold; }
.tbl.calls .call-act { display: flex; flex-direction: column; gap: 6px; }
.tbl .small { font-size: 12px; }
.call-more summary, .call-lists summary, .call-map summary { cursor: pointer; color: var(--blue); font-size: 12px; margin-top: 4px; }
.call-more dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 12px; max-width: 520px; }
.call-more dt { color: var(--muted); }
.call-more dd { margin: 0; overflow-wrap: anywhere; }
.call-lists { margin-top: 12px; }
.call-map .grid { margin-top: 8px; }
.toolbar label.grow { flex: 1; min-width: 220px; }
.autosave { font-size: 12px; color: var(--muted); align-self: center; }
.autosave.ok { color: var(--ok); }
.autosave.err { color: var(--bad); font-weight: bold; }

/* report: second "+ Dodaj kontakt" under the cards */
.add-bottom { display: flex; justify-content: center; margin: 2px 0 16px; }
.add-bottom .btn { min-width: 240px; }

/* material sets */
.mat-set { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.mat-set-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mat-set-head .mat-name { flex: 1; font-weight: bold; font-size: 15px; }
.mat-msg summary { cursor: pointer; color: var(--blue); font-size: 13px; margin-top: 10px; }
.ms-sets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.ms-set { display: inline-flex; margin: 0; cursor: pointer; position: relative; }
.ms-set input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.ms-set span { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: bold; color: var(--text); background: var(--card); }
.ms-set input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.ms-set input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* === GPR Magazyny === */
.app-name { font-weight: bold; color: var(--navy); font-size: 15px; padding-left: 14px; border-left: 1px solid var(--line); white-space: nowrap; }
@media (max-width: 1080px) { .app-name { display: none; } }
@media (min-width: 641px) and (max-width: 900px) { .topbar .logo { height: 28px; } }
h4.chart-title { font-size: 13px; color: var(--navy); margin: 14px 0 4px; }
.detail-head { margin: 22px 0 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.actions-bar.left { justify-content: flex-start; }
.w-num { width: 90px; display: inline-block; margin: 0; }
.co-row.sel td { background: var(--soft) !important; }
tr.sel td { background: var(--soft); }
tr.inactive td { color: var(--muted); }
.file-map { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 2px; margin-top: 10px; }
.file-map-head { margin-bottom: 8px; }
.profile-sum { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.period-edit summary { cursor: pointer; color: var(--blue); font-size: 13px; margin: 6px 0; }
.tariff-rates { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; background: var(--soft); border-radius: 8px; padding: 8px 12px; margin-top: 8px; }
.tariff-tbl td.zones { display: flex; flex-wrap: wrap; gap: 8px; }
.tariff-tbl td.zones label { margin: 0; font-weight: normal; }
.tariff-tbl td.zones input { width: 90px; }
.calc-bar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 10px; margin-bottom: 0;
  border-top: 2px solid var(--navy); border-radius: 0; }
.calc-bar .spacer { flex: 1; }
.calc-status { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--navy); font-weight: bold; }
.calc-status progress { width: 180px; accent-color: var(--blue); }
.notes { margin: 10px 0 0 18px; padding: 0; font-size: 13px; }
.notes li { margin: 4px 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; }
.facts { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: bold; text-align: right; white-space: nowrap; }
.assume { margin: 0 0 0 18px; padding: 0; font-size: 13px; }
.assume li { margin: 4px 0; }
.day-nav { display: flex; gap: 6px; align-items: center; }
.day-nav input { width: 160px; margin: 0; }
/* charts */
.chart { width: 100%; min-height: 40px; }
.chart-svg { display: block; overflow: visible; }
.chart-canvas { display: block; }
.chart-tick { font: 11px Arial, Helvetica, sans-serif; fill: var(--muted); }
.chart-label { font: 13px Arial, Helvetica, sans-serif; fill: var(--text); }
.chart-value { font: bold 13px Arial, Helvetica, sans-serif; fill: var(--text); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-key { display: inline-block; width: 16px; height: 0; border-top: 2px solid; }
.lg-key.dash { border-top-style: dashed; }
.lg-key.bar { height: 10px; border: 0; border-radius: 2px; width: 12px; }
.chart-tip { position: absolute; z-index: 120; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px;
  box-shadow: 0 6px 20px rgba(20, 28, 45, .14); font-size: 12px; pointer-events: none; max-width: 300px; }
.chart-tip-title { color: var(--muted); margin-bottom: 4px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-tip-key { display: inline-block; width: 14px; border-top: 2px solid; }
.chart-tip-key.dash { border-top-style: dashed; }
.chart-data summary { cursor: pointer; color: var(--blue); font-size: 12px; margin-top: 8px; }
.chart-data .tbl { margin-top: 6px; }
/* client report */
.report-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.report { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px 32px; max-width: 980px; margin: 0 auto; }
.report-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--navy); padding-bottom: 12px; margin-bottom: 18px; }
.report-head .logo { height: 34px; margin-right: 14px; vertical-align: middle; }
.report-meta { text-align: right; color: var(--muted); font-size: 12px; }
.report h1 { font-size: 24px; margin-bottom: 4px; }
.report h2 { margin: 22px 0 8px; }
.report .big { font-size: 17px; }
table.kv { border-collapse: collapse; width: 100%; max-width: 620px; font-size: 14px; }
.kv th { text-align: left; font-weight: normal; color: var(--muted); padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); width: 46%; }
.kv td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.disclaimer { font-size: 11px; color: var(--muted); margin-top: 12px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .app-name { display: none; }
  .calc-status progress { width: 100px; }
  .report { padding: 16px; }
}
@media print {
  body { background: #fff; }
  .report-tools, .chart-data { display: none !important; }
  .report { border: 0; padding: 0; max-width: none; }
  .page-break { break-before: page; }
  section { break-inside: avoid; }
}
p.lead { font-size: 15px; line-height: 1.55; margin: 4px 0 6px; max-width: 900px; }
.tbl.compact td, .tbl.compact th { padding: 6px 8px; }
.att .att-add { margin: 0; }
.var-tbl td:first-child { min-width: 210px; }
