:root {
  --page: #f7f7f7;
  --hero: #d9e6ff;
  --panel: #ffffff;
  --text: #15181f;
  --heading: #15181f;
  --muted: #86909c;
  --soft: #c9cdd4;
  --line: #e5e6eb;
  --line-strong: #d5dbe5;
  --primary: #2973ff;
  --primary-dark: #1659d8;
  --primary-soft: #eef5ff;
  --danger: #dc2626;
  --success: #0f9f83;
  --success-soft: #e6f7f3;
  --radius: 12px;
  --bottom-safe-space: calc(74px + env(safe-area-inset-bottom));
  --action-dock-space: calc(118px + env(safe-area-inset-bottom));
  --el-color-primary: var(--primary);
  --el-color-primary-dark-2: var(--primary-dark);
  --el-color-primary-light-3: #6f9fff;
  --el-color-primary-light-5: #96bcff;
  --el-color-primary-light-7: #bdd7ff;
  --el-color-primary-light-8: #d6e6ff;
  --el-color-primary-light-9: var(--primary-soft);
  --el-border-radius-base: var(--radius);
}

[v-cloak] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  background: #e8ebf0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

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

button {
  cursor: pointer;
}

pre {
  text-align: left;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 16px;
  line-height: 28px;
}

.h5-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, var(--hero) 0, #e8f0ff 170px, rgba(232, 240, 255, 0) 320px),
    var(--page);
  padding: 24px 16px var(--action-dock-space);
}

.h5-shell--compact-bottom {
  padding-bottom: var(--bottom-safe-space);
}

.app-hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 17px;
  padding: 0 0 24px;
}

.hero-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.app-hero h1,
.app-hero p,
.card-title,
.success-card h2,
.success-card p,
.downloads-title {
  margin: 0;
}

.app-hero h1 {
  color: var(--heading);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.04;
}

.app-hero p {
  margin-top: 8px;
  color: #4e5969;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.step-bars {
  display: grid;
  grid-template-columns: 48px 48px 48px;
  gap: 8px;
  width: 160px;
}

.step-bars span {
  display: block;
  height: 6px;
  border-radius: 4px;
  background: #cce4ff;
}

.step-bars span.active {
  background: var(--primary);
}

.content-stage {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
}

.lead-card,
.success-card {
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(16, 19, 28, 0.03);
}

.lead-card {
  display: grid;
  gap: 24px;
  padding: 24px 16px;
}

