:root {
  --navy: #183b56;
  --blue: #176b87;
  --blue-dark: #10546b;
  --teal-soft: #e8f5f6;
  --workspace: #f8fafb;
  --ink: #1d2b36;
  --muted: #637381;
  --line: #dbe4e9;
  --focus: #f3a712;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: Rubik, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

button,
select {
  font: inherit;
}

button {
  text-transform: none !important;
}

button,
select,
a {
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease,
    color 160ms ease, transform 160ms ease;
}

button:not(:disabled),
select:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(243, 167, 18, 0.38);
  outline-offset: 2px;
}

.app {
  width: 100%;
  max-width: 700px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px;
}

.downloader {
  overflow: hidden;
  background: var(--workspace);
  border: 1px solid #c8d5dc;
  border-radius: 16px;
  box-shadow: 0 5px 16px rgba(24, 59, 86, 0.08);
}

.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  color: #ffffff;
  background: linear-gradient(120deg, var(--navy), var(--blue));
}

.hero-icon {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-icon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.eyebrow,
.section-kicker {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow {
  color: #bfecef;
}

h1,
h2,
.hero-copy {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

.hero-copy {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.workflow {
  padding: 20px 22px 22px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.section-kicker {
  color: var(--blue);
}

h2 {
  color: var(--navy);
  font-size: 18px;
}

.availability {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

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

.control-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
}

.control-card-layers {
  grid-column: 1 / -1;
}

.control-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #405261;
  font-size: 12px;
  font-weight: 600;
}

.step-number {
  display: inline-grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--blue);
  border-radius: 50%;
  background: var(--teal-soft);
  font-size: 11px;
}

.control-help {
  margin: 8px 0 0 30px;
  color: var(--muted);
  font-size: 11px;
}

.layer-select-shell,
.layer-select-shell .btn-group,
.choice-dropdown {
  width: 100%;
}

.layer-select-shell .multiselect,
.choice-button {
  position: relative;
  width: 100%;
  min-height: 43px;
  padding: 9px 38px 9px 12px;
  overflow: hidden;
  color: var(--ink) !important;
  border: 1px solid #b9c8d1 !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-select-shell .multiselect:hover:not(:disabled),
.choice-button:hover:not(:disabled) {
  border-color: var(--blue) !important;
}

.layer-select-shell .multiselect:disabled,
.choice-button:disabled {
  color: #8796a1 !important;
  border-color: #e0e6ea !important;
  background: #f4f7f8 !important;
  opacity: 1;
}

.choice-button::after,
.layer-select-shell .multiselect::after {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
}

.dropdown-menu,
.multiselect-container.dropdown-menu {
  width: 100%;
  max-height: 250px !important;
  margin-top: 5px !important;
  overflow-y: auto;
  border: 1px solid #c8d5dc;
  border-radius: 9px;
  box-shadow: 0 10px 24px rgba(24, 59, 86, 0.14);
}

.dropdown-item {
  min-height: 36px;
  color: var(--ink);
  font-size: 13px;
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: var(--blue-dark);
  background: var(--teal-soft);
}

.multiselect-container > li > a > label,
.multiselect-container .form-check {
  width: 100%;
  padding: 7px 12px;
  color: var(--ink);
  font-size: 13px;
}

.multiselect-container li:hover {
  background: var(--teal-soft);
}

.action-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #cce3e6;
  border-radius: 11px;
  background: #f1f9fa;
  text-align: center;
}

.selection-summary {
  min-height: 17px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 8px !important;
  font-weight: 600;
}

.primary-button {
  width: min(100%, 430px);
  padding: 9px 20px;
  color: #ffffff !important;
  border: 1px solid var(--blue) !important;
  background: var(--blue) !important;
  box-shadow: 0 4px 12px rgba(23, 107, 135, 0.22);
}

.primary-button:hover:not(:disabled) {
  border-color: var(--blue-dark) !important;
  background: var(--blue-dark) !important;
  transform: translateY(-1px);
}

.primary-button:disabled {
  color: #80909a !important;
  border-color: #d6e0e5 !important;
  background: #e6ecef !important;
  box-shadow: none;
  opacity: 1;
}

.secondary-button {
  flex: 0 0 auto;
  padding: 8px 15px;
  color: var(--blue) !important;
  border: 1px solid #a9cbd1 !important;
  background: #ffffff !important;
}

.secondary-button:hover {
  color: #ffffff !important;
  border-color: var(--blue) !important;
  background: var(--blue) !important;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding-top: 15px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--blue-dark);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.modal-content {
  overflow: hidden;
  border: 1px solid #c8d5dc;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(24, 59, 86, 0.2);
}

.modal-header {
  color: #ffffff;
  border: 0;
  background: linear-gradient(120deg, var(--navy), var(--blue));
}

.modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-title {
  font-size: 17px;
}

.modal-body {
  color: #405261;
  line-height: 1.55;
}

.modal-footer {
  border-color: var(--line);
  background: var(--workspace);
}

@media (max-width: 520px) {
  .app {
    padding: 10px;
  }

  .hero,
  .workflow {
    padding-right: 18px;
    padding-left: 18px;
  }

  .hero-icon,
  .availability {
    display: none;
  }

  .section-heading,
  .site-footer,
  .action-buttons {
    align-items: stretch;
    flex-direction: column;
  }

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

  .control-card-layers {
    grid-column: auto;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  select,
  a {
    transition: none;
  }
}
