#overview h3 {
  margin-top: 20px;
}
.period-bar {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(80px, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 12px 0;
}
.period-bar button {
  justify-content: flex-start;
  text-align: left;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.period-bar svg {
  width: 100%;
}
.period-bar span {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tax-check {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
@media (max-width: 600px) {
  .period-bar {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #192331;
  background: #f6f7f9;
  font-synthesis: none;
  --muted: #5a6675;
  --line: #e0e5eb;
  --blue: #245edb;
  --red: #b32738;
  --amber: #875806;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}
button,
input,
a {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid #d3dae4;
  background: white;
  color: #243246;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.35;
  font-weight: 550;
}
button:hover,
.button:hover {
  background: #f0f4fa;
  border-color: #aebed3;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary {
  background: #182a43;
  color: white;
  border-color: #182a43;
}
.primary:hover {
  background: #274363;
  border-color: #274363;
}
.danger {
  color: var(--red);
}
.link {
  border: 0;
  background: none;
  color: var(--blue);
  padding-left: 0;
}
a {
  color: var(--blue);
}
:focus-visible {
  outline: 3px solid #3579ed;
  outline-offset: 3px;
}
.skip {
  position: fixed;
  top: -60px;
  left: 10px;
  background: white;
  padding: 10px;
  z-index: 9;
}
.skip:focus {
  top: 10px;
}
.topbar {
  min-height: 76px;
  padding: 16px 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #192331;
  text-decoration: none;
  font-weight: 650;
  font-size: 18px;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  background: #192b43;
  color: white;
  border-radius: 8px;
  font-size: 19px;
}
.brand-note {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  border-left: 1px solid var(--line);
  margin-left: 7px;
  padding-left: 15px;
}
#account {
  display: flex;
  align-items: center;
  gap: 18px;
}
.shop {
  max-width: 220px;
  overflow-wrap: anywhere;
}
main {
  max-width: 1660px;
  margin: 0 auto;
  padding: 36px 4% 50px;
  min-height: 76vh;
}
h1,
h2,
h3,
p {
  margin: 0 0 12px;
}
h1 {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -1px;
  font-weight: 650;
}
h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
p {
  color: #4e5e70;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  display: block;
  color: #5e6f85;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}
.panel {
  padding: 23px;
  background: white;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px #dfe5ec,
    0 2px 3px #182a4304;
  margin-bottom: 20px;
  min-width: 0;
}
.page-heading,
.report-heading,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
.page-heading > button {
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.workspace > aside {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: 20px;
}
.workspace > aside .panel { margin-bottom: 0; }
.workspace > aside #report-list { max-height: 240px; overflow-y: auto; }
.workspace > :not(aside) { min-width: 0; width: 100%; }
@media (max-width: 760px) {
  .workspace > aside { grid-template-columns: minmax(0, 1fr); }
}
aside {
  min-width: 0;
}
.upload {
  border-top: 3px solid #2d5b91;
}
.upload p,
.upload details {
  font-size: 12px;
}
.upload .primary {
  width: 100%;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 550;
  color: #48576a;
  margin-bottom: 14px;
}
input {
  display: block;
  margin-top: 7px;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cbd4e0;
  border-radius: 6px;
  background: white;
  color: #152638;
}
input::placeholder {
  color: #69788a;
}
input[readonly] {
  background: #f4f6f9;
}
input[type="file"] {
  font-size: 12px;
  padding: 10px 7px;
  border: 1px dashed #9aaec7;
  background: #f8faff;
}
input::file-selector-button {
  border: 0;
  background: #e8eef7;
  color: #294c7d;
  padding: 6px;
  border-radius: 4px;
  margin-right: 6px;
}
.history {
  padding: 20px;
}
.history h2 {
  font-size: 17px;
}
.history label {
  display: inline-block;
  width: 48%;
  margin-right: 1%;
  font-size: 11px;
}
.history input {
  font-size: 11px;
  padding: 7px;
}
.report-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 7px;
  overflow-wrap: anywhere;
}
.report-item strong,
.report-item span,
.report-item small {
  display: block;
}
.report-item strong {
  font-size: 13px;
}
.report-item span {
  font-size: 11px;
  color: #647388;
  margin-top: 5px;
}
.report-item small {
  font-size: 10px;
}
.report-item.selected {
  background: #edf3ff;
  box-shadow: inset 3px 0 #306acf;
}
.empty {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px;
}
.empty p {
  max-width: 430px;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  background: #edf2f9;
  color: #456791;
  border-radius: 14px;
  font-size: 30px;
  margin-bottom: 24px;
}
.report-heading h2 {
  font-size: 25px;
}
.report-heading p {
  margin: 0;
  font-size: 12px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.basis {
  padding: 0 0 16px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.basis strong {
  font-size: 13px;
}
.basis p {
  font-size: 12px;
  margin: 6px 0 0;
}
.warning {
  background: #fff7e8;
  color: #775009;
  border: 1px solid #efdab3;
  border-radius: 7px;
  padding: 15px 18px;
  margin-bottom: 22px;
  font-size: 12px;
}
.warning p {
  color: inherit;
  margin: 5px 0 0;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 23px;
}
.kpi {
  margin: 0;
  padding: 21px 18px;
}
.kpi > span {
  color: var(--muted);
  font-size: 12px;
}
.kpi .amount {
  display: block;
  font-size: 25px;
  letter-spacing: -0.6px;
  padding: 8px 0;
  text-align: left;
  line-height: 1.3;
  font-weight: 650;
  white-space: normal;
}
.kpi small {
  font-size: 10px;
  display: block;
}
.amount {
  border: 0;
  background: transparent;
  padding: 3px 0;
  min-height: 32px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  border-radius: 3px;
  color: #153454;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 5px;
}
.amount:hover {
  background: #edf3fa;
}
.amount.negative {
  color: var(--red);
}
.amount.unknown {
  color: #667384;
  font-size: 13px;
  font-weight: 450;
}
.charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.chart {
  padding: 18px 14px;
}
.chart h3 {
  font-size: 12px;
}
.chart svg {
  width: 100%;
  height: auto;
  display: block;
  color: #356fa9;
}
.chart svg text {
  font-family: inherit;
  font-size: 10px;
  fill: #647388;
}
.chart circle {
  fill: #356fa9;
}
.chart .loss-point {
  fill: var(--red);
}
.chart summary {
  font-size: 11px;
  color: var(--muted);
}
summary {
  cursor: pointer;
  padding: 6px 0;
  font-weight: 550;
}
.daily-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}
.daily-row .amount {
  font-size: 11px;
}
.inline-cost {
  display: grid;
  grid-template-columns:
    minmax(150px, 1.2fr) minmax(110px, 1fr) minmax(140px, 1fr)
    auto;
  gap: 12px;
  align-items: end;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.inline-cost label {
  margin: 0;
}
.inline-cost button {
  font-size: 12px;
}
.economics .section-heading {
  margin-bottom: 12px;
}
.section-heading h2,
.section-heading p {
  margin-bottom: 4px;
}
.section-heading p {
  font-size: 12px;
}
.section-heading label {
  margin: 0;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
  border-radius: 5px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  text-align: left;
}
th {
  font-weight: 550;
  background: #f6f8fb;
  color: #53647a;
  white-space: nowrap;
}
th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th button {
  border: 0;
  min-height: 28px;
  background: none;
  padding: 0;
  font-size: 11px;
  color: inherit;
}
tbody tr:hover {
  background: #f8faff;
}
td .article {
  font-size: 12px;
  border: 0;
  padding: 3px 0;
  min-height: 32px;
  background: none;
  text-align: left;
  max-width: 220px;
  overflow-wrap: anywhere;
  color: #285b93;
}
td .amount {
  font-size: 12px;
}
.expense-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-top: 16px;
}
.expense-grid > div {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: #f7f8fa;
  border-radius: 6px;
  min-width: 0;
}
.expense-grid span {
  font-size: 12px;
  color: var(--muted);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  color: #47596c;
  max-height: 350px;
  overflow: auto;
}
code {
  overflow-wrap: anywhere;
}
.settings {
  border-top: 3px solid #526c92;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 35px;
  margin-bottom: 20px;
}
.settings-grid section {
  max-width: 580px;
}
.settings-grid p {
  font-size: 12px;
}
.settings-grid input[type="number"] {
  max-width: 180px;
}
dialog {
  border: 1px solid #d8e0e9;
  border-radius: 12px;
  max-width: 94vw;
  width: 1200px;
  max-height: 85vh;
  padding: 28px;
  box-shadow: 0 25px 100px #11233a33;
}
dialog::backdrop {
  background: #18273d99;
}
dialog .table-scroll {
  max-height: 55vh;
}
dialog > form {
  margin-top: 22px;
}
dialog td {
  max-width: 370px;
  overflow-wrap: anywhere;
}
dialog p {
  font-size: 12px;
}
.notice:empty {
  display: none;
}
.notice {
  padding: 13px 4%;
  background: #eaf3ed;
  color: #215e37;
  border-bottom: 1px solid #c5ddcd;
  position: sticky;
  top: 0;
  z-index: 5;
  font-size: 13px;
}
.notice.error {
  color: #9d2435;
  background: #fff0f0;
  border-color: #efc7cd;
}
progress {
  width: 100%;
  accent-color: #245edb;
  margin-top: 16px;
}
footer {
  max-width: 1660px;
  margin: auto;
  padding: 22px 4%;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.auth-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  max-width: 1030px;
  margin: 7vh auto;
  gap: 100px;
  align-items: center;
}
.intro h1 {
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: -1.7px;
  margin-bottom: 24px;
}
.intro > p {
  font-size: 15px;
  line-height: 1.7;
}
.intro ol {
  list-style: none;
  padding: 0;
  counter-reset: step;
  margin: 30px 0;
}
.intro li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  color: #374d68;
  font-size: 13px;
}
.intro li:before {
  content: counter(step);
  display: grid;
  place-items: center;
  background: white;
  border: 1px solid #d8e1ed;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 12px;
  font-weight: 600;
}
.intro .muted {
  font-size: 12px;
  max-width: 360px;
}
.auth-card {
  padding: 32px;
}
.auth-card p {
  font-size: 12px;
  margin-bottom: 25px;
}
.auth-card .primary {
  width: 100%;
  margin-top: 8px;
}
.auth-card .link {
  font-size: 12px;
  margin-top: 15px;
}
.loading {
  padding: 60px;
  text-align: center;
}
@media (min-width: 1600px) {
  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .charts {
    grid-template-columns: 1fr;
  }
  .chart svg {
    max-height: 190px;
  }
  .inline-cost {
    grid-template-columns: 1fr 1fr;
  }
  .kpi .amount {
    font-size: 21px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .report-heading {
    align-items: start;
  }
  .expense-grid {
    grid-template-columns: 1fr 1fr;
  }
  .auth-layout {
    gap: 45px;
  }
}
@media (max-width: 850px) {
  main {
    padding: 26px 20px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .workspace aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .brand-note {
    display: none;
  }
  .auth-layout {
    margin: 25px auto;
    gap: 25px;
  }
  .intro h1 {
    font-size: 34px;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading > button {
    max-width: 170px;
  }
  .charts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .chart {
    padding: 12px;
  }
  .inline-cost {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .topbar {
    padding: 12px 18px;
    min-height: 66px;
  }
  .brand {
    font-size: 15px;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
  }
  #account {
    gap: 7px;
  }
  .shop {
    font-size: 11px;
    max-width: 100px;
  }
  #account button {
    padding: 8px;
    font-size: 12px;
    min-height: 38px;
  }
  main {
    padding: 24px 16px;
  }
  h1 {
    font-size: 27px;
  }
  .page-heading {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
  }
  .page-heading > button {
    max-width: 100%;
  }
  .page-heading p {
    font-size: 12px;
  }
  .workspace aside {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .history {
    max-height: 350px;
    overflow: auto;
  }
  .empty {
    min-height: 300px;
    padding: 30px 20px;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi {
    padding: 16px 12px;
  }
  .kpi .amount {
    font-size: 20px;
  }
  .kpi .amount.unknown {
    font-size: 13px;
  }
  .charts {
    grid-template-columns: 1fr;
  }
  .chart {
    padding: 18px;
  }
  .report-heading {
    flex-direction: column;
    gap: 12px;
  }
  .report-heading h2 {
    font-size: 22px;
  }
  .panel {
    padding: 18px;
  }
  .section-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .inline-cost {
    grid-template-columns: 1fr;
  }
  .inline-cost button {
    margin-top: 4px;
  }
  .expense-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 0;
  }
  .intro h1 {
    font-size: 32px;
  }
  .intro ol {
    display: none;
  }
  .intro > p {
    font-size: 13px;
  }
  .intro .muted {
    margin-bottom: 0;
  }
  .auth-card {
    padding: 25px;
  }
  .auth-card h2 {
    font-size: 21px;
  }
  dialog {
    padding: 18px;
    width: 96vw;
    max-width: 96vw;
  }
  .basis p {
    line-height: 1.6;
  }
  .settings-grid {
    gap: 20px;
  }
  .economics {
    padding: 17px 12px;
  }
  .table-scroll {
    border: 1px solid var(--line);
  }
  .charts .table-scroll {
    border: 0;
  }
  footer {
    padding: 20px 16px;
  }
  .auth-card .link {
    white-space: normal;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  a {
    transition:
      background 0.12s,
      border-color 0.12s;
  }
}

.profit-total{border:2px solid #344054;padding:24px;margin:16px 0;background:#f8fafc}.profit-total h2{margin:8px 0}.profit-total .profit-amount button{font-size:clamp(28px,4vw,44px);font-weight:800}.profit-total p,#advertising-total p{max-width:950px;line-height:1.5}

svg [data-source="day"]{cursor:pointer;stroke:transparent;stroke-width:12;pointer-events:all}svg [data-source="day"]:hover,svg [data-source="day"]:focus{stroke:#799ac666;outline:none}

#chart-tooltip{position:fixed;z-index:10000;pointer-events:none;background:#172b43;color:white;padding:10px 14px;border-radius:8px;max-width:280px;box-shadow:0 3px 15px #0003}.detail-filters{display:flex;flex-wrap:wrap;gap:16px;align-items:end}.detail-filters label{flex:1;min-width:200px}.detail-filters select{display:block;width:100%;padding:10px;margin-top:7px;border:1px solid #cbd4e0;border-radius:6px;background:white}[hidden]{display:none!important}

.revenue-contribution{background:#e2f0ff;font-weight:700;color:#133e70}

.column-filters input{width:100%;min-width:90px;box-sizing:border-box;padding:7px;font-size:12px}.column-filters th{padding:6px;position:static}.column-filter-status{font-size:12px;color:#58677a}

.excel-filter-button{padding:2px 5px;margin-left:6px;font-size:11px;background:#eef1f4;color:#345;min-width:22px}.excel-filter-button.filter-active{background:#d0e6ff;color:#065cbd}.excel-filter-menu{position:fixed;z-index:10001;width:310px;max-height:475px;overflow:auto;box-sizing:border-box;background:white;color:#15263d;border:1px solid #b9c5d4;border-radius:8px;padding:12px;box-shadow:0 8px 30px #0004}.excel-filter-menu label{display:block;font-size:13px;margin:6px 0}.excel-filter-menu input[type=checkbox]{width:auto;display:inline-block;margin:0 5px 0 0}.excel-filter-menu input[type=search]{width:100%;box-sizing:border-box;padding:6px}.excel-values{max-height:170px;overflow:auto;border:1px solid #dde4ed;padding:4px}.excel-values label{overflow-wrap:anywhere}.excel-sort,.excel-actions{display:flex;gap:5px;margin:8px 0}.excel-filter-menu button{padding:6px;font-size:12px}

.excel-filter-menu input[type=checkbox]{min-height:0;height:15px;width:15px;min-width:15px;padding:0;margin:0;flex:0 0 15px;vertical-align:middle}
.excel-filter-menu .excel-values label,.excel-filter-menu label:has(>input[type=checkbox]){display:flex;align-items:center;gap:7px;margin:0;padding:3px 2px;min-height:22px;line-height:1.25;font-weight:400}
.excel-filter-menu .excel-values{padding:3px 5px}

.report-history-row{display:flex;align-items:center;gap:8px}
/* History controls explicitly override general full-width input/label rules. */
.history{min-width:0;max-width:100%;overflow:hidden}
.history-date-range{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.history .history-date-range label{display:block;width:auto;min-width:0;margin:0}
.history .history-date-range input{box-sizing:border-box;width:100%;max-width:100%;min-width:0;padding:7px 3px;min-height:38px}
.history-help{font-size:12px;line-height:1.5;color:#526176}
.history .report-history-row{display:grid;grid-template-columns:18px minmax(0,1fr);gap:6px 10px;align-items:start;padding:12px 0;border-top:1px solid var(--line)}
.history input[data-select-report]{box-sizing:border-box;width:18px;height:18px;min-height:0;max-height:18px;min-width:18px;max-width:18px;flex:0 0 18px;padding:0;margin:4px 0 0;accent-color:var(--accent,#356fa9)}
.history .report-history-row .report-item{min-width:0;width:100%;max-width:none;overflow-wrap:anywhere;white-space:normal;border:0;padding:0;text-align:left}
.history .report-history-row .report-delete{grid-column:2;justify-self:start;font-size:11px;padding:4px 8px;min-height:28px;margin-top:3px}
.history .report-item .history-open{color:#285fa3;font-weight:600}
#selected-report-names{width:100%;margin:0;padding-left:18px;font-size:11px;overflow-wrap:anywhere;max-height:140px;overflow:auto}
#selected-report-names:empty{display:none}
#report-selection{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}#report-selection p{width:100%;margin:0}#report-selection .primary{width:100%}
.source-filename{display:block;white-space:normal;overflow-wrap:anywhere;font-size:11px;color:var(--muted,#677586)}.report-history-row .report-item{flex:1;min-width:0}.report-history-row .report-delete{flex:0 0 auto;padding:8px 12px}

.report-tax-settings{border-top:1px solid #dbe2eb;margin-top:20px;padding-top:16px}.report-tax-settings form{max-width:720px}.report-tax-settings select{display:block;width:100%;padding:10px;margin:6px 0 12px}.tax-checkbox{display:flex;gap:8px;align-items:center}.tax-checkbox input[type=checkbox]{width:16px;height:16px;min-height:0;padding:0;margin:0;flex:0 0 16px}

#source-dialog.profit-details{width:calc(100vw - 32px);max-width:calc(100vw - 32px);box-sizing:border-box;padding:20px;max-height:94vh}
#source-dialog.profit-details .table-scroll{max-height:65vh;width:100%}
#source-dialog .profit-fit-table{table-layout:fixed;width:100%;min-width:0;font-size:12px}
#source-dialog .profit-fit-table th{white-space:normal;overflow-wrap:anywhere;line-height:1.3}
#source-dialog .profit-fit-table th,#source-dialog .profit-fit-table td{padding:9px 7px;box-sizing:border-box;max-width:none}
#source-dialog .profit-fit-table td:nth-child(1),#source-dialog .profit-fit-table td:nth-child(2){white-space:normal;overflow-wrap:anywhere}
#source-dialog .profit-fit-table td:nth-child(n+3){white-space:nowrap;text-align:right;overflow-wrap:normal;font-variant-numeric:tabular-nums}
#source-dialog .profit-fit-table th:nth-child(n+3){text-align:right}
#source-dialog .profit-fit-table .excel-filter-button{margin-left:3px;min-height:22px;padding:1px 3px}
@media(max-width:760px){#source-dialog.profit-details{padding:12px;width:calc(100vw - 16px);max-width:calc(100vw - 16px)}#source-dialog .profit-fit-table{font-size:11px}#source-dialog .profit-fit-table td:nth-child(n+3){white-space:normal;overflow-wrap:anywhere}}

/* All columns remain visible; numeric cells are fitted on one line. */
#source-dialog{width:calc(100vw - 32px);max-width:calc(100vw - 32px);box-sizing:border-box;padding:20px;max-height:94vh}
#source-dialog .table-scroll{width:100%;max-height:65vh}
table{table-layout:fixed;width:100%;min-width:0}
.table-scroll th,.table-scroll td,#source-content th,#source-content td{min-width:0;max-width:none;white-space:normal;overflow-wrap:anywhere;padding:9px 6px;line-height:1.35}
.table-scroll th button,#source-content th button{white-space:normal;overflow-wrap:anywhere;max-width:100%}
.table-scroll td .amount,.table-scroll td .article{white-space:normal;overflow-wrap:anywhere;max-width:100%;min-width:0}
#source-content,#report,.table-scroll{min-width:0}
/* Selected-report decision dashboard. */
.currency-note{font-size:12px;color:var(--muted)}
.kpis{grid-template-columns:repeat(7,minmax(0,1fr));gap:10px}
.kpi{padding:16px 12px}.kpi .amount,.kpi .metric-value{font-size:clamp(16px,1.7vw,25px);font-weight:650;display:block;padding:8px 0;white-space:nowrap;letter-spacing:-.4px}
.kpi .unknown,.kpi .metric-value{white-space:normal}.kpi .unknown{font-size:13px}
.waterfall-grid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:0;margin:20px 0}
.waterfall-grid svg{width:100%;display:block;overflow:visible}
.waterfall-label{display:flex;flex-direction:column;justify-content:flex-start;width:100%;border:0;padding:8px 3px;min-height:105px;text-align:center;font-size:11px;overflow-wrap:anywhere;background:transparent}
.waterfall-label strong{font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
.zero-line{stroke:#94a3b8;stroke-width:1}.waterfall-connector{stroke:#94a3b8;stroke-dasharray:3 2;stroke-width:1}
.total-bar{fill:#356fa9}.loss-bar{fill:#b45360;background:#b45360}.gain-bar{fill:#32846d;background:#32846d}
.ranking-toggle{display:flex;gap:4px}.ranking-toggle [aria-pressed=true]{background:#192b43;color:white}
.ranking-list{display:grid;gap:8px;margin:16px 0}.ranking-row{display:grid;grid-template-columns:minmax(150px,2fr) minmax(100px,3fr) minmax(180px,1fr);gap:18px;width:100%;text-align:left;border:1px solid #e0e5eb;padding:12px}
.ranking-name,.ranking-values{display:flex;flex-direction:column;min-width:0}.ranking-name{overflow-wrap:anywhere}.ranking-values{text-align:right}.ranking-track{height:18px;background:#f1f4f8;border-radius:3px;overflow:hidden}.ranking-bar{display:block;height:100%;min-width:1px;border-radius:3px}
#daily-profit>summary{font-weight:650}#daily-profit .chart{margin:16px 0 0;padding:0}#daily-profit .chart svg{max-height:320px}
.table-scroll td.numeric-cell,#source-content td.numeric-cell{white-space:nowrap;overflow-wrap:normal;text-align:right;padding:9px 4px;font-size:var(--numeric-font,12px);font-variant-numeric:tabular-nums}
.table-scroll td.numeric-cell .amount,#source-content td.numeric-cell .amount{white-space:nowrap;overflow-wrap:normal;font-size:inherit;letter-spacing:normal;max-width:none}
.economics th{font-size:10px}.economics th button{font-size:inherit;padding:2px 0}.economics .excel-filter-button{min-width:16px;margin-left:0;padding:1px;min-height:22px}
@media(max-width:1023px){.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.waterfall-label{font-size:10px}.waterfall-label strong{font-size:10px}}
@media(max-width:600px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.waterfall-grid{grid-template-columns:repeat(5,minmax(0,1fr));row-gap:16px}.waterfall-label{min-height:90px}.ranking-row{grid-template-columns:minmax(0,1fr) minmax(100px,1fr);gap:8px}.ranking-track{grid-column:1/-1;grid-row:2}.ranking-values{font-size:12px}.ranking-toggle button{padding:8px}}

[data-logistics-partial] small{display:block;white-space:normal;overflow-wrap:anywhere}
#source-dialog h2,.report-heading h2{overflow-wrap:anywhere}
@media(max-width:760px){#source-dialog{padding:12px;width:calc(100vw - 16px);max-width:calc(100vw - 16px)}.table-scroll th,.table-scroll td{padding:7px 3px}}

/* Horizontal report expenses: labels and amounts never compete for bar space. */
.expense-summary { display:grid; grid-template-columns:1fr 1.4fr; gap:20px; margin:24px 0; }
.revenue-context,.profit-outcome { display:flex; flex-direction:column; align-items:flex-start; gap:10px; padding:22px; border-radius:12px; background:#f2f5f9; }
.revenue-context .amount { font-size:24px; }
.profit-outcome .amount { font-size:clamp(28px,4vw,44px); font-weight:750; white-space:nowrap; }
.profit-outcome.is-gain { background:#e9f5ef; border-left:4px solid #23845b; }
.profit-outcome.is-loss { background:#fff0ef; border-left:4px solid #be4747; }
.profit-outcome.is-loss .amount { color:#a62b35; }
.expense-bars { display:grid; gap:6px; margin:20px 0; }
.expense-button { display:grid; grid-template-columns:minmax(190px,1.1fr) minmax(80px,2fr) minmax(120px,auto); gap:20px; align-items:center; width:100%; padding:12px 10px; text-align:left; color:inherit; background:transparent; border:0; }
.expense-button:hover { background:#f5f7fa; }
.expense-label { overflow-wrap:anywhere; }
.expense-label small { display:block; color:#167252; font-size:11px; }
.expense-track { height:16px; background:#f1f3f7; border-radius:4px; overflow:hidden; }
.expense-bar { display:block; height:100%; background:#7288ad; border-radius:4px; }
.reimbursement .expense-bar { background:#2d9873; }
.reimbursement .expense-value { color:#167252; }
.expense-value { white-space:nowrap; font-variant-numeric:tabular-nums; text-align:right; }
@media(max-width:620px) { .expense-summary { grid-template-columns:1fr; gap:10px; } .expense-button { grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; } .expense-track { grid-row:2; grid-column:1 / -1; height:10px; } .expense-value { grid-column:2; grid-row:1; } }

/* Ledger amounts remain readable; horizontal scroll is preferable to wrapping digits. */
#profit-ledger table{min-width:650px}#profit-ledger td:nth-child(2),#profit-ledger td:nth-child(3),#profit-ledger td:nth-child(4){white-space:nowrap;font-variant-numeric:tabular-nums;text-align:right}#profit-ledger [data-ledger-key="profit"]{font-weight:700;background:#eff6f4}#profit-ledger th,#profit-ledger td{vertical-align:middle;padding:12px 10px;line-height:1.4}
#profit-ledger th:nth-child(2),#profit-ledger th:nth-child(3),#profit-ledger th:nth-child(4){text-align:right}
#profit-ledger th:first-child,#profit-ledger td:first-child{text-align:left}
#profit-ledger td .amount{display:inline;padding:0;margin:0;line-height:inherit;vertical-align:baseline}
#profit-ledger .amount{font-size:inherit;white-space:nowrap}.ranking-values .amount{font-size:inherit}.ranking-name{justify-content:center}
/* Eight summary cards: revenue context first, outcome last. */
.kpis { grid-template-columns:repeat(4, minmax(0, 1fr)); grid-auto-rows:1fr; gap:16px; }
.kpis .kpi { display:flex; flex-direction:column; justify-content:space-between; gap:10px; min-height:132px; padding:18px; }
.kpis .kpi .amount,.kpis .metric-value { white-space:nowrap; font-size:clamp(20px,2vw,28px); }
.kpis [data-metric="profit"],.kpis [data-metric="margin"] { background:#eff6f4; border-top:3px solid #609987; }
#profit-total { padding:16px 20px; }
#profit-total .profit-amount .amount { font-size:28px; }
#profit-total .eyebrow { margin-bottom:6px; }
#profit-total p { margin-bottom:0; }
@media(max-width:1000px) { .kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:480px) { .kpis { grid-template-columns:minmax(0,1fr); gap:10px; } .kpis .kpi { min-height:110px; } }

/* Compact, keyboard-accessible explanations replace the old Why column. */
#profit-ledger .ledger-help{display:inline-flex;align-items:center;justify-content:center;vertical-align:super;width:18px;height:18px;min-height:0;margin:0 0 0 4px;padding:0;border:1px solid #8696a5;border-radius:50%;font-size:11px;line-height:1;color:#254b70;background:transparent;cursor:pointer}
#profit-ledger .ledger-help:focus-visible{outline:2px solid #254b70;outline-offset:3px}

/* PROCVETAEV identity. Verified against https://procvetaev.ru/ and /fonts.css.
   Preserve report geometry above; brand and semantic status colors stay separate. */
@font-face {
  font-family: "TikTok Sans";
  src: url('/procvetaev-font.woff2') format('woff2');
  font-weight: 300 900;
  font-stretch: 75% 150%;
  font-style: normal;
  font-display: swap;
}
:root {
  --brand-ink: #ffffff;
  --brand-card: #ffffff;
  --brand-card-raised: #f5f6f8;
  --brand-accent: #C40123;
  --brand-white: #ffffff;
  --muted: #626975;
  --line: #dce0e5;
  --accent: #C40123;
  --blue: #24262b; /* Existing interaction token, not a financial status. */
  --red: #b42338;
  --amber: #855a10;
  --positive: #19704d;
  font-family: "TikTok Sans", system-ui, sans-serif;
  color: #222831;
  background: #ffffff;
  color-scheme: light;
}
body { font-weight:430; -webkit-font-smoothing:antialiased; }
button,input,select,textarea { font-family:inherit; }
h1,h2 { font-weight:530; letter-spacing:.01em; }
p,label,.intro li,pre { color:#424852; }
.eyebrow { color:#626975; letter-spacing:.12em; font-weight:500; }
.topbar { background:#ffffff; border-bottom:1px solid #dce0e5; min-height:88px; }
.brand { gap:22px; color:#222831; min-width:0; }
.brand img { display:block; width:202px; height:auto; flex-shrink:0; }
.brand-note { display:flex; flex-direction:column; gap:2px; line-height:1.4; color:#626975; }
.brand-scope { font-size:11px; letter-spacing:.09em; text-transform:uppercase; }
button,.button { background:#f5f6f8; color:#222831; border-color:#c6cbd2; border-radius:999px; font-weight:500; }
button:hover,.button:hover { background:#e9edf2; border-color:#999; }
.primary { background:#C40123; color:#222831; border-color:#C40123; }
.primary:hover { background:#9C011C; border-color:#E63A55; }
.danger { color:#b42338; }
.link { background:transparent; color:#222831; border:0; }
a { color:#222831; text-underline-offset:4px; }
:focus-visible,#profit-ledger .ledger-help:focus-visible { outline:2px solid #b42338; outline-offset:4px; }
.skip { background:#f5f6f8; color:#222831; }
.panel { background:#ffffff; border-radius:14px; box-shadow:0 0 0 1px #dce0e5; }
.upload,.settings { border-top-color:#C40123; }
input,select,.detail-filters select,.report-tax-settings select { background:#fff; border:1px solid #abb2bc; color:#222831; border-radius:8px; }
input::placeholder { color:#737b86; }
input[readonly],input[type="file"] { background:#f5f6f8; }
input[type="file"] { border-color:#abb2bc; }
input::file-selector-button { background:#e9edf2; color:#222831; border-radius:5px; }
progress,input[type="checkbox"] { accent-color:#C40123; }
.report-item { background:transparent; border-radius:0; }
.report-item span,.history-help,.column-filter-status { color:#626975; }
.report-item.selected { background:#fff0f3; box-shadow:inset 3px 0 #C40123; }
.history .report-item .history-open { color:#222831; text-decoration:underline; text-underline-offset:3px; }
.empty-icon { background:#f5f6f8; color:#626975; }
.warning { background:#fff7e8; color:#76500d; border-color:#dfc488; }
.amount,td .article { color:#222831; background:transparent; border-radius:3px; }
.amount:hover,td .article:hover { background:#e9edf2; }
.amount.unknown { color:#626975; }
.amount.negative { color:#b42338; }
.kpis .kpi { border-radius:14px; }
.kpis [data-metric="profit"],.kpis [data-metric="margin"] { background:#eff8f3; border-top-color:#19704d; }
.chart svg { color:#626975; }
.chart svg text { fill:#626975; }
.chart circle { fill:#626975; }
.chart .loss-point { fill:#b42338; }
th { background:#f5f6f8; color:#454c57; }
tbody tr:hover { background:#f3f5f8; }
.expense-grid > div { background:#f5f6f8; }
dialog { background:#ffffff; color:#222831; border-color:#c6cbd2; box-shadow:0 24px 80px #0008; }
dialog::backdrop { background:#000b; }
.notice { background:#eff8f3; color:#226342; border-color:#bbdac6; }
.notice.error { background:#fff0f2; color:#9d2438; border-color:#e3b2bb; }
.intro h1 { font-weight:430; letter-spacing:.01em; }
.intro li:before { background:#f5f6f8; border-color:#c6cbd2; flex-shrink:0; }
.auth-layout { position:relative; }
.auth-card { border-top:3px solid #C40123; }
.auth-layout .intro { border-left:2px solid #C40123; padding-left:24px; }
.profit-total { background:#eff8f3; border-color:#19704d; }
#chart-tooltip { background:#f5f6f8; border:1px solid #666; }
.revenue-contribution { background:#edf3fa; color:#222831; }
.excel-filter-button { background:#e9edf2; color:#222831; border-radius:4px; }
.excel-filter-button.filter-active { background:#C40123; color:#222831; }
.excel-filter-menu { background:#f5f6f8; color:#222831; border-color:#abb2bc; }
.excel-values,.report-tax-settings { border-color:#dce0e5; }
.total-bar,.period-bar rect { fill:#626975; }
.period-bar rect[fill="#b32738"] { fill:#b42338; }
.loss-bar { fill:#b42338; background:#b42338; }
.gain-bar { fill:#19704d; background:#19704d; }
.ranking-toggle [aria-pressed=true] { background:#C40123; color:#222831; border-color:#C40123; }
.ranking-row { border-color:#dce0e5; border-radius:10px; }
.ranking-track,.expense-track { background:#e9edf2; }
.revenue-context,.profit-outcome { background:#f5f6f8; }
.profit-outcome.is-gain { background:#eff8f3; border-left-color:#19704d; }
.profit-outcome.is-loss { background:#fff0f2; border-left-color:#b42338; }
.profit-outcome.is-loss .amount { color:#b42338; }
.expense-button { background:transparent; border-radius:8px; }
.expense-button:hover { background:#f3f5f8; }
.expense-bar { background:#788593; }
.reimbursement .expense-bar { background:#19704d; }
.expense-label small,.reimbursement .expense-value { color:#19704d; }
#profit-ledger [data-ledger-key="profit"] { background:#eff8f3; }
#profit-ledger .ledger-help { color:#222831; border-color:#999; }
footer { display:flex; flex-direction:column; gap:8px; color:#626975; font-size:12px; }
footer strong { color:#222831; font-weight:500; letter-spacing:.04em; }
#report-help { max-width:calc(1660px - 8%); margin:0 4% 24px; }
#report-help p,#report-help li { max-width:1050px; }
/* Native FAQ disclosures: categories stay distinct, answers stay compact. */
#help-faq > .faq-category {
  margin: 14px 0 0;
  padding: 0 18px;
  border: 1px solid #d9dee5;
  border-radius: 10px;
  background: #f8f9fb;
}
#help-faq > .faq-category > summary {
  padding: 16px 0;
  font-size: 15px;
  font-weight: 650;
  color: #222831;
  cursor: pointer;
}
#help-faq .faq-category [data-help-question] {
  margin: 0;
  padding: 13px 0;
  border-top: 1px solid #e0e5eb;
}
#help-faq [data-help-question] > summary { cursor: pointer; font-weight: 500; }
#help-faq [data-help-question] > p { margin: 10px 0 2px; color: #475261; line-height: 1.7; }
#help-faq summary:focus-visible { outline: 2px solid #245edb; outline-offset: 4px; border-radius: 3px; }
@media(max-width:600px) {
  #help-faq > .faq-category { padding-inline: 12px; }
  #help-faq > .faq-category > summary { font-size: 14px; }
}
@media(min-width:1805px) { #report-help { margin-inline:auto; } }
@media(max-width:850px) { .brand-note { display:none; } }
@media(max-width:600px) {
  .topbar { flex-wrap:wrap; gap:12px; }
  .brand img { width:180px; }
  #account { margin-left:auto; }
  .auth-layout .intro { padding-left:16px; }
  .intro h1 { font-size:32px; }
  #report-help { margin-inline:16px; max-width:none; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; scroll-behavior:auto!important; } }

/* Contrast for primary actions and the original white logo on a white header. */
.primary,.primary:hover,.excel-filter-button.filter-active,.ranking-toggle [aria-pressed=true]{color:#fff}
.brand img{filter:brightness(0)}
body{background:#fff;color:#222831}
#chart-tooltip{color:#222831}
/* Stronger typography on the light agency theme. */
:root{--muted:#4b5058}
body{color:#17191d;font-weight:500}
h1,h2,h3{color:#111318;font-weight:700}
p,label,.intro li,pre{color:#343941}
summary{color:#202329;font-weight:650}
#seller-settlement{margin-top:16px;padding:14px 20px;border-left:4px solid #19704d;background:#eff8f3;border-radius:10px;width:fit-content;max-width:100%}
#seller-settlement>span{font-weight:600}
#seller-settlement .amount{font-size:clamp(24px,3vw,34px);font-weight:750;line-height:1.4;white-space:normal}
#seller-settlement .amount.unknown{font-size:20px}
.settlement-help{border:1px solid #609987;border-radius:50%;min-width:24px;min-height:24px;padding:0 5px;margin-left:6px;font-size:13px}
.kpi h3,.kpi .label,.eyebrow{color:#454a53;font-weight:600}
.kpis .amount,.kpis .metric-value{color:#111318;font-weight:750}
.amount,td .article{color:#1c2026;font-weight:600}
.amount.negative{color:#b42338}
.amount.unknown{color:#545b66;font-weight:500}
th{color:#242932;font-weight:650}
td{color:#262b33}
button,.button{font-weight:600}
.brand-note,.report-item span,.history-help,.column-filter-status{color:#4b5058}


/* One-time brand reveal, layout unchanged; static with reduced motion. */
.topbar{position:relative}
.topbar::after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:linear-gradient(90deg,#C40123,transparent 75%);pointer-events:none;transform-origin:left}
@media(prefers-reduced-motion:no-preference){
 .topbar .brand img{animation:pv-brand-reveal .65s ease-out both}
 .topbar .brand-note{animation:pv-brand-reveal .65s .12s ease-out both}
 .topbar::after{animation:pv-line-reveal .85s ease-out both}
}
@keyframes pv-brand-reveal{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@keyframes pv-line-reveal{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media(prefers-reduced-motion:reduce){.topbar .brand img,.topbar .brand-note,.topbar::after{animation:none;transform:none;opacity:1}}

/* Settings and report history: full-width, one page, explicit scopes. */
#settings{display:flex;flex-direction:column;gap:24px;min-width:0}
#settings>.section-heading,#settings h3,#settings h4{margin:0}
#settings>.settings-grid{display:block;margin:0}
#settings .report-tax-settings{margin:0;padding:0;border:0;min-width:0}
#settings .report-tax-settings form{max-width:none;width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px}
#settings .report-tax-settings form>h4,#settings .report-tax-settings form>fieldset,#settings .report-tax-settings form>p,#settings .report-tax-settings form>.tax-checkbox,#settings .report-tax-settings form>.tax-actions{grid-column:1/-1}
#settings .tax-fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px}
#settings label{margin:0;min-width:0}
#settings input,#settings select{width:100%;max-width:none;margin-top:6px}
#settings select{min-height:44px;padding:10px}
#settings fieldset{min-width:0;margin:16px 0;padding:16px;border:1px solid var(--line);border-radius:10px}
#settings legend,#settings p,#settings li{overflow-wrap:anywhere}
#settings legend{max-width:100%;font-weight:600}
#settings .tax-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:8px 0 0}
#settings button{white-space:normal;max-width:100%;min-height:44px}
#settings .tax-checkbox,#settings .inline-check{display:flex;align-items:center;gap:10px;min-height:44px}
#settings input[type=checkbox]{width:18px;height:18px;min-height:0;flex:0 0 18px;margin:0;padding:0}
#settings [hidden]{display:none!important}
#settings .account-tax-default{padding:12px 16px;background:var(--surface-soft,#f7f8fa);border:1px solid var(--line);border-radius:10px}
#settings .account-tax-default form{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin-top:16px}
#settings .account-tax-default label{max-width:220px}
#settings .cost-import-section{width:100%;border-top:1px solid var(--line);padding-top:24px}
#settings [data-form=import]{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:16px 0 24px}
#settings [data-form=import] label{flex:1 1 320px}
#settings [data-form=bulk-tax]{display:grid;gap:16px}
#settings [data-bulk-review] ul{padding-left:20px}
#settings [data-bulk-review] .primary{margin-top:16px}
.workspace>aside{display:flex;flex-direction:column;gap:24px;width:100%}
.workspace>aside .panel{width:100%;min-width:0}
.workspace>aside #report-list{max-height:440px;overflow:auto}
.upload{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px 20px;align-items:center;padding:20px 24px}
.upload h2,.history h2{margin:0}
.upload>form{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:0}
.upload>form .file-label{flex:1 1 220px;min-width:0;margin:0}
.upload>form input[type=file]{width:100%;min-width:0}
.upload-format{font-size:13px;color:var(--muted)}
#upload-status:empty{display:none}
#upload-progress:not([hidden]),#upload-status:not(:empty){flex-basis:100%}
.compact-help>summary{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:1px solid var(--line);border-radius:50%;font-weight:700;cursor:pointer;list-style:none}
.compact-help>summary::-webkit-details-marker{display:none}
.compact-help[open]{grid-column:1/-1;width:100%}
.compact-help[open]>p,.compact-help[open]>details{margin:12px 0}
.history{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;padding:20px 24px}
.history>.history-date-range,.history>#report-selection,.history>#report-list{grid-column:1/-1}
.history .history-date-range{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:0}
.history .history-date-range label{flex:0 1 240px;margin:0}
.history .history-date-range input{min-height:44px}
.history #report-selection{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:0;margin:0}
.history #report-selection p{margin:0;flex:1 0 150px}
.history #report-selection button{min-height:44px;width:auto;margin:0}
.history .report-history-row{grid-template-columns:24px minmax(0,1fr) auto;align-items:center;padding:10px 0;gap:12px}
.history .report-history-row input[type=checkbox]{width:20px;height:20px;margin:0}
.history .report-history-row .report-item{display:grid;grid-template-columns:minmax(220px,2fr) minmax(180px,1fr) minmax(170px,1fr);gap:4px 16px;align-items:center;min-height:44px;padding:4px 8px;font-size:13px}
.history .report-item strong{font-size:13px;line-height:1.45}
.history .report-item span,.history .report-item small{font-size:12px;margin:0}
.history .report-item .history-open{grid-column:1;font-size:12px}
.history .report-history-row .report-delete{grid-column:auto;min-height:44px;font-size:12px;margin:0;padding:8px 12px}
@media(max-width:1000px){.upload{grid-template-columns:minmax(0,1fr) auto}.upload>form{grid-column:1/-1}.upload>.compact-help{grid-column:2;grid-row:1}.upload-format{grid-column:1}.history .report-history-row .report-item{grid-template-columns:minmax(0,1fr) minmax(170px,1fr)}.history .report-item strong{grid-column:1/-1}}
@media(max-width:640px){#settings .report-tax-settings form,#settings .tax-fields-grid{grid-template-columns:minmax(0,1fr)}#settings .tax-actions>button{width:100%}.upload,.history{padding:16px}.history .history-date-range label{flex:1 1 130px}.history .report-history-row .report-item{grid-template-columns:minmax(0,1fr)}.history .report-history-row{gap:8px}.history .report-item strong{font-size:13px}.history .report-item span,.history .report-item small{grid-column:1}.history .report-history-row input[type=checkbox]{width:24px;height:24px}.history #report-selection button{flex:1 1 150px}}

/* Two equal main sections: tax scope never applies to cost controls. */
#settings .settings-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start}
#settings .tax-settings-column,#settings .cost-settings-column{display:flex;flex-direction:column;gap:24px;min-width:0}
#settings .cost-settings-column{border-left:1px solid var(--line);padding-left:24px}
#settings .settings-columns .report-tax-settings form,#settings .settings-columns .tax-fields-grid{grid-template-columns:minmax(0,1fr)}
#settings .cost-import-section{border-top:0;padding-top:0}
#settings .cost-settings-column>.compact-help{align-self:flex-start}
#settings .cost-settings-column .settings-grid{display:block;margin:0}
#settings .settings-columns input[type=file]{max-width:100%;min-width:0}
#settings .settings-columns .table-scroll{max-width:100%}
@media(max-width:999px){#settings .settings-columns{grid-template-columns:minmax(0,1fr)}#settings .cost-settings-column{border-left:0;padding-left:0;border-top:1px solid var(--line);padding-top:24px}}

#settings [data-form=account-tax]{display:flex;flex-direction:column;gap:16px}
#settings [data-form=account-tax]>.tax-fields-grid{display:grid;grid-template-columns:minmax(0,1fr)}
#settings .cost-settings-column [data-form=cost]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#settings .cost-settings-column [data-form=cost] button{grid-column:1/-1;justify-self:start;max-width:100%}
#settings .cost-settings-column [data-form=cost] input{min-width:0;width:100%}
@media(max-width:640px){#settings .cost-settings-column [data-form=cost]{grid-template-columns:minmax(0,1fr)}}

#settings .tax-settings-column,#settings .cost-settings-column{border:1px solid var(--line);border-top:3px solid #c40123;border-radius:12px;padding:24px;background:#fff;align-self:start}
#settings .tax-settings-column>.section-heading,#settings .cost-settings-column>h3{background:#f6f7f8;padding:12px 14px;margin:-8px -8px 0;border-radius:7px;font-weight:750}
#settings .settings-columns{align-items:start}
@media(max-width:640px){#settings .tax-settings-column,#settings .cost-settings-column{padding:16px}}

#report-profit-hero{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:24px;align-items:center;border-top:3px solid #c40123;padding:24px}
#report-profit-hero h2{font-size:18px;margin:0 0 12px}
#report-profit-hero .profit-hero-primary>.amount{font-size:clamp(28px,3.5vw,48px);line-height:1.2;font-weight:750;color:#222831;white-space:normal;overflow-wrap:anywhere}
#report-profit-hero .profit-hero-ratios{display:grid;gap:16px}
#report-profit-hero .profit-hero-ratios>div{display:flex;flex-direction:column;gap:6px}
#report-profit-hero .profit-hero-ratios .amount{font-size:24px;align-self:flex-start}
#report-profit-hero .amount.negative{color:#a71932}
#report-profit-hero .amount.unknown{font-size:20px;color:#626975}
.kpis{grid-template-columns:repeat(3, minmax(0, 1fr));grid-auto-rows:1fr}
.kpis #seller-settlement{margin:0;padding:20px;border:1px solid var(--line);background:#fff;display:flex;flex-direction:column;gap:12px}
.kpis #seller-settlement>.amount{font-size:clamp(20px,2vw,30px);color:inherit}
.kpis .kpi>.amount{max-width:100%;white-space:normal;overflow-wrap:anywhere}
@media(max-width:1000px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}#report-profit-hero{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
@media(max-width:640px){.kpis{grid-template-columns:minmax(0,1fr)}#report-profit-hero{grid-template-columns:minmax(0,1fr);padding:16px}.profit-hero-ratios{grid-template-columns:minmax(0,1fr)}}

/* Quiet, equal-width dashboard cards; all values remain accessible actions. */
.kpis{gap:12px}
.kpis .kpi,.kpis #seller-settlement{box-sizing:border-box;width:100%;max-width:none;min-width:0;justify-self:stretch;align-self:stretch;min-height:112px;padding:16px;gap:10px;border:1px solid #dce0e5;border-radius:8px;background:#fff}
.kpis .kpi>span,.kpis #seller-settlement>span{font-size:14px;line-height:1.35;font-weight:600;color:#373d46}
.kpis .kpi>.amount,.kpis #seller-settlement>.amount{font-size:26px;line-height:1.2;font-weight:700;min-height:44px;align-self:flex-start;text-align:left;color:#222831}
#report-profit-hero{border:1px solid #dce0e5;border-top:3px solid #c40123;border-radius:8px;background:#fafbfc;padding:20px 24px;gap:20px}
#report-profit-hero .profit-hero-primary>.amount{font-size:clamp(28px,3vw,40px);min-height:44px}
#report-profit-hero .profit-hero-ratios .amount{font-size:22px;min-height:36px}
.amount{border-bottom:0 none;border-bottom-style:none;border-bottom-width:0;text-decoration:none;cursor:pointer}
.amount:hover{text-decoration:underline;text-underline-offset:4px}
.amount:focus-visible{outline:2px solid #c40123;outline-offset:3px;border-radius:3px}
.kpis .amount.negative,#report-profit-hero .amount.negative{color:#a71932}
.kpis .amount.unknown,#report-profit-hero .amount.unknown{color:#626975}
@media(max-width:640px){.kpis .kpi,.kpis #seller-settlement{padding:14px;min-height:102px}#report-profit-hero{padding:16px}}

/* ============================================================
   PROCVETAEV — вариант C: тёмная фирменная шапка и зона итога,
   светлая рабочая область. Только визуальный слой.
   Финансовая логика, API, идентификаторы, data-атрибуты и aria не меняются.
   ============================================================ */

:root {
  --muted: #5c5c5c;
  --line: #e2e2e2;
  --accent: #C40123;
  --positive: #12633f;
  --red: #a8001e;
}

body {
  background: #f6f5f5;
  color: #111111;
}

/* Фирменная типографика: заголовки — узкое начертание, верхний регистр. */
h1,
h2,
h3 {
  font-stretch: 75%;
  letter-spacing: 0.005em;
  color: #111111;
}
h1,
.report-heading h2,
.section-heading h2 {
  text-transform: uppercase;
}
h1 {
  font-weight: 600;
}
h2 {
  font-weight: 600;
}
h3,
h4 {
  font-stretch: 87.5%;
}
p,
label,
li,
td,
summary {
  font-stretch: 87.5%;
}

/* Табличные цифры во всех денежных значениях. */
.amount,
.metric-value,
.numeric-cell,
.expense-value,
.ranking-values,
.waterfall-label strong,
#seller-settlement .amount,
.period-bar span {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ---------- Тёмная брендовая шапка ---------- */
.topbar {
  background: #0c0a0b;
  border-bottom: 1px solid #34272b;
  color: #ffffff;
}
.topbar::after {
  background: linear-gradient(90deg, #C40123, transparent 78%);
  height: 2px;
}
.brand {
  color: #ffffff;
}
.brand img {
  filter: brightness(0) invert(1);
}
.brand-note,
.topbar .brand-note {
  color: #c9c3c5;
}
.topbar button,
.topbar .button {
  background: #1c1517;
  border-color: #4a3a3e;
  color: #ffffff;
}
.topbar button:hover,
.topbar .button:hover {
  background: #241a1d;
  border-color: #ff5c74;
  color: #ffffff;
}
.topbar .shop,
#account {
  color: #c9c3c5;
}
.topbar :focus-visible {
  outline-color: #ff5c74;
}

/* ---------- Светлая рабочая область ---------- */
main,
#report-help {
  background: transparent;
}
.panel {
  background: #ffffff;
  border-radius: 3px;
  box-shadow: 0 0 0 1px #e2e2e2;
}
.upload,
.settings {
  border-top: 2px solid #C40123;
}

/* Нумерация и надзаголовки разделов. */
.eyebrow {
  color: #5c5c5c;
  letter-spacing: 0.16em;
  font-weight: 500;
  font-stretch: 87.5%;
}

/* Контролы: строгие прямоугольники, контурные кнопки. */
button,
.button {
  background: #ffffff;
  color: #111111;
  border-color: #c2c2c2;
  border-radius: 2px;
  font-weight: 500;
  font-stretch: 87.5%;
}
button:hover,
.button:hover {
  background: #faf5f6;
  border-color: #C40123;
  color: #C40123;
}
.primary {
  background: #C40123;
  border-color: #C40123;
  color: #fff;
  font-weight: 600;
}
.primary:hover {
  background: #9f0019;
  border-color: #9f0019;
  color: #fff;
}
button:disabled,
.button[aria-disabled="true"] {
  border-style: dashed;
  color: #5c5c5c;
  background: #f3f1f1;
}
.danger {
  color: #a8001e;
  border-color: #c2c2c2;
}
.danger:hover {
  border-color: #a8001e;
  color: #a8001e;
}
:focus-visible,
#profit-ledger .ledger-help:focus-visible,
#help-faq summary:focus-visible {
  outline: 2px solid #C40123;
  outline-offset: 3px;
}
input,
select,
.detail-filters select,
.report-tax-settings select {
  border-radius: 2px;
  border-color: #c2c2c2;
  background: #ffffff;
  color: #111111;
}
input:focus,
select:focus {
  outline: 2px solid #C40123;
  outline-offset: 2px;
}
input[readonly],
input[type="file"] {
  background: #f3f1f1;
}
input::file-selector-button {
  background: #f3f1f1;
  color: #111111;
  border-radius: 2px;
}
progress,
input[type="checkbox"] {
  accent-color: #C40123;
}

/* ---------- Тёмная зона итоговой прибыли ---------- */
#report-profit-hero {
  position: relative;
  overflow: hidden;
  background: #0c0a0b;
  color: #ffffff;
  border: 0;
  border-top: 2px solid #C40123;
  border-radius: 3px;
  box-shadow: none;
  padding: 26px 28px 28px;
}
#report-profit-hero::before {
  content: "";
  position: absolute;
  inset: -45% -12% auto -12%;
  height: 200%;
  background: radial-gradient(
    58% 68% at 60% 46%,
    rgba(196, 1, 35, 0.4),
    transparent 72%
  );
  pointer-events: none;
}
#report-profit-hero > * {
  position: relative;
  z-index: 1;
}
#report-profit-hero h2 {
  color: #ffffff;
  text-transform: uppercase;
}
#report-profit-hero .profit-hero-primary > .amount {
  color: #ffffff;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-stretch: 75%;
}
#report-profit-hero .profit-hero-ratios > div > span,
#report-profit-hero span {
  color: #c9c3c5;
}
#report-profit-hero .profit-hero-ratios > div {
  border-top: 1px solid #3a2a2e;
  padding-top: 10px;
}
#report-profit-hero .profit-hero-ratios .amount {
  color: #ffffff;
}
#report-profit-hero .amount.negative {
  color: #ff8fa0;
}
#report-profit-hero .amount.unknown {
  color: #c9c3c5;
}
#report-profit-hero .amount:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
#report-profit-hero .settlement-help {
  background: transparent;
  border-color: #6a5358;
  color: #c9c3c5;
}
#report-profit-hero .settlement-help:hover {
  border-color: #ff5c74;
  color: #ff5c74;
}
#report-profit-hero :focus-visible {
  outline-color: #ff5c74;
}

/* ---------- KPI: единая сетка, одинаковые линии значений ---------- */
.kpis .kpi,
.kpis #seller-settlement {
  border: 1px solid #e2e2e2;
  border-top: 2px solid transparent;
  border-radius: 3px;
  background: #ffffff;
}
.kpis .kpi > span,
.kpis #seller-settlement > span {
  color: #5c5c5c;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-stretch: 87.5%;
  min-height: 2.9em;
}
.kpis .kpi > .amount,
.kpis #seller-settlement > .amount {
  color: #111111;
  font-weight: 650;
  line-height: 1.25;
}
.kpis [data-metric="profit"],
.kpis [data-metric="margin"] {
  background: #f3f1f1;
  border-top-color: #111111;
}
.kpis .amount.negative,
.amount.negative {
  color: #a8001e;
}
.kpis .amount.unknown,
.amount.unknown {
  color: #5c5c5c;
}
.settlement-help,
#profit-ledger .ledger-help {
  border-color: #c2c2c2;
  color: #5c5c5c;
  background: transparent;
}

/* ---------- Выгрузка: понятная группа рядом с заголовком ---------- */
.report-heading {
  border-bottom: 1px solid #e2e2e2;
  padding-bottom: 14px;
}
.actions.report-downloads {
  gap: 10px;
}
.actions.report-downloads button {
  font-weight: 600;
}
.actions.report-downloads button[data-download]:hover {
  border-color: #C40123;
  color: #C40123;
}
.actions.report-downloads button[aria-busy="true"],
.actions.report-downloads button:disabled {
  border-style: dashed;
}

/* ---------- Таблицы ---------- */
th {
  background: #f3f1f1;
  color: #5c5c5c;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
td {
  color: #111111;
}
tbody tr:hover {
  background: #faf5f6;
}
.table-scroll {
  border: 1px solid #e2e2e2;
  border-radius: 3px;
}
.amount,
td .article {
  color: #111111;
  border-radius: 2px;
}
.amount:hover,
td .article:hover {
  background: #faf5f6;
}

/* ---------- Полосы расходов и рейтинги ---------- */
.expense-button {
  border-radius: 2px;
}
.expense-button:hover {
  background: #faf5f6;
}
.expense-track,
.ranking-track {
  background: #e7e4e4;
  border-radius: 1px;
}
.expense-bar,
.total-bar,
.period-bar rect {
  background: #3d3d3d;
  fill: #626975;
  border-radius: 1px;
}
.expense-bar {
  min-width: 8px;
}
.reimbursement .expense-bar,
.gain-bar {
  background: #12633f;
  fill: #12633f;
}
.expense-label small,
.reimbursement .expense-value {
  color: #12633f;
}
.loss-bar {
  background: #a8001e;
  fill: #a8001e;
}
.ranking-row {
  border-color: #e2e2e2;
  border-radius: 2px;
}
.ranking-toggle [aria-pressed="true"] {
  background: #C40123;
  border-color: #C40123;
  color: #fff;
}

/* ---------- Состояния и сообщения ---------- */
.notice {
  background: #eff8f3;
  color: #12633f;
  border-color: #bcd9c8;
}
.notice.error {
  background: #fdf0f2;
  color: #a8001e;
  border-color: #e3b2bb;
}
.warning {
  background: #fdf6ea;
  color: #7a4b00;
  border-color: #e4c79a;
}
.profit-outcome.is-gain,
#profit-ledger [data-ledger-key="profit"],
.profit-total {
  background: #eff8f3;
  border-left-color: #12633f;
  border-color: #12633f;
}
.profit-outcome.is-loss {
  background: #fdf0f2;
  border-left-color: #a8001e;
}
.profit-outcome.is-loss .amount {
  color: #a8001e;
}
.empty,
.empty-icon {
  background: #f3f1f1;
  color: #5c5c5c;
  border-radius: 3px;
}
#seller-settlement {
  border-left: 3px solid #12633f;
  background: #eff8f3;
  border-radius: 3px;
}

/* Выбранный отчёт: нейтральная отметка, красный остаётся брендовым. */
.report-item.selected {
  background: #f3f1f1;
  box-shadow: inset 3px 0 #111111;
}
.history .report-item .history-open {
  color: #111111;
}

/* ---------- Диалог исходных строк ---------- */
dialog {
  background: #ffffff;
  color: #111111;
  border: 1px solid #e2e2e2;
  border-top: 2px solid #C40123;
  border-radius: 3px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
dialog::backdrop {
  background: rgba(12, 10, 11, 0.72);
}

/* ---------- Вход ---------- */
.auth-card {
  border-top: 2px solid #C40123;
  border-radius: 3px;
}
.auth-layout .intro {
  border-left: 2px solid #C40123;
}
.intro li:before {
  background: #f3f1f1;
  border-color: #c2c2c2;
}

/* ---------- Справка и FAQ ---------- */
#help-faq > .faq-category {
  border-color: #e2e2e2;
  border-radius: 3px;
}
#help-faq [data-help-question] > p {
  color: #5c5c5c;
}
.report-item span,
.history-help,
.column-filter-status,
.source-filename,
.currency-note {
  color: #5c5c5c;
}

/* ---------- Подвал ---------- */
footer {
  color: #5c5c5c;
  border-top: 1px solid #e2e2e2;
  padding-top: 18px;
}
footer strong {
  color: #111111;
  letter-spacing: 0.06em;
}

/* ---------- Прочие поверхности ---------- */
.excel-filter-menu,
#chart-tooltip {
  background: #ffffff;
  border-color: #c2c2c2;
  color: #111111;
  border-radius: 3px;
}
.excel-filter-button {
  background: #f3f1f1;
  border-radius: 2px;
}
.excel-filter-button.filter-active {
  background: #C40123;
  color: #fff;
}
.revenue-context,
.profit-outcome,
.expense-grid > div {
  background: #f3f1f1;
  border-radius: 3px;
}
.revenue-contribution {
  background: #f3f1f1;
  color: #111111;
}
.skip {
  background: #C40123;
  color: #fff;
}

@media (max-width: 640px) {
  #report-profit-hero {
    padding: 18px 16px 20px;
  }
  .actions.report-downloads {
    width: 100%;
  }
  .actions.report-downloads button {
    flex: 1 1 150px;
  }
}

/* --- Правки по итогам проверки в браузере (вариант C) --- */

/* Подпись площадки в шапке должна читаться на тёмном фоне. */
.topbar .brand-note,
.topbar .brand-scope {
  color: #c9c3c5;
}
.topbar .brand-scope {
  color: #a9a1a3;
}

/* Кнопка выхода: видимая контурная на тёмном. */
.topbar #account button,
.topbar #account .button {
  background: transparent;
  border-color: #8a6b72;
  color: #ffffff;
}
.topbar #account button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ff5c74;
  color: #ffffff;
}

/* Недоступная кнопка не должна выглядеть как ошибка. */
button:disabled,
button[disabled],
.button[aria-disabled="true"] {
  border-style: solid;
  border-color: #c2c2c2;
  background: #f3f1f1;
  color: #5c5c5c;
  cursor: not-allowed;
}
button:disabled:hover,
button[disabled]:hover {
  border-color: #c2c2c2;
  color: #5c5c5c;
}

/* Кнопки-подсказки заметны и не рвут выравнивание подписи. */
.settlement-help,
#profit-ledger .ledger-help,
.compact-help > summary {
  border-color: #8a8a8a;
  color: #3f3f3f;
}
#report-profit-hero .settlement-help {
  border-color: #9b8085;
  color: #e4dee0;
}

/* Красная линия-акцент одинаково у всех рабочих панелей. */
.panel.history,
.panel.upload,
.panel.settings,
#report-help {
  border-top: 2px solid #C40123;
}

/* Кнопка удаления остаётся внутри строки истории. */
.history .report-history-row {
  padding: 12px 10px;
  border-radius: 2px;
}
.history .report-history-row .report-delete {
  justify-self: start;
  margin-left: 0;
}

/* Экспорт и опасное действие визуально разведены. */
.report-heading .actions.report-downloads {
  margin-right: auto;
}
.report-heading .actions .danger {
  margin-left: 12px;
}

/* Итог и показатели в тёмной зоне стоят на одной линии. */
#report-profit-hero {
  align-items: start;
}
#report-profit-hero .profit-hero-primary,
#report-profit-hero .profit-hero-ratios > div {
  min-height: 0;
}
#report-profit-hero .profit-hero-primary h2,
#report-profit-hero .profit-hero-ratios > div > span {
  min-height: 2.6em;
  display: block;
}

/* --- Вторая правка по итогам проверки в браузере (вариант C) --- */

/* Единый вертикальный ритм рабочих панелей. */
.workspace > aside .panel + .panel,
.workspace .panel + .panel {
  margin-top: 20px;
}

/* Подсказка «?» всегда в правом верхнем углу своей панели. */
.panel > .compact-help {
  position: absolute;
  top: 14px;
  right: 16px;
  margin: 0;
}
.panel.upload,
.panel.history {
  position: relative;
}
.panel.upload > .compact-help > summary,
.panel.history > .compact-help > summary {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #8a8a8a;
  color: #3f3f3f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Все действия выгрузки в одной группе; удаление отделено. */
.report-heading > .actions {
  align-items: center;
}
.report-heading .actions:not(.report-downloads) {
  gap: 10px;
}
.report-heading .actions .danger {
  margin-left: 20px;
  border-left: 1px solid #e2e2e2;
  padding-left: 18px;
  border-radius: 2px;
}

/* Сброс периода — вторичное действие, не на всю ширину. */
.history [data-action="reset-period"] {
  width: auto;
  justify-self: start;
  margin-top: 4px;
}

/* Неактивная кнопка расчёта читается и объясняется. */
#report-selection .primary:disabled {
  background: #f3f1f1;
  border-color: #c2c2c2;
  color: #5c5c5c;
}

/* Итоговая зона: значение и подписи не режутся по нижней кромке. */
#report-profit-hero {
  padding-bottom: 24px;
}
#report-profit-hero .profit-hero-ratios {
  align-content: start;
}
/* Вход по коду из бота: согласие, предупреждение о сроке, плашка доступа в шапке. */
.auth-card label.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 450;
  line-height: 1.45;
  color: #48576a;
}
.auth-card label.consent input {
  flex: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--blue);
}
.auth-card label.consent a {
  color: var(--blue);
}
.auth-card .auth-notice {
  padding: 10px 12px;
  border: 1px solid #f0d9a8;
  border-radius: 7px;
  background: #fff8e8;
  color: var(--amber);
  font-size: 12px;
}
.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.access-badge.warn {
  border-color: #f0d9a8;
  color: var(--amber);
}
.access-badge .ab-full {
  color: var(--red);
  font-weight: 600;
}
.ab-sep {
  opacity: 0.5;
}
@media (max-width: 600px) {
  #account {
    gap: 10px;
  }
  .access-badge {
    white-space: normal;
    font-size: 11px;
  }
}

/* ================================================================ Экран входа v2 ===
   Тёмная витрина PROCVETAEV + карточка входа по промокоду. Анимации — только CSS,
   при prefers-reduced-motion выключены; повторная отрисовка вкладок (.is-switch) их не повторяет. */
.toplinks { display:flex; gap:20px; margin-left:auto; margin-right:8px; font-size:13px; }
.toplinks a { color:#626975; text-decoration:none; position:relative; padding:4px 0; transition:color .2s; }
.toplinks a::after { content:""; position:absolute; left:0; right:0; bottom:-2px; height:2px; background:#C40123; transform:scaleX(0); transform-origin:left; transition:transform .25s cubic-bezier(.2,.8,.2,1); }
.toplinks a:hover { color:#222831; } .toplinks a:hover::after { transform:scaleX(1); }
@media (max-width: 760px) { .toplinks { display:none; } }

.auth2 { display:grid; grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr); gap:24px; max-width:1180px; margin:28px auto 8px; padding:0 4%; align-items:stretch; }
.auth2-hero { position:relative; overflow:hidden; isolation:isolate; border-radius:20px; padding:40px 40px 34px; background:#121316; color:#fff; display:flex; flex-direction:column; gap:22px; }
.auth2-glow { position:absolute; z-index:-1; width:620px; height:620px; right:-220px; top:-260px; border-radius:50%;
  background:radial-gradient(closest-side, rgba(196,1,35,.55), rgba(196,1,35,.12) 55%, transparent 72%); filter:blur(8px); animation:auth2-drift 14s ease-in-out infinite alternate; }
.auth2-hero::after { content:""; position:absolute; inset:0; z-index:-1; background:linear-gradient(180deg, transparent 55%, rgba(196,1,35,.10)); pointer-events:none; }
.auth2-hero .eyebrow { color:rgba(255,255,255,.62); font-size:11px; letter-spacing:.14em; text-transform:uppercase; margin:0; }
.auth2-hero h1 { margin:0; font-size:clamp(34px, 4.3vw, 54px); line-height:1.02; font-weight:640; letter-spacing:-.01em; text-transform:uppercase; color:#fff; }
.auth2-hero h1 span { display:inline-block; }
.auth2-hero h1 span:last-child { color:#ff4d68; }
.auth2-lead { margin:0; max-width:520px; font-size:15px; line-height:1.55; color:rgba(255,255,255,.82); }

.auth2-preview { width:min(100%, 430px); padding:18px 20px 16px; border-radius:16px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12);
  box-shadow:0 30px 60px -30px rgba(0,0,0,.8); backdrop-filter:blur(6px); }
.pv-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:rgba(255,255,255,.55); }
.pv-dot { width:8px; height:8px; border-radius:50%; background:#3ddc84; box-shadow:0 0 0 0 rgba(61,220,132,.6); animation:auth2-pulse 2.4s ease-out infinite; }
.pv-line { display:flex; justify-content:space-between; gap:12px; font-size:13px; color:rgba(255,255,255,.78); margin-top:10px; }
.pv-line b, .pv-total b { font-weight:600; color:#fff; font-variant-numeric:tabular-nums; }
.pv-bar { height:6px; margin-top:6px; border-radius:99px; background:rgba(255,255,255,.08); overflow:hidden; }
.pv-bar i { display:block; height:100%; width:var(--w); border-radius:inherit; background:linear-gradient(90deg,#fff,#d9dce2); transform-origin:left; animation:auth2-grow 1.2s cubic-bezier(.2,.8,.2,1) both; }
.pv-bar.wb i { background:linear-gradient(90deg,#C40123,#ff4d68); animation-delay:.12s; }
.pv-bar.cogs i { background:linear-gradient(90deg,#8a8f99,#b9bec7); animation-delay:.24s; }
.pv-total { display:flex; justify-content:space-between; align-items:baseline; margin-top:16px; padding-top:12px; border-top:1px dashed rgba(255,255,255,.18); font-size:13px; color:rgba(255,255,255,.7); }
.pv-total b { font-size:22px; color:#3ddc84; }

.auth2-steps { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.auth2-steps li { display:flex; flex-direction:column; gap:8px; padding:12px; border-radius:12px; background:rgba(255,255,255,.05); color:rgba(255,255,255,.85); font-size:12.5px; line-height:1.4; }
.auth2-steps li::before { content:none !important; }
.auth2-steps b { width:26px; height:26px; border-radius:50%; display:grid; place-items:center; background:#C40123; color:#fff; font-size:12px; font-weight:600; }
.auth2-safe { margin:auto 0 0; font-size:12px; color:rgba(255,255,255,.55); }

.auth2-card { padding:30px 30px 22px; display:flex; flex-direction:column; border-radius:20px; }
.auth2-tabs { position:relative; display:grid; grid-template-columns:1fr 1fr; padding:4px; border-radius:999px; background:#f1f2f5; margin-bottom:24px; }
.auth2-tabs button { position:relative; z-index:1; min-height:40px; border:0; background:transparent; border-radius:999px; color:#626975; font-weight:550; transition:color .25s; }
.auth2-tabs button.on { color:#121316; }
.auth2-tabs button:hover { background:transparent; color:#121316; }
.auth2-tab-ink { position:absolute; z-index:0; top:4px; bottom:4px; left:4px; width:calc(50% - 4px); border-radius:999px; background:#fff; box-shadow:0 1px 2px rgba(18,19,22,.12), 0 4px 14px -6px rgba(18,19,22,.25); transition:transform .35s cubic-bezier(.2,.8,.2,1); }
.auth2[data-mode="activate"] .auth2-tab-ink, .auth2[data-mode="register"] .auth2-tab-ink { transform:translateX(100%); }
.auth2-body { animation:auth2-fade .4s ease both; }
.auth2-body h2 { margin:0 0 6px; font-size:24px; font-weight:600; }
.auth2-body > p.muted { margin:0 0 20px; font-size:13px; }
.auth2-body label { font-size:12px; margin-bottom:14px; color:#48576a; }
.auth2-body input:not([type="checkbox"]) { min-height:46px; border-radius:10px; border-color:#cdd2d9; transition:border-color .2s, box-shadow .2s; }
.auth2-body input:not([type="checkbox"]):focus { outline:none; border-color:#C40123; box-shadow:0 0 0 4px rgba(196,1,35,.12); }
.pw-field { position:relative; display:block; }
.pw-field input { padding-right:46px; }
.pw-eye { position:absolute; right:6px; top:50%; margin-top:3px; transform:translateY(-50%); width:36px; height:36px; min-height:0; padding:0; border:0; border-radius:8px; background:transparent; color:#7a828d; }
.pw-eye:hover { background:#f1f2f5; color:#121316; }
.pw-eye svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.pw-eye[aria-pressed="true"] { color:#C40123; }
.auth2-body .primary { width:100%; min-height:50px; margin-top:6px; color:#fff; font-size:15px; font-weight:600; border-radius:12px; transition:transform .15s, background .2s, box-shadow .2s; box-shadow:0 10px 24px -12px rgba(196,1,35,.7); }
.auth2-body .primary:hover { transform:translateY(-1px); }
.auth2-body .primary:active { transform:translateY(0) scale(.99); }
.auth2-body form[aria-busy="true"] .primary { color:transparent; position:relative; pointer-events:none; }
.auth2-body form[aria-busy="true"] .primary::after { content:""; position:absolute; left:50%; top:50%; width:20px; height:20px; margin:-10px 0 0 -10px; border-radius:50%; border:2px solid rgba(255,255,255,.4); border-top-color:#fff; animation:auth2-spin .7s linear infinite; }
.auth2-bot { margin:18px 0 0; padding:12px 14px; border-radius:12px; background:#fff5f6; color:#5b2430; font-size:12.5px; line-height:1.45; }
.auth2-bot a { color:#C40123; font-weight:600; }
.auth2-links { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin-top:auto; padding-top:18px; border-top:1px solid #eceef2; font-size:12.5px; color:#7a828d; }
.auth2-links span { margin-right:auto; }
.auth2-links a { display:inline-flex; align-items:center; gap:4px; color:#121316; font-weight:550; text-decoration:none; }
.auth2-links a svg { width:14px; height:14px; fill:none; stroke:#C40123; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; transition:transform .2s; }
.auth2-links a:hover svg { transform:translate(2px,-2px); }
.auth2-links { margin-top:18px; }
.auth2-card .auth-notice { margin-bottom:16px; }

/* Вход: каскад появления. */
.auth2:not(.is-switch) .auth2-hero > :not(.auth2-glow) { animation:auth2-rise .7s cubic-bezier(.2,.8,.2,1) both; }
.auth2:not(.is-switch) .auth2-hero h1 span { animation:auth2-rise .8s cubic-bezier(.2,.8,.2,1) both; }
.auth2:not(.is-switch) .auth2-hero h1 span:last-child { animation-delay:.12s; }
.auth2:not(.is-switch) .auth2-lead { animation-delay:.18s; }
.auth2:not(.is-switch) .auth2-preview { animation-delay:.28s; }
.auth2:not(.is-switch) .auth2-steps { animation-delay:.38s; }
.auth2:not(.is-switch) .auth2-safe { animation-delay:.46s; }
.auth2:not(.is-switch) .auth2-card { animation:auth2-rise .7s .1s cubic-bezier(.2,.8,.2,1) both; }
.auth2.is-switch .pv-bar i { animation:none; }

@keyframes auth2-rise { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
@keyframes auth2-fade { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
@keyframes auth2-grow { from { transform:scaleX(0); } to { transform:scaleX(1); } }
@keyframes auth2-drift { from { transform:translate(0,0) scale(1); } to { transform:translate(-90px,70px) scale(1.12); } }
@keyframes auth2-pulse { 0% { box-shadow:0 0 0 0 rgba(61,220,132,.55); } 70% { box-shadow:0 0 0 9px rgba(61,220,132,0); } 100% { box-shadow:0 0 0 0 rgba(61,220,132,0); } }
@keyframes auth2-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .auth2 *, .auth2 *::before, .auth2 *::after { animation:none !important; transition:none !important; }
}

@media (max-width: 960px) {
  .auth2 { grid-template-columns:1fr; margin-top:16px; gap:14px; }
  .auth2-hero { padding:28px 22px 24px; gap:16px; }
  .auth2-preview { display:none; }
}
@media (max-width: 600px) {
  .auth2 { padding:0 16px; }
  .auth2-hero h1 { font-size:32px; }
  .auth2-lead { font-size:14px; }
  .auth2-steps { grid-template-columns:1fr; gap:6px; }
  .auth2-steps li { flex-direction:row; align-items:center; padding:9px 10px; }
  .auth2-steps b { flex:none; }
  .auth2-safe { display:none; }
  .auth2-card { padding:20px 18px 16px; }
}
/* Шапка в итоговом слое тёмная (#0c0a0b): ссылки на сайты PROCVETAEV — светлые. */
.topbar .toplinks a { color:rgba(255,255,255,.72); }
.topbar .toplinks a:hover { color:#fff; }
/* Телефон: форма входа — на первом экране; шаги «как получить доступ» дублирует подсказка про бота в карточке. */
@media (max-width: 600px) {
  .auth2 { margin-top:12px; }
  .auth2-hero { padding:22px 20px 20px; gap:12px; border-radius:16px; }
  .auth2-hero h1 { font-size:30px; }
  .auth2-steps { display:none; }
  .auth2-card { border-radius:16px; }
}
/* Регистрация: срок 6 месяцев и бесплатное продление — красным, как просил заказчик. */
.auth2-term { margin:0 0 18px !important; padding:10px 12px; border-radius:10px; border:1px solid #f3c2ca; background:#fff4f6; color:#C40123 !important; font-size:13px !important; line-height:1.45; }
.auth2-term b { color:#C40123; }
/* Кнопка продления в шапке и экран «месяц закончился». */
.renew-btn { min-height:34px; padding:6px 14px; border:0; border-radius:999px; background:#C40123; color:#fff; font-size:12.5px; font-weight:600; box-shadow:0 6px 16px -8px rgba(196,1,35,.8); animation:auth2-pulse-red 2.6s ease-out infinite; }
.renew-btn:hover { background:#9C011C; color:#fff; }
@keyframes auth2-pulse-red { 0% { box-shadow:0 0 0 0 rgba(196,1,35,.45); } 70% { box-shadow:0 0 0 10px rgba(196,1,35,0); } 100% { box-shadow:0 0 0 0 rgba(196,1,35,0); } }
.renew-panel { max-width:560px; margin:56px auto; padding:36px 32px; text-align:center; border-radius:20px; animation:auth2-rise .6s cubic-bezier(.2,.8,.2,1) both; }
.renew-panel h1 { margin:14px 0 10px; font-size:26px; }
.renew-panel p { margin:0 0 10px; font-size:14px; }
.renew-panel .primary { margin-top:12px; min-height:50px; padding:0 28px; color:#fff; font-weight:600; border-radius:12px; }
.renew-ico { display:inline-grid; place-items:center; width:58px; height:58px; border-radius:50%; background:#fff1f3; color:#C40123; font-size:28px; }
.renew-free { color:#C40123; }
@media (prefers-reduced-motion: reduce) { .renew-btn, .renew-panel { animation:none; } }
@media (max-width: 600px) { .renew-panel { margin:24px 16px; padding:28px 20px; } #account .access-badge { display:none; } }
/* Галочка согласия в новой карточке (старое правило было на .auth-card). */
.auth2-body label.consent { display:flex; align-items:flex-start; gap:10px; font-weight:450; line-height:1.45; color:#48576a; }
.auth2-body label.consent input { flex:none; width:18px; height:18px; min-height:0; margin:1px 0 0; padding:0; accent-color:#C40123; }
.auth2-body label.consent a { color:#C40123; }
/* Открытая подсказка «?» в углу панели — карточка-поповер. Раньше блок оставался шириной с кнопку
   (16–26px, position:absolute), и текст шёл по слову в строке за правый край экрана. */
.panel > .compact-help[open] {
  width:min(380px, calc(100vw - 48px)); max-height:min(70vh, 560px); overflow:auto; z-index:30;
  top:8px; right:8px; padding:10px 14px 14px; background:#fff; border:1px solid #dce0e5; border-radius:14px;
  box-shadow:0 22px 48px -18px rgba(18,19,22,.38); animation:auth2-fade .2s ease both;
}
.panel > .compact-help[open] > summary { display:flex; margin:0 0 4px auto; }
.panel > .compact-help[open] p, .panel > .compact-help[open] li { font-size:13px; line-height:1.5; }
.panel > .compact-help[open] .link { white-space:normal; text-align:left; }
/* Телефон: срок доступа в шапке виден коротко — без счётчика места. */
@media (max-width: 600px) {
  #account .access-badge { display:inline-flex; padding:4px 9px; font-size:11px; }
  #account .access-badge .ab-sep, #account .access-badge .ab-sep + span { display:none; }
  #account { gap:8px; }
  #account .renew-btn { min-height:32px; padding:5px 11px; font-size:11.5px; }
}
/* Сенсорные экраны: у мелких «?» область нажатия 44px, сама кнопка прежнего размера. */
@media (pointer: coarse) {
  .settlement-help, #profit-ledger .ledger-help, .panel > .compact-help > summary { position:relative; }
  .settlement-help::after, #profit-ledger .ledger-help::after, .panel > .compact-help > summary::after { content:""; position:absolute; inset:-10px; }
}
@media (max-width: 420px) { #account .access-badge { display:none; } }