.card-title {
  color: var(--heading);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.field-block label,
.field-heading label {
  color: var(--heading);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.field-heading span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.device-pill {
  position: relative;
  display: grid;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 12px 8px;
  color: var(--text);
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.device-pill.selected {
  border-color: var(--primary);
  background: rgba(41, 115, 255, 0.1);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(41, 115, 255, 0.04);
}

.device-pill:disabled {
  cursor: default;
  opacity: 0.7;
}

.device-pill__art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  justify-self: center;
  color: #4e5969;
}

.device-pill.selected .device-pill__art {
  color: var(--primary);
}

.device-pill__art svg {
  width: 30px;
  height: 30px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.device-pill__bolt {
  fill: currentColor;
  stroke: none;
}

.device-pill__name {
  display: block;
  min-width: 0;
  margin-top: 12px;
  overflow: hidden;
  color: var(--heading);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-pill.selected .device-pill__name,
.device-pill.selected .device-pill__sub {
  color: var(--primary);
}

.device-pill__sub {
  margin-top: 4px;
  color: #8a929d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.device-pill__check {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
}

.select-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 12px;
  color: var(--text);
}

.select-control__value,
.select-control__placeholder {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-control__placeholder {
  color: var(--soft);
}

.select-control__icon {
  flex: 0 0 auto;
  color: #7f8792;
}

.privacy-line {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-top: 0;
  color: var(--heading);
  font-size: 12px;
  line-height: 1.35;
}

.privacy-line .el-checkbox {
  align-self: start;
  width: 18px;
  height: 18px;
  margin-top: 0;
}

.privacy-line .el-checkbox__input,
.privacy-line .el-checkbox__inner {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  &::after {
    left: 6px;
    top: 2px;
  }
}

.privacy-line > span {
  min-width: 0;
}

.text-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.inline-message {
  margin-top: -4px;
}

.brand-footer {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: 24px 0 14px;
  color: #9aa1ab;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}

.brand-footer img {
  display: block;
  width: 128px;
  height: auto;
}

.action-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  margin: 0 auto;
  padding: 11px 24px calc(22px + env(safe-area-inset-bottom));
  background: rgba(247, 247, 247, 0.96);
  backdrop-filter: blur(12px);
}

.primary-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
  transition: background 0.16s ease, opacity 0.16s ease;
}

.primary-cta:active {
  background: var(--primary-dark);
}

.primary-cta:disabled,
.primary-cta.disabled {
  cursor: default;
  opacity: 0.48;
}

.privacy-page {
  display: grid;
  gap: 14px;
  padding-bottom: 12px;
}

.top-return-bar {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: -4px 0 8px;
  border-bottom: 1px solid #e8edf4;
}

.subpage-header {
  display: grid;
  gap: 8px;
  margin: 0 2px;
}

.subpage-header p,
.subpage-header h1 {
  margin: 0;
}

.subpage-header p {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.subpage-header h1 {
  color: var(--heading);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 7px;
  border: 0;
  background: transparent;
  padding: 8px 2px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 900;
}

.back-button svg {
  width: 28px;
  height: 28px;
  border: 1px solid #dce3ee;
  border-radius: 999px;
  background: #ffffff;
  padding: 5px;
}

.privacy-content {
  display: grid;
  gap: 12px;
  border: 1px solid #eef0f3;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 16px 14px;
}

.privacy-content h1,
.privacy-content p {
  margin: 0;
}

.privacy-content p {
  color: #4f5967;
  font-size: 13px;
  line-height: 1.7;
}

.result-panel {
  display: grid;
  gap: 17px;
  margin-bottom: 2px;
}

.success-card {
  display: grid;
  justify-items: center;
  min-height: 122px;
  padding: 24px 16px;
  text-align: center;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
}

.success-card h2 {
  margin-top: 8px;
  color: var(--success);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}

.success-card p {
  margin-top: 8px;
  max-width: 289px;
  color: #4e5969;
  font-size: 12px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.materials-list {
  display: grid;
  gap: 8px;
}

.product-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 0 4px;
}

.downloads-title {
  color: var(--heading);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.select-all-control {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  color: #5a6370;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.select-all-control input,
.material-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.material-card {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  padding: 16px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.material-card.selected {
  border-color: rgba(41, 115, 255, 0.28);
  background: #fbfdff;
  box-shadow: 0 0 0 1px rgba(41, 115, 255, 0.03);
}

.material-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.material-main {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--heading);
  text-decoration: none;
}

.preview-eye {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

.material-main strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--heading);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.28;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.download-mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #c0c6cf;
  font-size: 0;
  text-decoration: none;
}

.download-mini-button::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  clip-path: polygon(43% 0, 57% 0, 57% 58%, 77% 38%, 87% 48%, 50% 85%, 13% 48%, 23% 38%, 43% 58%);
}

.download-mini-button::after {
  content: "";
  position: absolute;
  right: 23px;
  bottom: 22px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.zip-download-button--dock {
  gap: 0;
}

.empty,
.empty-box {
  color: var(--muted);
  text-align: center;
}

.empty {
  margin: 0;
  padding: 18px;
  font-size: 13px;
}

.empty-box {
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: #fafbfc;
  padding: 18px 14px;
  font-size: 12px;
  line-height: 1.6;
}

/* Country selector */
.country-dialog .el-dialog__header {
  padding: 16px 18px 12px;
  margin: 0;
  border-bottom: 1px solid #edf0f3;
}

.country-dialog .el-dialog__title {
  font-size: 15px;
  font-weight: 800;
}

.country-dialog .el-dialog__body {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  padding: 0;
  overflow: hidden;
}

.country-az-layout {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: var(--page);
}

.country-az-search {
  flex: 0 0 auto;
  padding: 12px 16px;
  background: var(--page);
}

.country-az-results,
.country-az-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 16px var(--bottom-safe-space);
  -webkit-overflow-scrolling: touch;
}

.country-az-letter {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 2px 5px;
  background: var(--page);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.country-az-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 43px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 0 10px;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}

.country-az-item.selected {
  color: var(--primary);
  font-weight: 800;
}

.country-az-index {
  position: absolute;
  top: 70px;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 24px;
}

.az-index-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 15px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  user-select: none;
  -webkit-user-select: none;
}

/* Element Plus tuning */
.soft-input .el-input__wrapper,
.country-az-search .el-input__wrapper {
  min-height: 40px;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--line) inset;
  padding: 0 12px;
}

.soft-input .el-input__wrapper.is-focus,
.country-az-search .el-input__wrapper.is-focus {
  box-shadow: 0 0 0 1px rgba(41, 115, 255, 0.58) inset;
}

.soft-input .el-input__inner,
.country-az-search .el-input__inner {
  color: var(--text);
  font-size: 12px;
}

.soft-input .el-input__inner::placeholder,
.country-az-search .el-input__inner::placeholder {
  color: var(--soft);
}

.privacy-line .el-checkbox__label {
  display: none;
}

.el-button--primary {
  --el-button-bg-color: var(--primary);
  --el-button-border-color: var(--primary);
  --el-button-hover-bg-color: var(--primary-dark);
  --el-button-hover-border-color: var(--primary-dark);
  --el-button-active-bg-color: var(--primary-dark);
  --el-button-active-border-color: var(--primary-dark);
}

.el-alert {
  border-radius: 7px;
  padding: 8px 10px;
}

.el-alert__title {
  font-size: 11px;
  line-height: 1.35;
}

.el-dialog {
  border-radius: 0;
}

@media (min-width: 480px) {
  .h5-shell {
    box-shadow: 0 24px 80px rgba(16, 19, 28, 0.12);
  }
}

@media (max-width: 340px) {
  .h5-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .device-grid {
    gap: 6px;
  }

  .device-pill {
    padding-right: 6px;
    padding-left: 6px;
  }

  .device-pill__name {
    font-size: 10px;
  }

  .material-card {
    grid-template-columns: 17px minmax(0, 1fr) 26px;
    gap: 8px;
  }
}
