:root {
  --review-accent: #4f4aa7;
  --review-focus: #58c8ec;
  --review-soft: #efeff8;
  color-scheme: light;
  font-family: Manrope, Arial, sans-serif;
  color: #0f1424;
  background: #e9ebf0;
}
:root[data-palette="cobalt"] {
  --review-accent: #2557d6;
  --review-focus: #55c4e8;
  --review-soft: #eaf0ff;
}
:root[data-palette="lagoon"] {
  --review-accent: #007c83;
  --review-focus: #5ed8d0;
  --review-soft: #e4f4f3;
}
:root[data-palette="coral"] {
  --review-accent: #c64d4a;
  --review-focus: #f1b866;
  --review-soft: #f8eae8;
}
:root[data-palette="lime"] {
  --review-accent: #557219;
  --review-focus: #b7d957;
  --review-soft: #eef3e4;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--review-focus);
  outline-offset: 3px;
}
.review-header {
  flex: none;
  min-height: 74px;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  background:
    radial-gradient(circle at 50% -80%, #29304b 0, transparent 48%),
    linear-gradient(110deg, #0c1120, #111728 58%, #0d1322);
  color: white;
  border-bottom: 1px solid #272e43;
  box-shadow: 0 8px 28px #1016251c;
  overflow: hidden;
  max-height: 320px;
  z-index: 2;
}
:root[data-panel] .review-header {
  transition:
    max-height 0.28s ease,
    min-height 0.28s ease,
    padding 0.28s ease;
}
/* Свёрнутая панель не исчезает: остаётся тонкая полоска, по которой её возвращают */
:root[data-panel="hidden"] .review-header {
  max-height: 46px;
  min-height: 0;
  padding-top: 5px;
  padding-bottom: 5px;
  gap: 10px;
  cursor: pointer;
}
:root[data-panel="hidden"] .review-switchers,
:root[data-panel="hidden"] .mobile-selectors,
:root[data-panel="hidden"] .review-actions > *:not(.panel-hide) {
  display: none;
}
:root[data-panel="hidden"] .review-actions {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
:root[data-panel="hidden"] .review-brand {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
:root[data-panel="hidden"] .review-brand > span {
  display: none;
}
:root[data-panel="hidden"] .review-brand::after {
  content: attr(data-summary);
  margin-left: 10px;
  color: #98a1b6;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.review-actions .panel-hide {
  display: flex;
  margin-left: 3px;
  border-left: 1px solid #30384f;
  border-radius: 0 6px 6px 0;
}
:root[data-panel="hidden"] .panel-hide {
  height: 34px;
  padding: 0 10px;
  margin-left: 0;
  border-left: 0;
  border-radius: 6px;
  background: #1c2335;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
:root[data-panel="hidden"] .panel-hide svg {
  transform: rotate(180deg);
}
.panel-hide span {
  display: none;
}
:root[data-panel="hidden"] .panel-hide span {
  display: inline;
  white-space: nowrap;
}
.review-switchers {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #30384f;
  border-radius: 10px;
  background: #171d2dd9;
  box-shadow:
    0 10px 25px #05081424,
    inset 0 1px #ffffff08;
}
.mobile-selectors {
  display: none;
}
.review-brand {
  position: relative;
  padding-left: 14px;
  font-size: 17px;
  letter-spacing: 0.11em;
  font-weight: 800;
  white-space: nowrap;
}
.review-brand::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 1px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(var(--review-accent), var(--review-focus));
  box-shadow: 0 0 14px var(--review-accent);
}
.review-brand > span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: #b6bbcb;
  font-weight: 400;
  margin-top: 3px;
}
.variant-tabs {
  display: flex;
  padding: 0;
  gap: 4px;
  max-width: none;
  flex: none;
  overflow: visible;
}
.variant-tabs::-webkit-scrollbar { display: none; }
.variant-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #bec3d1;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.variant-tabs button[aria-pressed="true"] {
  background: #fff;
  color: #0f1424;
  box-shadow: 0 4px 12px #0407122e;
}
.variant-tabs button:hover:not([aria-pressed="true"]) {
  background: #2c3347;
  color: #fff;
}
.review-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #2d354a;
  border-radius: 9px;
  background: #171d2dcc;
  box-shadow: inset 0 1px #ffffff08;
}
.review-actions svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.review-actions button,
.review-actions a {
  height: 35px;
  min-width: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #b6bdce;
  border: 0;
  background: transparent;
  border-radius: 6px;
  text-decoration: none;
  font-size: 11px;
}
.review-actions button:hover,
.review-actions a:hover {
  color: white;
  background: #2c3347;
}
.device-toggle {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: #22293c;
  border-radius: 6px;
}
.device-toggle button[aria-pressed="true"] {
  background: #353d54;
  color: #fff;
}
.copy-button {
  padding: 0 10px !important;
  margin-left: 3px;
  border-left: 1px solid #30384f !important;
  border-radius: 0 6px 6px 0 !important;
}
.switcher-divider {
  width: 1px;
  height: 24px;
  margin: 0 3px;
  flex: none;
  background: linear-gradient(transparent, #465069, transparent);
}
.palette-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
}
.palette-tabs button {
  height: 35px;
  padding: 0 9px 0 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #aeb5c6;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.palette-tabs button:hover {
  background: #2c3347;
  color: #fff;
}
.palette-tabs button[aria-pressed="true"] {
  background: var(--review-soft);
  color: #0f1424;
  box-shadow:
    inset 0 -2px var(--review-accent),
    0 4px 12px #04071224;
}
.swatches {
  display: flex;
  flex: none;
}
.swatches i {
  width: 11px;
  height: 11px;
  display: block;
  border: 1.5px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #00000014;
}
.swatches i + i {
  margin-left: -4px;
}
.palette-tabs [data-palette="brand"] .swatches i:nth-child(1) { background: #4f4aa7; }
.palette-tabs [data-palette="brand"] .swatches i:nth-child(2) { background: #569dda; }
.palette-tabs [data-palette="brand"] .swatches i:nth-child(3) { background: #58c8ec; }
.palette-tabs [data-palette="cobalt"] .swatches i:nth-child(1) { background: #2557d6; }
.palette-tabs [data-palette="cobalt"] .swatches i:nth-child(2) { background: #3980f6; }
.palette-tabs [data-palette="cobalt"] .swatches i:nth-child(3) { background: #55c4e8; }
.palette-tabs [data-palette="lagoon"] .swatches i:nth-child(1) { background: #007c83; }
.palette-tabs [data-palette="lagoon"] .swatches i:nth-child(2) { background: #00a2a9; }
.palette-tabs [data-palette="lagoon"] .swatches i:nth-child(3) { background: #5ed8d0; }
.palette-tabs [data-palette="coral"] .swatches i:nth-child(1) { background: #c64d4a; }
.palette-tabs [data-palette="coral"] .swatches i:nth-child(2) { background: #e27a5f; }
.palette-tabs [data-palette="coral"] .swatches i:nth-child(3) { background: #f1b866; }
.palette-tabs [data-palette="lime"] .swatches i:nth-child(1) { background: #557219; }
.palette-tabs [data-palette="lime"] .swatches i:nth-child(2) { background: #7f9f2d; }
.palette-tabs [data-palette="lime"] .swatches i:nth-child(3) { background: #b7d957; }
.preview-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  padding: 0;
}
.preview-canvas {
  flex-shrink: 0;
  position: relative;
  transform-origin: top center;
  background: white;
}
.preview-canvas iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: white;
}
.preview-stage.is-mobile {
  padding: 18px 0;
}
.is-mobile .preview-canvas {
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px #ccd1dc,
    0 12px 40px #17244517;
}
.copy-status {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 12px;
  background: #0f1424;
  color: white;
  box-shadow: 0 5px 20px #0002;
  display: none;
  max-width: calc(100% - 32px);
  text-align: center;
}
.copy-status.visible {
  display: block;
}
@media (min-width: 1800px) {
  .preview-stage:not(.is-mobile) {
    padding-top: 20px;
  }
}
@media (max-width: 1250px) {
  .palette-tabs button > span:last-child {
    display: none;
  }
  .palette-tabs button {
    padding: 0 7px;
  }
}
@media (max-width: 1000px) {
  .review-brand > span {
    display: none;
  }
  .review-header {
    gap: 12px;
    padding: 10px 16px;
  }
  .variant-tabs button {
    padding: 9px 10px;
  }
  .copy-button span {
    display: none;
  }
  .review-actions {
    gap: 3px;
  }
  .review-brand {
    font-size: 15px;
  }
}
@media (max-width: 1000px) {
  .review-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px 10px;
    padding: 10px 16px 12px;
  }
  .review-switchers {
    display: none;
  }
  .mobile-selectors {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr);
    gap: 8px;
    padding-top: 0;
  }
  .mobile-select {
    position: relative;
    min-width: 0;
    height: 48px;
    padding: 7px 36px 6px 12px;
    overflow: hidden;
    border: 1px solid #333c53;
    border-radius: 10px;
    background: linear-gradient(145deg, #1b2234, #151b2b);
    box-shadow:
      inset 0 1px #ffffff0a,
      0 7px 20px #05081424;
  }
  .mobile-select::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid #b9c1d3;
    border-bottom: 1.5px solid #b9c1d3;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
  }
  .mobile-select > span {
    display: block;
    overflow: hidden;
    color: #858fa7;
    font-family:inherit;font-weight:600;font-size:8px;line-height:1.2;
    letter-spacing: .07em;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-select select {
    width: 100%;
    margin-top: 4px;
    padding: 0;
    overflow: hidden;
    border: 0;
    outline: 0;
    appearance: none;
    background: transparent;
    color: #fff;
    font: 700 12px/1.25 Manrope, Arial, sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-select select option {
    color: #0f1424;
    background: #fff;
  }
  .mobile-palette-select::before {
    content: "";
    position: absolute;
    right: 30px;
    bottom: 13px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--review-accent);
    box-shadow: 0 0 0 2px #ffffff16;
  }
  .review-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .review-actions button,
  .review-actions a {
    height: 36px;
    min-width: 36px;
  }
}

/* The second edition keeps the familiar controls and a direct V1 comparison. */
.edition-badge { display: inline-block; margin-left: 3px; padding: 3px 5px; vertical-align: 2px; border-radius: 4px; background: #58c8ec20; border: 1px solid #58c8ec55; color: #8bdcf5; font: 700 10px/1.1 'IBM Plex Mono', monospace; letter-spacing: 0; }
.review-actions .previous-version { display: inline-flex; gap: 6px; width: auto; padding: 0 10px; font: 600 11px Manrope, sans-serif; text-decoration: none; white-space: nowrap; color: #c9d2e6; border-right: 1px solid #30384f; border-radius: 0; }
.previous-version:hover { background: #ffffff0c; color: #fff; }
@media (max-width: 1700px) { .previous-version span { display: none; } }
@media (max-width: 1700px) and (min-width: 1001px) {
  .review-header { flex-wrap: wrap; gap: 8px 20px; padding: 9px 24px 11px; }
  .review-switchers { order: 3; flex-basis: 100%; justify-content: space-between; }
  .review-switchers .switcher-divider { margin-left: auto; margin-right: 9px; }
  .review-actions { margin-left: auto; }
}
@media (max-width: 700px) {
 .review-header { padding-inline: 12px; }
 .preview-stage.is-mobile { padding: 0; }
 .is-mobile .preview-canvas { border-radius: 0; box-shadow: none; }
 .review-brand { font-size: 13px; padding-left: 9px; letter-spacing: .07em; }
 .review-actions { gap: 0; }
 .review-actions .previous-version { padding: 0 6px; min-width: 30px; }
 .review-actions #clean-view { display: none; }
 .mobile-select select:focus-visible { outline: 2px solid var(--review-focus); outline-offset: 2px; }
}

@media (min-width: 1701px) {
  .review-switchers { flex-shrink: 0; }
}
@media (prefers-reduced-motion: reduce) {
  :root[data-panel] .review-header { transition: none; }
}
