:root {
  --line: #dfe3ed;
  --violet: #5632cf;
  --pale: #f1edff;
}

body { background: #f6f7fa; }
.page { margin-top: 26px; }

.project-switcher { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 15px 0 20px; }
.switch-project { border-color: #bbacf4; color: var(--violet); }
.project-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 90px #1d23404a;
}
.project-dialog[open] { display: flex; flex-direction: column; }
.project-dialog::backdrop { background: #15172b99; backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 24px 26px 14px; }
.dialog-eyebrow { margin: 0 0 4px; color: var(--violet); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .045em; }
.dialog-head h2 { margin: 0; font-size: 27px; line-height: 1.2; }
.dialog-close { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text); font-size: 27px; line-height: 1; cursor: pointer; }
.search-label { display: block; margin: 0 26px 7px; font-size: 14px; font-weight: 650; }
.project-search { width: calc(100% - 52px); min-height: 48px; margin: 0 26px; padding: 10px 14px; border: 1px solid #cbd1dd; border-radius: 12px; background: #fff; color: var(--ink); font-size: 16px; }
.result-info { min-height: 20px; margin: 13px 26px 10px; color: var(--muted); font-size: 13px; }
.project-list { display: grid; align-content: start; gap: 8px; min-height: 0; overflow-y: auto; padding: 0 26px 15px; }
.project-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; width: 100%; min-height: 50px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; text-align: left; cursor: pointer; }
.project-option.current { border-color: #bba8fc; background: #f8f5ff; }
.project-option-title { display: block; min-width: 0; color: var(--ink); font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.project-option-price { align-self: center; color: var(--ink); font-size: 15px; font-weight: 650; white-space: nowrap; }
.project-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 26px 20px; border-top: 1px solid var(--line); }
.project-pager .btn { min-height: 44px; }
.project-pager span { color: var(--muted); font-size: 13px; text-align: center; }
.project-pager button:disabled { opacity: .45; cursor: not-allowed; }
.dialog-close:focus-visible, .project-option:focus-visible, .project-search:focus-visible { outline: 3px solid #ad98ef; outline-offset: 2px; }

.pdf-dialog {
  display: none;
  flex-direction: column;
  width: min(980px, calc(100vw - 24px));
  height: min(860px, calc(100dvh - 24px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 90px #1d23404a;
}
.pdf-dialog[open] { display: flex; }
.pdf-dialog::backdrop { background: #15172b99; backdrop-filter: blur(3px); }
.pdf-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pdf-dialog-head h2 { margin: 0; font-size: 18px; line-height: 1.2; }
.pdf-dialog-actions { display: flex; align-items: center; gap: 8px; }
.pdf-dialog-actions .btn { min-height: 42px; padding: 9px 14px; font-size: 14px; }
.pdf-frame { display: block; flex: 1; width: 100%; min-height: 0; border: 0; background: #f4f5f8; }

header > p { line-height: 1.45; }
.page header h1 { font-size: clamp(30px, 4vw, 46px); }
.full { margin-top: 5px; font-weight: 600; }
.layout { gap: 24px; margin-top: 22px; }
.toolbar { margin-bottom: 10px; }
.btn {
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 12px;
  border-color: #ccd2df;
  font-size: 15px;
  line-height: 1.2;
  transition: border-color .18s, background-color .18s, box-shadow .18s, transform .18s;
}
.btn:not(.primary) { background: #fff; box-shadow: 0 2px 10px #1d234008; }
.btn.primary { min-height: 52px; box-shadow: 0 7px 18px #5632cf35; }
.switch-project, .toolbar .btn { min-height: 40px; padding: 8px 13px; font-size: 14px; }
.toolbar .btn { box-shadow: none; }
.hint { margin-bottom: 20px; max-width: 750px; line-height: 1.5; }

.section {
  padding: 16px;
  border-radius: 15px;
  margin-bottom: 12px;
  box-shadow: 0 7px 26px #1d234008;
}
.section h2 { margin-bottom: 7px; font-size: 18px; }
.checks { gap: 0; }
.check {
  border: 0;
  border-top: 1px solid #eaebf1;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  transition: background-color .18s;
}
.check:first-child { border-top: 0; }
.check.active { background: transparent; }
.check-main {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  min-height: 42px;
  gap: 8px;
  align-items: start;
}
.module-select { display: flex; min-height: 42px; align-items: center; justify-content: center; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 0; }
.check-copy { min-width: 0; }
.check h3 { font-size: 14px; line-height: 1.3; font-weight: 650; }
.check p { margin-top: 3px; line-height: 1.4; }
.check-price { min-width: max-content; text-align: right; }
.check-price strong { font-size: 14px; line-height: 1.25; }
.module-details { grid-column: 2; margin: 0; line-height: 1.4; }
.fixed-scope .check-main { grid-template-columns: minmax(0, 1fr); }
.fixed-scope .module-details { grid-column: 1; }
.phase-heading { margin: 0 0 8px; font-size: 16px; }
.future-phase { border-style: dashed; }
.future-phase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.future-phase-head h2 { margin: 0; }
.future-phase-head strong { color: var(--violet); white-space: nowrap; }
.future-phase > p { margin: 5px 0 8px; color: var(--text); font-size: 14px; }
.future-phase ul { margin: 0; padding-left: 18px; color: var(--text); font-size: 14px; line-height: 1.4; }
.future-phase li + li { margin-top: 3px; }
.module-trigger { display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; align-items: center; gap: 8px; min-height: 42px; padding: 8px 2px; list-style: none; cursor: pointer; color: var(--ink); }
.module-trigger::-webkit-details-marker { display: none; }
.module-trigger::marker { content: ""; }
.module-trigger::after { content: "⌄"; color: var(--muted); font-size: 14px; line-height: 1; transition: transform .18s; }
.module-details[open] > .module-trigger::after { transform: rotate(180deg); }
.module-details[open] > .module-trigger { color: var(--violet); }
.module-detail-content { padding: 0 10px 10px 2px; }
.module-detail-content > p:first-child { margin: 0; }
.module-detail-content ul { margin: 8px 0 0; padding-left: 18px; color: var(--text); font-size: 14px; line-height: 1.45; }
.module-detail-content li + li { margin-top: 5px; }
.module-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 7px; color: var(--text); font-size: 13px; }
.module-meta .tag { margin: 0; }
.module-deps { margin: 7px 0 0 !important; font-size: 13px !important; }
.tag { margin-top: 5px; padding: 2px 7px; }

.summary { border-radius: 16px; box-shadow: 0 8px 24px #1d23400d; }
.summary:has(.summary-body details[open]) { position: static; }
.summary-top { padding: 15px 18px; }
.summary-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status { margin: 0; line-height: 1.35; text-align: right; }
.total { margin-top: 4px; font-size: 36px; }
.kpis { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 9px; }
.kpis > div { display: grid; gap: 2px; padding: 0; border: 0; }
.kpis strong { font-size: 18px; line-height: 1.25; }
.kpis span { font-size: 13px; line-height: 1.35; }
.summary-body { padding: 11px 18px; }
.summary-note { margin: 0; font-size: 13px; line-height: 1.4; }
.summary-body details { margin-top: 8px !important; font-size: 13px; }
.summary-body summary { padding: 3px 0; font-weight: 600; }
.selection { margin-top: 11px; max-height: none; overflow: visible; }
.selected-item { padding: 9px 0; }
.actions { padding: 0 18px 15px; justify-items: start; }
.actions .btn { width: min(100%, 340px); }
.actions .btn.primary { min-height: 44px; padding: 9px 14px; font-size: 14px; box-shadow: 0 4px 12px #5632cf25; }
.conditions li { line-height: 1.5; }
footer { margin-top: 34px; line-height: 1.5; }

.maintenance { margin-top: 16px; }
.maintenance-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; }
.maintenance-heading h2 { margin: 0; }
.maintenance-heading > p { margin: 0; color: var(--muted); font-size: 13px; }
.maintenance-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.maintenance-option { display: flex; align-items: start; justify-content: space-between; gap: 10px; min-width: 0; padding: 12px; border: 1px solid #e1dafc; border-radius: 12px; background: #fbfaff; }
.maintenance-option h3 { margin: 0; font-size: 14px; line-height: 1.35; }
.maintenance-option p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.maintenance-price { flex: 0 0 auto; color: var(--violet); font-size: 15px; white-space: nowrap; }
.maintenance-price span { font-size: 12px; font-weight: 500; }
.maintenance-support { margin: 10px 0 0; padding: 9px 11px; border-radius: 9px; background: #f1edff; color: var(--text); font-size: 13px; line-height: 1.45; }

@media (hover: hover) {
  .project-option:hover, .dialog-close:hover { border-color: #a994f5; background: #faf8ff; }
  .btn:hover { background: #f9f7ff; box-shadow: 0 5px 16px #5632cf16; transform: translateY(-1px); }
  .btn.primary:hover { background: #4925bd; box-shadow: 0 9px 22px #5632cf44; }
  .check:hover { background: #faf9ff; }
}
.btn:active { transform: translateY(0); }

@media (max-width: 920px) {
  .layout { gap: 22px; }
  .maintenance-plans { grid-template-columns: 1fr; }
  .summary { box-shadow: 0 8px 28px #1d23400e; }
  .summary-top { display: grid; grid-template-columns: max-content minmax(0, 1fr); grid-template-areas: "label label" "total metrics"; align-items: center; gap: 6px 22px; padding: 17px 21px; }
  .summary-label-row { grid-area: label; }
  .summary-top .total { grid-area: total; margin: 0; }
  .summary-top .kpis { grid-area: metrics; justify-self: start; gap: 20px; margin: 0; }
  .summary-body { padding: 13px 21px; }
  .actions { padding: 0 21px 17px; }
}

@media (max-width: 600px) {
  .page { width: calc(100% - 28px); margin-top: 20px; }
  .brand { line-height: 1.3; }
  .project-switcher { margin: 12px 0 17px; }
  .dialog-head { padding: 20px 18px 12px; }
  .dialog-head h2 { font-size: 23px; }
  .pdf-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); border-radius: 14px; }
  .pdf-dialog-head { padding: 10px 12px; }
  .pdf-dialog-head h2 { font-size: 16px; }
  .pdf-dialog-actions .btn { min-height: 40px; padding: 8px 11px; font-size: 13px; }
  .pdf-dialog-actions .dialog-close { flex-basis: 40px; width: 40px; height: 40px; }
  .search-label { margin-inline: 18px; }
  .project-search { width: calc(100% - 36px); margin-inline: 18px; }
  .result-info { margin-inline: 18px; }
  .project-list { padding-inline: 18px; }
  .project-pager { padding: 12px 18px 16px; }
  .page header h1 { font-size: clamp(28px, 7vw, 36px); }
  header > p { margin-top: 8px; font-size: 15px; }
  .full { font-size: 14px; }
  .layout { margin-top: 17px; gap: 14px; }
  .summary-top { padding: 12px 14px; }
  .summary-top .kpis { gap: 13px; }
  .summary-top .total { font-size: 32px; }
  .summary-top .kpis strong { font-size: 15px; }
  .summary-top .kpis span { font-size: 12px; }
  .summary-body { padding: 9px 14px; }
  .actions { padding: 0 14px 12px; justify-items: stretch; }
  .actions .btn { width: 100%; }
  .toolbar { margin-bottom: 8px; }
  .toolbar .btn { width: auto; min-height: 38px; }
  .hint { margin-bottom: 12px; font-size: 12px; }
  .section { padding: 12px; margin-bottom: 10px; border-radius: 13px; }
  .section h2 { margin-bottom: 5px; font-size: 16px; }
  .maintenance { margin-top: 12px; }
  .maintenance-plans { gap: 7px; }
  .maintenance-option { padding: 10px; }
  .maintenance-heading { margin-bottom: 8px; }
  .maintenance-support { margin-top: 8px; }
  .check-main { min-height: 40px; grid-template-columns: 18px minmax(0, 1fr); padding: 0; gap: 8px; }
  .module-select { min-height: 40px; }
  .check input { width: 16px; height: 16px; }
  .check h3 { font-size: 13px; }
  .module-trigger { min-height: 40px; grid-template-columns: minmax(0, 1fr) auto 12px; padding: 7px 1px; gap: 6px; }
  .check-price { min-width: max-content; margin: 0; display: block; text-align: right; }
  .check-price strong { font-size: 13px; }
  .module-details { margin: 0; }
  .module-detail-content { padding: 0 7px 8px 1px; }
  footer { margin-top: 18px; }
}

@media (max-width: 360px) {
  .page { width: calc(100% - 24px); }
  .project-pager { gap: 5px; padding-inline: 12px; }
  .project-pager .btn { padding-inline: 10px; }
  .section { padding: 10px; }
  .check-main { gap: 7px; }
  .module-trigger { grid-template-columns: minmax(0, 1fr) auto 10px; gap: 4px; }
  .summary-top { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 13px; column-gap: 12px; }
  .summary-label-row { align-items: start; }
  .summary-top .kpis { gap: 12px; }
  .summary-body { padding: 11px 13px; }
  .actions { padding: 0 13px 13px; }
}

@media (max-width: 360px) {
  .summary-top { grid-template-columns: 1fr; grid-template-areas: "label" "total" "metrics"; gap: 5px; }
  .summary-top .kpis { gap: 18px; }
}

.scope-divider {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 3px 9px;
  color: #27304a;
  font-size: 14px;
}
.scope-divider:not(:first-child) { margin-top: 10px; }
.scope-divider span { color: #5434d1; font-weight: 700; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .btn, .check { transition: none; }
}

@media print {
  .section { box-shadow: none; }
  .check { box-shadow: none; }
  .page { margin: 0; }
  .project-switcher, .project-dialog, .pdf-dialog { display: none !important; }
}
