:root {
  font-family:
    'Source Sans 3',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Arial,
    sans-serif;
  font-size: 16px;
  color: #29242e;
  background: #f7f6f8;

  --ink: #29242e;
  --muted: #665e6b;
  --line: #dedbe1;
  --subtle: #f5f3f6;
  --plum: #68378a;
  --strong: #54306c;
  --dark: #291d32;
  --focus: #8942ae;
  --green: #286344;
  --warm: #805c24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: var(--strong);
  text-underline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

::selection {
  color: #281432;
  background: #ebd6f7;
}

svg.ico {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentcolor;
  stroke-width: 1.65;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.13;
  letter-spacing: -0.035em;
  font-weight: 680;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.23rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 650;
}

h3 {
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 650;
}

p {
  line-height: 1.52;
}

.skip {
  position: fixed;
  top: -100px;
  left: 8px;
  z-index: 10;
  background: white;
  padding: 12px;
}

.skip:focus {
  top: 8px;
}

.loading-page {
  padding: 8vh 8vw;
  color: var(--muted);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.rail {
  background: var(--dark);
  color: #f8f3fc;
  padding: 26px 16px 18px;
  min-height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 38px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.08rem;
  line-height: 1.25;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.rail .brand {
  padding: 2px 8px;
}

.brand-mark {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 10px;
  background: #e2c7f5;
  color: #382347;
}

.brand-mark .ico {
  width: 26px;
  height: 26px;
  stroke-width: 1.9;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy small {
  color: #cbbfd2;
  font-size: 0.77rem;
  font-weight: 450;
  letter-spacing: 0;
}

.rail nav {
  display: grid;
  gap: 5px;
}

.nav-button {
  text-decoration: none;
  border: none;
  background: transparent;
  text-align: left;
  color: #dfd5e5;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  gap: 13px;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 520;
}

.nav-button:hover {
  background: #3a2c43;
  color: white;
}

.nav-button[aria-current='page'] {
  color: #fff;
  background: #4d385b;
}

.rail-bottom {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #4b3b54;
}

.rail-bottom .nav-button {
  width: 100%;
}

.workspace {
  min-width: 0;
}

.topbar {
  min-height: 66px;
  padding: 0 38px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.87rem;
}

.crumb .ico {
  width: 15px;
  height: 15px;
}

.crumb b {
  font-weight: 560;
  color: var(--ink);
}

.topbar-user {
  font-size: 0.84rem;
  color: var(--muted);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.topbar-user .ico {
  width: 17px;
  height: 17px;
}

.content {
  max-width: 1500px;
  margin: auto;
  padding: 34px 38px 56px;
  min-width: 0;
}

.title-row,
.panel-head,
.line-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.title-row {
  margin-bottom: 24px;
}

.title-wrap {
  display: grid;
  gap: 7px;
}

.title-wrap p,
.muted,
.help {
  color: var(--muted);
}

.title-wrap p,
.help {
  font-size: 0.91rem;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.pad {
  padding: 23px;
}

.panel-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.btn {
  min-height: 39px;
  padding: 8px 13px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #d8d2dc;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 570;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.35;
  text-decoration: none;
}

.btn .ico {
  width: 17px;
  height: 17px;
}

.auth-form .btn {
  width: 100%;
}

.btn:hover:not(:disabled) {
  background: #f3eff5;
  border-color: #bbadbf;
}

.btn.primary {
  background: var(--plum);
  border-color: var(--plum);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: #552a74;
  border-color: #552a74;
}

.btn.soft {
  color: var(--strong);
  background: #f4edf7;
  border-color: #e8deef;
}

.btn.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--strong);
}

.btn.tiny {
  min-height: 32px;
  padding: 4px 9px;
  font-size: 0.84rem;
}

.btns {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: #eee8f2;
  border: 1px solid #e0d7e6;
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 17px;
  color: #4e3b59;
  font-size: 0.88rem;
  line-height: 1.5;
}

.note .ico {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.note.error {
  color: #8a3339;
  background: #fdf1f0;
  border-color: #f1d7d5;
}

.note.success {
  color: #2e6049;
  background: #eff6f0;
  border-color: #d5e5d9;
}

.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 19px 20px 0;
  flex-wrap: wrap;
}

.search {
  position: relative;
  min-width: 200px;
  max-width: 680px;
  flex: 1 1 280px;
}

.search .ico {
  position: absolute;
  top: 12px;
  left: 13px;
  width: 17px;
  height: 17px;
  color: #706775;
  pointer-events: none;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  border: 1px solid #cfc8d4;
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  font-size: 0.94rem;
  line-height: 1.45;
}

textarea {
  resize: vertical;
  min-height: 150px;
}

.search input {
  padding-left: 38px;
}

input::placeholder,
textarea::placeholder {
  color: #786e7e;
}

select {
  cursor: pointer;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  font-weight: 580;
  font-size: 0.9rem;
}

.field small {
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.5;
}

.stack {
  display: grid;
  gap: 18px;
}

.tabs {
  display: flex;
  gap: 19px;
  flex-wrap: wrap;
  padding: 8px 22px 0;
  border-bottom: 1px solid var(--line);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 11px 0 12px;
  font-weight: 560;
  font-size: 0.88rem;
  color: var(--muted);
}

.tab[aria-pressed='true'] {
  border-bottom-color: var(--plum);
  color: var(--strong);
}

.tab:hover {
  color: var(--plum);
}

.count {
  padding: 1px 6px;
  border-radius: 4px;
  background: #eeebf0;
  color: #594f5e;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.tab[aria-pressed='true'] .count {
  background: #ede1f4;
  color: var(--strong);
}

.tablebox {
  overflow-x: auto;
  border-radius: 0 0 14px 14px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #ebe8ec;
}

th {
  background: #f8f7f9;
  font-size: 0.77rem;
  color: var(--muted);
  font-weight: 600;
}

th:first-child,
td:first-child {
  padding-left: 22px;
}

th:last-child,
td:last-child {
  padding-right: 22px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tr.product-row:hover td {
  background: #faf8fb;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 13px;
}

.product-btn {
  text-decoration: none;
  font: inherit;
  color: var(--ink);
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  font-weight: 600;
  line-height: 1.4;
}

.product-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--strong);
}

.photo {
  display: grid;
  place-items: center;
  width: 43px;
  height: 52px;
  border-radius: 7px;
  background: #f2eef2;
  color: #796b7d;
  overflow: hidden;
  flex: none;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo.lg {
  width: 70px;
  height: 85px;
}

.meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  border-radius: 5px;
  padding: 3px 8px;
  color: #615967;
  background: #f0edf2;
  font-size: 0.78rem;
  font-weight: 560;
  white-space: nowrap;
}

.badge.plum {
  color: #62387d;
  background: #f0e6f5;
}

.badge.green {
  color: #26583c;
  background: #e7f2e9;
}

.badge.amber {
  color: #78571f;
  background: #f8efd9;
}

.badge.red {
  color: #8a373b;
  background: #fbe9e8;
}

.empty {
  padding: 40px 22px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.empty > .ico {
  color: #8a7498;
  width: 28px;
  height: 28px;
}

.empty p {
  color: var(--muted);
  max-width: 55ch;
  font-size: 0.92rem;
}

.back {
  margin: -8px 0 15px -7px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(230px, 1fr);
  gap: 18px;
  align-items: start;
}

.card-ident {
  display: flex;
  align-items: center;
  gap: 15px;
}

.card-ident h1 {
  font-size: 1.65rem;
}

.card-ident .meta {
  font-size: 0.85rem;
}

.rules {
  margin-top: 16px;
}

.original {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  line-height: 1.55;
}

.fold {
  border-top: 1px solid var(--line);
  padding: 14px 0 0;
  color: var(--muted);
}

.fold summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 570;
}

.fold .original {
  margin-top: 12px;
}

.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2px 0;
}

.row-list {
  display: grid;
}

.row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.row-item:last-child {
  border-bottom: 0;
}

.row-item h3 {
  font-size: 0.97rem;
}

.row-item p {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 3px;
}

.job-title,
.connection {
  min-width: 0;
  overflow-wrap: anywhere;
}

.job-title small,
.connection code {
  display: block;
  color: var(--muted);
  font-size: 0.79rem;
  margin-top: 5px;
}

.working {
  font-size: 0.87rem;
  color: var(--strong);
}

.num {
  text-align: right;
}

.seo-grid {
  display: grid;
  grid-template-columns: minmax(245px, 0.84fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: start;
}

.seo-grid > .panel,
.editor-grid > .panel {
  margin: 0;
}

.result-body {
  padding: 19px 21px;
}

.footnote {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 15px;
}

.notices {
  position: fixed;
  bottom: 19px;
  right: 20px;
  z-index: 6;
  max-width: min(440px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  background: #302337;
  color: #fff;
  padding: 12px 17px;
  border-radius: 9px;
  box-shadow: 0 5px 20px #23132922;
  font-size: 0.9rem;
  line-height: 1.45;
}

.toast.error {
  background: #752e38;
}

dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  width: min(790px, calc(100vw - 24px));
  max-height: 90dvh;
}

dialog::backdrop {
  background: #251b2c88;
}

.dialog-body {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.compare > div {
  background: var(--subtle);
  border-radius: 8px;
  padding: 12px;
}

.compare > div:last-child {
  background: #f2eaf6;
}

.compare strong {
  display: block;
  margin-bottom: 7px;
  font-size: 0.78rem;
  color: var(--muted);
}

.confirm {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 0.9rem;
}

.confirm input {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 1px 0 0;
  accent-color: var(--plum);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(350px, 1.15fr);
}

.auth-side {
  background: var(--dark);
  color: #f8f3fc;
  padding: clamp(28px, 4vw, 65px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 38px;
  overflow: hidden;
}

.auth-side h2 {
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  line-height: 1.02;
  max-width: 12ch;
  font-weight: 560;
  letter-spacing: -0.04em;
}

.auth-diagram {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 460px;
}

.auth-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 4px;
  border-top: 1px solid #5b4865;
  font-size: 1.03rem;
  color: #f2eaf6;
}

.auth-step .ico {
  color: #d8adee;
}

.auth-pane {
  display: grid;
  place-items: center center;
  padding: 38px;
  background: #fcfbfc;
}

.auth-form {
  width: min(100%, 400px);
  display: grid;
  gap: 21px;
}

.auth-form .note {
  margin: 0;
}

.auth-form .title-wrap p {
  line-height: 1.5;
}

.auth-message {
  color: #8a3339;
  font-size: 0.9rem;
}

@media (width <= 1080px) {
  .shell {
    grid-template-columns: 192px minmax(0, 1fr);
  }

  .rail {
    padding-inline: 10px;
  }

  .content {
    padding: 27px 21px 50px;
  }

  .topbar {
    padding-inline: 21px;
  }

  .editor-grid,
  .seo-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(210px, 1fr);
  }

  .seo-grid {
    grid-template-columns: minmax(215px, 0.83fr) minmax(0, 1fr);
  }
}

@media (width <= 780px) {
  .shell {
    display: block;
  }

  .rail {
    position: static;
    min-height: auto;
    height: auto;
    padding: 12px 16px 7px;
    gap: 12px;
    overflow: visible;
  }

  .rail .brand {
    padding: 0;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .brand-mark .ico {
    width: 22px;
    height: 22px;
  }

  .brand-copy small {
    display: none;
  }

  .rail nav {
    display: flex;
    overflow-x: auto;
    gap: 3px;
  }

  .nav-button {
    white-space: nowrap;
    padding: 8px;
    gap: 6px;
    font-size: 0.83rem;
  }

  .nav-button .ico {
    width: 16px;
    height: 16px;
  }

  .rail-bottom {
    position: absolute;
    right: 14px;
    top: 10px;
    padding: 0;
    border: 0;
  }

  .rail-bottom .nav-button {
    padding: 8px;
  }

  .topbar {
    display: none;
  }

  .content {
    padding: 24px 16px 44px;
  }

  .editor-grid,
  .seo-grid {
    grid-template-columns: 1fr;
  }

  .seo-grid > .panel,
  .editor-grid > .panel {
    margin: 0;
  }

  h1 {
    font-size: 1.65rem;
  }

  .title-row {
    margin-bottom: 15px;
  }

  .toolbar {
    padding: 14px 14px 0;
  }

  .tabs {
    padding-inline: 14px;
    gap: 12px;
  }

  .pad,
  .panel-head {
    padding: 16px;
  }

  .auth-screen {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .auth-side {
    padding: 18px 23px;
  }

  .auth-side h2,
  .auth-diagram {
    display: none;
  }

  .auth-pane {
    padding: 52px 23px;
  }
}

@media (width <= 570px) {
  .topbar-user span {
    display: none;
  }

  .rail {
    padding-inline: 9px;
  }

  .rail .brand {
    margin-left: 6px;
  }

  th,
  td {
    padding: 10px;
  }

  th:first-child,
  td:first-child {
    padding-left: 11px;
  }

  th:last-child,
  td:last-child {
    padding-right: 11px;
  }

  .catalog .secondary-col {
    display: none;
  }

  .product-cell {
    gap: 8px;
  }

  .product-btn {
    font-size: 0.86rem;
  }

  .photo {
    width: 34px;
    height: 43px;
  }

  .tabs .tab {
    font-size: 0.81rem;
  }

  .tabs {
    gap: 10px;
  }

  .tab .count {
    display: none;
  }

  .row-item {
    padding: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .compare {
    grid-template-columns: 1fr;
  }
}

.pager {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}

[hidden] {
  display: none !important;
}

.tight {
  gap: 9px;
}

.recent {
  margin-top: 20px;
}

.job-title .job-error {
  color: #8a3339;
}

.request-log {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.request-log summary {
  cursor: pointer;
  width: fit-content;
}

.request-log ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.request-log li {
  margin-block: 0.3rem;
  overflow-wrap: anywhere;
}

.report-json {
  max-height: 32rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.nav-button[aria-current='page'] .ico {
  color: #e9c5ff;
}

.panel + .panel,
.panel + .note,
.note + .panel {
  margin-top: 16px;
}
