:root {
  color-scheme: light;
  --ink: #19363e;
  --muted: #50666a;
  --action: #006659;
  --line: #ccd9d7;
  font: 16px/1.5 "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #f3f6f5;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--action); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: 68rem; width: calc(100% - 3rem); margin-inline: auto; }
.skip { position: absolute; inset: 0 auto auto 0; transform: translateY(-110%); z-index: 2; padding: .75rem; background: white; }
.skip:focus { transform: none; }
header { background: #183744; color: white; }
.top { min-height: 4rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.top a { display: inline-flex; align-items: center; min-height: 44px; color: white; }
.brand { min-width: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.04em; text-decoration: none; overflow-wrap: anywhere; }
main { padding-block: 2.5rem 4rem; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.12; letter-spacing: -.04em; margin-bottom: 1.5rem; }
h2 { font-size: 1.35rem; letter-spacing: -.025em; line-height: 1.3; }
h3 { font-size: 1.03rem; line-height: 1.35; }
.panel { background: white; border: 1px solid var(--line); border-radius: .85rem; padding: 1.5rem; min-width: 0; }
.panel > * + *, details > form, .record > * + * { margin-top: .8rem; }
.auth { width: min(100%, 31rem); }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(16rem, 1fr); gap: 1rem; align-items: start; }
.stack { display: grid; gap: 1rem; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; align-items:center; gap: .5rem 1rem; }
.actions a { display: inline-flex; align-items: center; min-height: 44px; }
.record { border-top: 1px solid var(--line); padding-block: 1rem .25rem; overflow-wrap: anywhere; }
details > summary { cursor: pointer; color: var(--action); font-weight: 600; min-height: 44px; padding-block: .55rem; }
form { display: grid; gap: .9rem; }
label { display: grid; gap: .3rem; font-weight: 600; }
label small { color: var(--muted); font-weight: 400; font-size: .88rem; }
input, select, button { font: inherit; min-height: 44px; border-radius: .4rem; }
input, select { width: 100%; min-width: 0; padding: .55rem .7rem; border: 1px solid #839997; color: var(--ink); background: white; }
button { padding: .55rem 1rem; width: fit-content; max-width: 100%; background: var(--action); color: white; border: 1px solid var(--action); cursor: pointer; font-weight: 600; }
button:hover:not(:disabled) { background: #104d47; }
button.secondary { color: var(--action); background: white; border-color: #9bb1ae; }
button.danger { color: #84291f; background: white; border-color: #c8a69e; }
button.secondary:hover:not(:disabled) { color: #124139; background: #e3f0eb; }
button.danger:hover:not(:disabled) { color: #702316; background: #f9e8e4; }
button:active:not(:disabled) { box-shadow: inset 0 0 0 2px currentColor; }
button:is(:disabled,.secondary:disabled,.danger:disabled) { color: #3d5157; background: #e6ecee; border-color: #a6b8bd; opacity: 1; cursor: not-allowed; }
:focus-visible { outline: 3px solid #3389ad; outline-offset: 3px; }
.muted, dt { color: var(--muted); }
dl { display: grid; gap: .7rem; }
dt { font-size: .87rem; }
dd, h1, h2 { overflow-wrap: anywhere; }
#notice:not(:empty), .feedback:not(:empty) { padding: .7rem .9rem; background: #e5f1ed; border-left: 3px solid var(--action); }
#notice:not(:empty) { margin-bottom: 1.2rem; }
.feedback:empty, #notice:empty { display: none; }
.feedback.error, #notice.error { background: #faefeb; border-color: #a64733; color: #72281b; }
.status { display: inline-block; color: #38554f; background: #e8f2ee; padding: .18rem .6rem; border-radius: 1rem; font-size: .88rem; }
.dashboard-intro, .plan-list { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-intro a { display: inline-flex; align-items: center; min-height: 44px; }
#tariff { margin-block: 1rem; }
#tariff h4 { margin: 0; font-size: 1rem; }
#tariff .tariff-group { border-top: 1px solid var(--line); padding-top: .75rem; }
.tariff-group > p, .plan-list { margin-top: .45rem; }
.tariff-group .record { border-top: 0; border-left: 3px solid var(--line); margin-top: .55rem; padding: .35rem .85rem; }
.tariff-group .record > * + * { margin-top: .3rem; }
.plan-list > div { border-left: 2px solid var(--line); padding-left: .75rem; }
.plan-list dt { color: var(--ink); font-size: 1rem; font-weight: 650; }
.plan-list dd { color: var(--muted); }
#tariff form { max-width: 36rem; }
.period-fields { display: grid; gap: .85rem; }
.period-fields[hidden] { display: none; }
@media (max-width: 750px) {
  .dashboard, .dashboard-intro, .plan-list { grid-template-columns: 1fr; }
  .wrap { width: calc(100% - 2rem); }
  .panel { padding: 1.15rem; }
  main { padding-top: 1.75rem; }
}
@media (max-width: 385px) { .top { gap: .6rem; } .top nav { font-size: .9rem; } }
.report-stack { display:grid; gap:.75rem; min-width:0; }
.report-stack > * { min-width:0; }
.report-stack [hidden] { display:none; }
.report-stack h4 { margin:0; }
.report-progress {
 display:grid; grid-template-columns:auto 1fr; gap:.15rem .75rem; align-items:center;
 margin:.8rem 0; padding:1rem; color:#154b49; background:#e4f2ed;
 border:1px solid #95b9ae; border-left:4px solid #006358; border-radius:8px;
}
.report-progress::before {
 content:""; width:1.1rem; height:1.1rem; border:2px solid #95b9ae;
 border-top-color:#006358; border-radius:50%; animation:report-spin 1s linear infinite;
}
.report-progress p { grid-column:2; margin:0; }
.workspace #reports .report-problem { grid-column:1/-1; }
@keyframes report-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce){.report-progress::before{animation:none;}}
.transfer-check { display:flex; align-items:flex-start; gap:.6rem; font-weight:400; }
.transfer-check input { width:1.25rem; height:1.25rem; min-height:0; flex:none; margin:.2rem 0 0; }
.legal-check { min-height: 44px; align-items: center; }
.legal-check a { overflow-wrap: anywhere; }
.file-row { display:flex; align-items:center; justify-content:space-between; gap:.6rem; overflow-wrap:anywhere; }
.file-row span { min-width:0; }
.report-stack .record { overflow-wrap:anywhere; }
.account-home { color:white; }

.file-row button { flex:none; white-space:nowrap; }

#comparison { margin-block: 1rem; min-width: 0; }
#comparison > * + *, #comparison-result > * + * { margin-top: .8rem; }
#comparison h3 { margin-top: 1.5rem; }
.sub-controls, .sub-selection, .sub-calendar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem),1fr)); gap: .75rem; }
.sub-calendar { max-height: 30rem; overflow-y: auto; overscroll-behavior: contain; padding: .2rem .4rem; }
.sub-calendar > .record, .sub-selection > div { min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: .65rem; margin: 0; }
.sub-calendar h4, .sub-selection h4 { margin: 0 0 .5rem; }
.sub-calendar button, .sub-selection button { margin-top: .4rem; }
#comparison-result { min-width: 0; }
#sub-advice a { display: inline-block; margin-right: 1rem; padding-block: .5rem; }
.sub-table { overflow-x: auto; max-width: 100%; }
.sub-table table { border-collapse: collapse; width: 100%; }
.sub-table td, .sub-table th { padding: .5rem .7rem; border-bottom: 1px solid var(--line); text-align: left; }
.sub-table td, .sub-table th { vertical-align: middle; }
.sub-table th { color: var(--muted); }
.sub-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub-table :is(td,th).number { text-align:right; font-variant-numeric:tabular-nums; }
.sub-table td:first-child { white-space: normal; min-width: 9rem; }
.profit-page { display:grid; gap:1rem; }
.profit-page .panel { min-width:0; }
.profit-page details > div, .profit-page details > form { margin-block:.75rem; }
.profit-page form { max-width:38rem; }
.profit-page .profit-totals { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.45rem 1rem; }
.profit-totals dd { text-align:right; font-variant-numeric:tabular-nums; }
.profit-cost-note { display: block; max-width: 24ch; }
.profit-page [hidden] { display:none; }

.profit-compare-dialog {
  width: min(70rem, calc(100% - 1.25rem));
  max-width: calc(100% - 1.25rem);
  max-height: 90dvh;
  overflow: auto;
}
#compare-profit dialog h2 { margin: 0; }
#compare-profit form > div:first-child {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,19rem),1fr));
  gap: 1rem;
}
#compare-profit select { max-width: 100%; }

.product-compare-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,19rem),1fr));
  gap: 1rem;
}
#products-wb-ozon select { max-width: 100%; }
#products-wb-ozon article { margin-block: 1rem; }
.product-scroll-hint { display: none; }
@media (max-width: 640px) {
  .product-scroll-hint { display: block; }
  #products-wb-ozon article table { min-width: 36rem; }
}

.product-compare-help { min-width: 2.75rem; min-height: 2.75rem; }
.product-compare-help:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.section-help-heading { display: flex; align-items: center; }
.section-help-heading > :is(h2,h3) { margin:0; min-width:0; overflow-wrap:anywhere; }

#sourceList { overflow-wrap: anywhere; padding-inline-start: 2.25rem; }
#sourceList li { margin-block: .4rem; }

[hidden] { display:none !important; }
.workspace .wrap { max-width:92rem; }
.workspace main { padding-top:1.6rem; }
.workspace h1 { margin-bottom:.85rem; }
.workspace #content { display:grid; gap:1rem; min-width:0; }
.workspace #content > * { min-width:0; }
.section-nav { display:flex; flex-wrap:wrap; align-items:center; gap:.25rem; padding:.35rem; border-bottom:1px solid var(--line); }
.section-nav a { display:inline-flex; align-items:center; min-height:44px; padding:.35rem .75rem; border-radius:.45rem; text-decoration:none; color:var(--ink); font-weight:600; }
.section-nav a:hover { background:#e8f1ee; }
.section-nav a[aria-current] { background:#006659; color:white; }
.workspace .task-intro { padding-block:1.7rem; background:#e8f1ed; }
.workspace .task-intro p { max-width:52rem; }
.workspace #new-report form { max-width:44rem; }
.workspace #new-report dialog { width:min(32rem,calc(100% - 2rem)); border:1px solid var(--line); border-radius:.7rem; padding:1.25rem; }
.workspace #new-report dialog::backdrop { background:#163038a0; }
.period-summary { padding:.55rem .75rem; border-inline-start:3px solid var(--action); background:#e8f1ed; width:fit-content; font-weight:600; }
.filter-bar { display:grid; gap:.75rem; grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr)); align-items:end; }
.catalog-filter { grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto; align-items:end; }
.profit-page #costs form.catalog-filter, .profit-page #compare-profit form, .profit-page #products-wb-ozon form { max-width:none; }
.catalog-filter .transfer-check { align-self:center; }
.workspace #reports .report-stack > .record { display:grid; grid-template-columns:minmax(9rem,1fr) minmax(12rem,1.2fr) minmax(7rem,auto); gap:.45rem 1rem; align-items:center; }
.workspace #reports .record > * { margin:0; }
.workspace #reports .record > details, .workspace #reports .record > .actions { grid-column:1/-1; }
.workspace #reports .report-versions { padding-inline-start:1rem; border-inline-start:2px solid var(--line); }
.primary-link { display:inline-flex; align-items:center; min-height:44px; width:fit-content; padding:.4rem .75rem; border-radius:.4rem; color:white; background:var(--action); text-decoration:none; }
.profit-page #profit-result { box-shadow:none; background:#f8faf9; margin-top:var(--account-section-gap); }
.workspace #settings,.profit-page { --account-section-gap:24px; }
.workspace #settings .stack,.workspace #settings .dashboard { gap:var(--account-section-gap); }
.profit-page #profit-result > details + details { margin-top:var(--account-section-gap); }
.workspace .sub-table td { overflow-wrap:anywhere; }
.workspace .sub-table td .actions { min-width:8rem; }
.workspace #products-wb-ozon td:nth-child(2),.workspace #products-wb-ozon td:nth-child(3) { min-width:7.5rem; }
.workspace #products-wb-ozon td:first-child { min-width:9rem; }
.workspace #products-wb-ozon td:nth-child(5) { min-width:9rem; }
.workspace #products-wb-ozon .report-stack > h3 { color:var(--action); }
@media (max-width:700px){
 .workspace #settings,.profit-page { --account-section-gap:20px; }
 .workspace .wrap { width:calc(100% - 1.5rem); }
 .workspace .section-nav { padding-inline:0; gap:.12rem; }
 .workspace .section-nav a { padding:.25rem .55rem; font-size:.93rem; }
 .workspace #reports .report-stack > .record,.catalog-filter,.filter-bar { grid-template-columns:minmax(0,1fr); }
 .workspace .panel { padding:1rem; }
}

.duplicate-page-heading:not(:focus) { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.history-filters { padding-bottom:.45rem; border-bottom:1px solid var(--line); }
.history-filters[open] > summary { margin-bottom:.55rem; }

button.secondary.product-compare-help {
  width:44px;min-width:44px;height:44px;min-height:44px;padding:0;
  position:relative;flex:none;margin:0;margin-inline-start:-4px;border:0;background:transparent;
}
.product-compare-help::before {
  content:'?';display:grid;place-items:center;width:20px;height:20px;
  box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  border:1px solid #8aa6a0;border-radius:50%;font-size:.78rem;color:#15574e;
}
.product-compare-help:hover::before { background:#e5f0ed; }
.new-report-fields,.wb-review-row {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:.65rem 1rem;
}
.wb-review-row details,.wb-review-row .feedback { grid-column:1/-1; }
.wb-review-row h4,#new-report .new-report-files h4 { margin:0; }
#new-report dialog::backdrop { background:#163038a0; }
@media(max-width:700px){
 .new-report-fields,.wb-review-row {grid-template-columns:minmax(0,1fr);}
}

#tariff .primary-link,.task-intro .primary-link { min-height:44px; }
#shops .record,.tariff-group { scroll-margin-top:1rem; }
#reports .previous-ready { justify-self:start; }
@media(max-width:700px){
 .task-intro .actions { align-items:stretch; }
}

.profit-summary { display:grid; grid-template-columns:1.15fr 1fr 1fr; border:1px solid var(--line); border-radius:.8rem; background:var(--surface,#fff); overflow:hidden; }
.profit-summary > div { display:grid; align-content:center; gap:.25rem; padding:.8rem 1rem; min-width:0; }
.profit-summary > div + div { border-inline-start:1px solid var(--line); }
.profit-summary span,.profit-summary small { color:var(--muted,#415762); }
.profit-primary { background:#e9f3ef; }
.profit-primary strong { font-size:1.35rem; line-height:1.25; color:#173c38; }
.profit-action-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.65rem; margin-block:.8rem; }
.profit-action,.profit-review { border:1px solid var(--line); border-radius:.7rem; padding:.7rem .85rem; min-width:0; }
.profit-action h3 { margin:.05rem 0 .4rem; }
.profit-action p,.profit-tax-state p { margin:.25rem 0 .45rem; }
.profit-tax-state + .profit-tax-state { border-top:1px solid var(--line); margin-top:.55rem; padding-top:.45rem; }
.profit-details { margin-block:.75rem; }
.profit-details > div { margin-top:.8rem; }
@media (max-width: 700px) {
 .profit-summary { grid-template-columns:1fr 1fr; }
 .profit-summary .profit-primary { grid-column:1/-1; border-bottom:1px solid var(--line); }
 .profit-summary .profit-primary + div { border-inline-start:0; }
 .profit-summary > div { padding:.65rem .75rem; }
 .profit-action-grid {grid-template-columns:1fr;}
}
