:root {
  color-scheme: light;
  --bg: #f7f7fb;
  --surface: #fff;
  --ink: #231d35;
  --muted: #625c76;
  --line: #eae7f1;
  --purple: #623fc3;
  --deep: #5130af;
  --soft: #f0eafa;
  --green: #176247;
  --shadow: 0 2px 5px #30274c04;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
a { color: inherit; text-decoration: none; }
svg { flex: none; vertical-align: middle; }
:focus-visible { outline: 2px solid #704cd3; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.boot { display: grid; place-content: center; min-height: 100vh; text-align: center; gap: 12px; }
.boot strong { font-size: 24px; }
.shell { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; background: white; border-right: 1px solid var(--line); padding: 27px 19px 20px; z-index: 4; }
.brand { display: flex; align-items: center; gap: 11px; border-radius: 9px; margin: 0 6px; width: fit-content; }
.brand img { flex: none; border-radius: 12px; }
.brand strong { display: block; font-size: 18px; font-weight: 740; letter-spacing: -.38px; line-height: 1.22; }
.brand small { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; }
.nav { display: grid; gap: 5px; margin-top: 38px; }
.nav + .nav { margin-top: 30px; }
.nav-caption { color: #746b88; font-size: 11px; letter-spacing: .09em; font-weight: 750; text-transform: uppercase; margin: 0 11px 7px; }
.nav a { display: flex; min-height: 46px; align-items: center; gap: 11px; color: #534c64; padding: 9px 11px; border-radius: 10px; font-size: 14px; font-weight: 550; }
.nav a:hover { background: #f7f4fc; }
.nav a[aria-current="page"] { color: #5730b2; background: #f0eafa; font-weight: 720; }
.local { display: flex; gap: 10px; align-items: center; padding: 12px 11px; margin-top: auto; background: #f7f6fb; border: 1px solid #efedf4; border-radius: 12px; }
.local > svg { color: #625588; }
.local strong { font-size: 13px; display: block; }
.local small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.account > div { min-width: 0; overflow: hidden; }
.account strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account button { margin-left: auto; flex: none; }
.signin { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.signin-shell { width: min(100%, 960px); min-height: 480px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: white; box-shadow: 0 14px 80px #2e174216; }
.signin-main { padding: clamp(24px, 4.5vw, 56px); }
.signin-main .brand { margin: 0 0 30px; }
.signin h1 { font-size: clamp(24px, 3vw, 33px); font-weight: 740; line-height: 1.15; letter-spacing: -.035em; }
.signin p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.signin form { display: grid; gap: 13px; margin-top: 22px; }
.signin .form-message { color: #9b2c47; margin: 0; }
.signin .form-message:empty { display: none; }
.signin-art { position: relative; isolation: isolate; padding: 34px; color: #2d1c54; background: linear-gradient(140deg, #efe7fc, #e5d7fa); }
.signin-art strong { font-size: clamp(25px, 3.5vw, 38px); letter-spacing: -.04em; line-height: 1.12; }
.signin-art img { position: absolute; bottom: 11px; left: 5%; width: 90%; height: auto; z-index: -1; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--line); padding: 0 34px; gap: 16px; }
.top-title { font-size: 14px; font-weight: 690; color: #50485f; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 17px; }
.today { display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; font-size: 13px; }
.quick-search { display: flex; align-items: center; text-align: left; min-width: 208px; background: #f8f7fb; border: 1px solid #eeeaf4; color: #5f5672; border-radius: 9px; padding: 7px 10px; gap: 8px; font-size: 13px; }
.quick-search:hover { background: var(--soft); }
kbd { margin-left: auto; border: 1px solid #e6e1f0; background: #fff; border-radius: 5px; padding: 1px 5px; font: 11px "Segoe UI", sans-serif; color: #675f77; }
.menu-toggle { display: none !important; }
.wrap { padding: 26px 34px 38px; max-width: 1510px; margin-inline: auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 13px; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(27px, 2.55vw, 37px); font-weight: 760; letter-spacing: -.044em; line-height: 1.2; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 15px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 41px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; color: white; background: var(--purple); white-space: nowrap; font-size: 14px; }
.btn:hover { background: var(--deep); }
.btn.alt { color: #514665; background: white; border-color: #e5dff0; }
.btn.alt:hover { background: #f5f0ff; border-color: #d5c8ec; }
.btn.light { background: #eee8fb; color: #5635af; }
.btn.light:hover { background: #e8dffa; }
.btn.danger { background: #a32b45; }
.btn.danger:hover { background: #832039; }
.btn.small { min-height: 34px; font-size: 13px; padding: 5px 10px; }
.icon-btn { background: transparent; border: 0; border-radius: 8px; min-width: 32px; min-height: 32px; color: #665787; display: inline-grid; place-items: center; }
.icon-btn:hover { background: #f0eafa; color: var(--deep); }
.hero { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; min-height: 237px; padding: 26px 30px; background: linear-gradient(107deg, #ede5fd 0%, #eee6fb 50%, #e5d8fb 100%); border: 1px solid #e9def7; border-radius: 19px; margin-bottom: 19px; }
.hero::before, .hero::after { position: absolute; z-index: -1; content: ""; border: 1px solid #faf7ff99; border-radius: 50%; width: 520px; height: 320px; transform: rotate(-16deg); right: -81px; top: -60px; }
.hero::after { width: 565px; height: 357px; right: -103px; top: -77px; }
.hero-info { position: relative; z-index: 1; max-width: 67%; }
.hero-label { color: #5d3fa4; font-size: 12px; font-weight: 730; display: flex; gap: 7px; align-items: center; margin-bottom: 8px; }
.hero h2 { font-size: clamp(27px, 3vw, 42px); font-weight: 770; line-height: 1.12; letter-spacing: -.045em; color: #2d1c54; }
.hero p { margin-top: 10px; color: #5b4d72; font-size: 15px; }
.hero .btn { margin-top: 18px; }
.hero-art { width: 46%; height: 109%; object-fit: contain; object-position: center bottom; position: absolute; bottom: -4px; right: 3.7%; z-index: 0; pointer-events: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.metric { background: var(--surface); padding: 16px; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); min-width: 0; }
.metric-head { display: flex; align-items: center; gap: 9px; color: #554b66; font-weight: 600; font-size: 14px; }
.metric strong { display: block; font-weight: 750; font-size: 30px; line-height: 1.16; letter-spacing: -.045em; margin: 7px 0 2px; }
.metric small { display: block; color: var(--muted); font-size: 12px; }
.tone { width: 35px; height: 35px; border-radius: 10px; display: inline-grid; place-items: center; flex: none; }
.violet { background: #f1eafd; color: #673ec4; }
.blue { background: #e8f1ff; color: #2f61ab; }
.green { background: #e6f6ee; color: #207958; }
.amber { background: #fff0dc; color: #995b10; }
.rose { background: #fae9ef; color: #9a4265; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(265px, 1fr); gap: 17px; align-items: start; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.panel-head { padding: 17px 18px 15px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.panel-head h2, .form-panel h2 { font-size: 18px; font-weight: 730; letter-spacing: -.022em; line-height: 1.3; }
.panel-head p, .form-panel > p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.linklike { color: var(--deep); background: transparent; font-weight: 650; border: 0; border-radius: 6px; padding: 4px 3px; font-size: 13px; white-space: nowrap; }
.linklike:hover { text-decoration: underline; }
.workflow { padding: 2px 16px 15px; display: grid; gap: 6px; }
.workflow a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border-radius: 9px; min-height: 54px; padding: 6px 5px; }
.workflow a:hover { background: #f8f5fb; }
.workflow a > svg { color: #81748f; }
.workflow strong { display: block; font-size: 14px; }
.workflow small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: #645a77; font-size: 13px; font-weight: 650; background: #f8f7fa; }
td { font-size: 14px; border-top: 1px solid #f0edf4; }
.list-table th, .list-table td { padding: 10px 13px; }
.list-table th:first-child, .list-table td:first-child { padding-left: 18px; }
.list-table th:last-child, .list-table td:last-child { padding-right: 18px; }
.list-table tbody tr:hover { background: #fbf9fe; }
.list-table .name-wrap { display: flex; align-items: center; gap: 9px; min-width: 126px; }
.avatar { border-radius: 50%; width: 34px; height: 34px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 740; flex: none; }
.avatar.big { width: 49px; height: 49px; font-size: 17px; }
.person-name { font-weight: 660; display: inline-block; line-height: 1.25; }
a.person-name:hover { color: var(--deep); text-decoration: underline; }
.list-table small { display: block; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 16px; font-size: 12px; font-weight: 640; white-space: nowrap; vertical-align: middle; }
.badge::before { content: ""; background: currentColor; width: 5px; height: 5px; border-radius: 50%; }
.badge.neutral { color: #5f576d; background: #efedf3; }
.list-table .open-cell { width: 1%; }
.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 16px 18px; }
.search-field { display: flex; align-items: center; gap: 8px; position: relative; min-width: 225px; flex: 1; color: var(--muted); }
.search-field svg { position: absolute; left: 12px; }
.search-field input { padding-left: 39px; }
.filters > select { width: auto; max-width: 100%; }
.countline { padding: 10px 18px 13px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); font-size: 14px; }
.empty .tone { margin-bottom: 8px; }
.empty h2, .empty h3 { color: var(--ink); margin-bottom: 5px; }
.empty .btn { margin-top: 12px; }
.crumb { display: flex; align-items: center; gap: 6px; color: var(--deep); width: max-content; font-size: 14px; font-weight: 620; margin-bottom: 12px; }
.crumb:hover { text-decoration: underline; }
.profile-top { padding: 15px 18px; margin-bottom: 15px; display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.profile-title { display: flex; align-items: center; gap: 10px; }
.profile-title h1 { font-size: clamp(22px, 2.35vw, 31px); letter-spacing: -.035em; line-height: 1.18; overflow-wrap: anywhere; }
.profile-title p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.editor { display: grid; grid-template-columns: 219px minmax(0, 1fr); align-items: start; gap: 15px; }
.editor-nav { position: sticky; top: 12px; padding: 10px; }
.editor-nav strong { display: block; font-size: 14px; margin: 5px 5px 1px; }
.editor-nav small { color: var(--muted); font-size: 12px; margin-inline: 5px; }
progress { width: 100%; height: 6px; display: block; overflow: hidden; border: 0; border-radius: 8px; background: #eeeaf5; accent-color: var(--purple); }
progress::-webkit-progress-bar { background: #eeeaf5; }
progress::-webkit-progress-value { background: var(--purple); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--purple); }
.editor-nav progress { width: calc(100% - 10px); margin: 8px 5px 11px; }
.editor-nav a { display: grid; grid-template-columns: 18px minmax(0, 1fr) 13px; gap: 8px; align-items: center; min-height: 39px; color: #5a506a; font-weight: 620; border-radius: 8px; padding: 7px 6px; font-size: 12.5px; }
.editor-nav a:hover, .editor-nav a[aria-current="page"] { background: var(--soft); color: var(--deep); }
.editor-nav a .done { color: var(--green); }
.editor-main > header { margin: 1px 0 11px; }
.editor-main > header h2 { font-size: 22px; letter-spacing: -.02em; }
.editor-main > header p { color: var(--muted); font-size: 14px; }
.form-panel { padding: 17px; margin-bottom: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.wide { grid-column: 1 / -1; }
.field, .choice-field { min-width: 0; display: grid; gap: 5px; align-content: start; }
.field > span, .choice-field legend { color: #514764; font-size: 14px; font-weight: 640; }
fieldset.choice-field { margin: 0; padding: 0; border: 0; }
.choice-field legend { padding: 0; margin-bottom: 6px; }
.checks { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; min-height: 35px; padding: 6px 9px; color: #514966; background: #f9f7fc; border: 1px solid #eeeaf4; border-radius: 8px; font-size: 13px; cursor: pointer; }
.checks input { accent-color: var(--purple); margin: 0; height: 15px; width: 15px; }
input:not([type=checkbox], [type=file]), select, textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #ddd8e8; border-radius: 8px; background-color: white; color: var(--ink); font-size: 14px; }
input::placeholder, textarea::placeholder { color: #786f89; }
input:focus, select:focus, textarea:focus { outline: 2px solid #dfd0fa; outline-offset: 0; border-color: #a68cdb; }
[aria-invalid="true"] { border-color: #b34255 !important; }
select { appearance: none; padding-right: 28px; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23665b7a' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; }
textarea { display: block; resize: vertical; min-height: 79px; }
.form-panel .scroll { margin: 12px 0 0; border: 1px solid var(--line); border-radius: 9px; }
.edit-table { min-width: 500px; }
.edit-table.wide-table { min-width: 660px; }
.edit-table th, .edit-table td { padding: 8px; vertical-align: top; }
.edit-table th[scope=row] { min-width: 100px; max-width: 190px; font-size: 14px; text-align: left; background: #fcfbfd; border-top: 1px solid #f0edf4; padding-top: 16px; }
.edit-table td textarea { min-height: 59px; min-width: 106px; }
.edit-table td select { min-width: 105px; }
.edit-table td input[type=number] { min-width: 64px; }
.edit-table .remove-cell { width: 1%; }
.form-panel > .btn { margin-top: 12px; }
.flow-footer { display: flex; justify-content: space-between; gap: 8px; }
.save-state { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.save-state[data-kind="ok"] { color: var(--green); }
.save-state[data-kind="failed"] { color: #a32b45; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; margin-bottom: 16px; }
.bar-list { display: grid; gap: 12px; padding: 2px 18px 20px; }
.bar-list li { display: grid; grid-template-columns: minmax(95px, 1fr) minmax(85px, 1.8fr) 48px; align-items: center; gap: 8px; font-size: 14px; }
.bar-list strong { text-align: right; }
.text-panel { padding: 17px 19px; margin-bottom: 14px; }
.text-panel h2 { font-size: 19px; margin-bottom: 5px; }
.text-panel p { color: var(--muted); font-size: 15px; max-width: 75ch; }
.text-panel .actions, .text-panel p + p { margin-top: 11px; }
dialog { width: min(94vw, 460px); border: 1px solid var(--line); border-radius: 17px; color: var(--ink); padding: 20px; box-shadow: 0 16px 75px #21153137; }
dialog::backdrop { background: #20163364; backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.dialog-head h2 { font-size: 21px; }
dialog .field-grid { margin-bottom: 14px; }
dialog p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
dialog .actions { justify-content: flex-end; }
#toast { position: fixed; bottom: 18px; right: 18px; max-width: min(440px, calc(100vw - 36px)); padding: 11px 14px; z-index: 8; border-radius: 9px; background: #33274c; color: white; font-size: 14px; box-shadow: 0 6px 21px #2c204136; }
#toast:empty, #print-view { display: none; }

@media (max-width: 1130px) {
  .shell { grid-template-columns: 211px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .topbar, .wrap { padding-inline: 22px; }
  .metric { padding: 12px; }
  .metric-head { gap: 7px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.53fr) minmax(235px, 1fr); gap: 13px; }
  .list-table th, .list-table td { padding-inline: 8px; }
  .list-table th:first-child, .list-table td:first-child { padding-left: 13px; }
  .list-table th:last-child, .list-table td:last-child { padding-right: 13px; }
}
@media (max-width: 915px) {
  .dashboard-grid, .report-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-art { right: 1%; width: 46%; height: 89%; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-nav { position: static; display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
  .editor-nav strong, .editor-nav small, .editor-nav progress { display: none; }
  .editor-nav a { grid-template-columns: 16px auto 12px; }
}
@media (max-width: 700px) {
  .signin { padding: 15px; }
  .signin-shell { grid-template-columns: 1fr; width: min(100%, 430px); min-height: 0; }
  .signin-art { display: none; }
  .shell { display: block; }
  .menu-toggle { display: inline-grid !important; }
  .sidebar { display: none; position: fixed; width: 230px; top: 55px; left: 0; height: calc(100dvh - 55px); overflow-y: auto; box-shadow: 10px 0 30px #20163326; }
  .sidebar.open { display: flex; }
  .topbar { padding: 0 13px; height: 55px; gap: 6px; justify-content: flex-start; position: sticky; top: 0; z-index: 5; }
  .top-right { margin-left: auto; }
  .today { display: none; }
  .quick-search { min-width: auto; padding: 7px 8px; }
  .quick-search kbd { display: none; }
  .wrap { padding: 16px 13px 28px; }
  .page-head { margin-bottom: 14px; }
  .hero { min-height: 217px; padding: 18px 15px; }
  .hero-info { max-width: 100%; }
  .hero h2 { max-width: 250px; }
  .hero p { max-width: 57%; font-size: 13px; }
  .hero-art { bottom: 5px; right: 0; width: 53%; height: 65%; }
  .stats { gap: 8px; }
  .metric-head { font-size: 13px; }
  .metric .tone { width: 29px; height: 29px; }
  .list-table { min-width: 400px; }
  .compact-table { min-width: 0; }
  .compact-table th:last-child, .compact-table .open-cell { display: none; }
  .compact-table .badge { white-space: normal; }
  .compact-table .name-wrap { min-width: 90px; }
  .profile-top { padding: 11px; }
  .field-grid { grid-template-columns: 1fr; }
  .save-state { order: 3; width: 100%; }
  .edit-table, .edit-table.wide-table { display: block; min-width: 0; }
  .edit-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .edit-table tbody, .edit-table tr { display: block; width: 100%; }
  .edit-table th[scope=row] { display: block; max-width: none; padding: 9px; background: #f1ebf8; }
  .edit-table td[data-label] { display: grid; gap: 4px; padding: 7px 9px; }
  .edit-table td[data-label]::before { content: attr(data-label); color: #514764; font-size: 13px; font-weight: 640; }
  .edit-table .irrelevant, .edit-table .remove-cell:empty { display: none; }
}
@media (max-width: 365px) {
  .quick-search span { display: none; }
  .hero-art { width: 50%; opacity: .85; }
}
@page { size: A4; margin: 12mm; }
@media print {
  body { background: #fff; color: black; font: 10pt/1.3 "Segoe UI", sans-serif; }
  #app, #toast, #dialog, #import-file { display: none !important; }
  #print-view { display: block; }
  #print-view h1 { font-size: 18pt; margin-bottom: 4pt; }
  #print-view h2 { font-size: 14pt; margin: 14pt 0 5pt; break-after: avoid; }
  #print-view h3 { font-size: 11pt; margin: 8pt 0 4pt; break-after: avoid; }
  #print-view p { margin: 3pt 0; }
  #print-view table { margin: 5pt 0 8pt; table-layout: auto; }
  #print-view td, #print-view th { font-size: 8.5pt; padding: 4pt; border: 1px solid #b9b2c2; font-weight: 400; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
  #print-view th { font-weight: bold; }
  #print-view thead { display: table-header-group; }
  #print-view tr { break-inside: avoid; }
  #print-view .blank { color: #817b8b; }
}
