html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #f3f3f3;
  color: #262626;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body.overlay-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: relative;
  height: 58px;
  background: #ffffff;
  border-bottom: 1px solid #dadada;
  z-index: 10;
}

.site-header__left,
.site-header__right {
  position: absolute;
  top: 0;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-header__left {
  left: 22px;
}

.site-header__right {
  right: 22px;
}

.site-header__center {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 58px;
}

.site-logo img {
  width: 155px;
  height: 32px;
  display: block;
}

.header-link {
  position: relative;
  color: #404040;
  font-size: 16px;
  line-height: 58px;
  display: inline-flex;
  align-items: center;
  height: 58px;
}

.header-link--info::before {
  content: '?';
  width: 18px;
  height: 18px;
  margin-right: 7px;
  border: 2px solid #4a4a4a;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.header-link--info::after,
.header-link--lang::after {
  content: '';
  margin-left: 6px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #5c5c5c;
}

.header-link--lang::before {
  content: '';
  width: 20px;
  height: 14px;
  border-radius: 2px;
  margin-right: 7px;
  background: linear-gradient(135deg, #303030 50%, #efefef 50%);
  box-shadow: inset 0 0 0 1px #999;
}

.site-header__right .header-link::before {
  display: inline-block;
  margin-right: 8px;
  font-size: 16px;
}

.site-header__right .header-link:nth-child(1)::before { content: '☁'; }
.site-header__right .header-link:nth-child(2)::before { content: '↪'; }

.header-link.is-active {
  color: #3b83bd;
}

.header-link.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: #2f86d0;
}

main {
  min-height: calc(100vh - 58px);
}

.home-background {
  min-height: calc(100vh - 58px);
}

.hero-section {
  background: #f6f6f6;
  padding: 34px 20px 44px;
}

.hero-section__inner {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.hero-section h1 {
  margin: 0 auto 18px;
  max-width: 1100px;
  font-size: 64px;
  line-height: 1.06;
  font-weight: 700;
  color: #2d2d2d;
  text-shadow: 0 4px 8px rgba(0, 0, 0, .18);
}

.hero-section p {
  margin: 0 auto;
  max-width: 980px;
  font-size: 25px;
  line-height: 1.45;
  color: #4b4b4b;
}

.hero-button {
  margin-top: 26px;
  border: 0;
  background: #2f86d0;
  color: #fff;
  min-width: 238px;
  height: 64px;
  padding: 0 26px;
  font-size: 20px;
  letter-spacing: 1.6px;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}

.hero-button:hover,
.upload-button:hover,
.major-button:hover,
.copy-button:hover {
  filter: brightness(0.96);
}

.promo-section {
  background: #efefef;
  border-top: 1px solid #e0e0e0;
  min-height: 520px;
  padding: 36px 20px 70px;
}

.promo-section__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.promo-ad-slot {
  min-height: 340px;
  border: 1px solid #d5d5d5;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot__placeholder {
  color: #7e7e7e;
  font-size: 22px;
  text-align: center;
  padding: 30px;
}

.upload-overlay {
  position: fixed;
  inset: 58px 0 0 0;
  z-index: 20;
}

.upload-overlay[hidden] {
  display: none;
}

.upload-overlay__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(246,246,246,.88) 0 58%, rgba(0,0,0,.72) 58% 100%);
}

.upload-overlay__panel {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 58px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px 40px;
}

.upload-overlay__topline {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 36px;
}

.overlay-action {
  border: 0;
  background: transparent;
  color: #4d4d4d;
  font-size: 16px;
  cursor: pointer;
  padding: 6px 8px;
}

.upload-stage {
  display: none;
  text-align: center;
  padding: 30px 0 0;
}

.upload-stage.is-active {
  display: block;
}

.stage-icon {
  margin: 18px auto 28px;
  position: relative;
}

.stage-icon--cloud,
.stage-icon--image,
.stage-icon--success,
.stage-icon--error {
  width: 130px;
  height: 110px;
}

.stage-icon--cloud::before,
.stage-icon--cloud::after,
.stage-icon--image::before,
.stage-icon--success::before,
.stage-icon--error::before {
  content: '';
  position: absolute;
}

.stage-icon--cloud::before {
  inset: 20px 6px 0 6px;
  background: #2f86d0;
  border-radius: 60px 60px 38px 38px;
}
.stage-icon--cloud::after {
  width: 42px;
  height: 42px;
  left: 44px;
  top: 42px;
  border-top: 8px solid #fff;
  border-right: 8px solid #fff;
  transform: rotate(-45deg);
  box-shadow: -14px 14px 0 -6px #fff;
}

.stage-icon--image::before {
  inset: 8px 18px 0;
  border: 8px solid #2f86d0;
  border-radius: 18px;
  box-shadow: -18px 18px 0 -8px #2f86d0;
}
.stage-icon--image::after {
  content: '';
  position: absolute;
  width: 54px;
  height: 34px;
  left: 40px;
  top: 38px;
  background: linear-gradient(135deg, transparent 0 30%, #2f86d0 30% 65%, transparent 65%), linear-gradient(to top, #2f86d0 0 60%, transparent 60%);
  border-radius: 6px;
}

.stage-icon--success::before {
  inset: 0;
  border-radius: 50%;
  background: #2fb758;
}
.stage-icon--success::after {
  content: '';
  position: absolute;
  width: 38px;
  height: 18px;
  left: 44px;
  top: 42px;
  border-left: 8px solid #fff;
  border-bottom: 8px solid #fff;
  transform: rotate(-45deg);
}

.stage-icon--error::before {
  inset: 0;
  border-radius: 50%;
  background: #c94a4a;
}
.stage-icon--error::after {
  content: '!';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 56px;
  font-weight: 700;
}

.upload-stage h2 {
  margin: 0 auto 14px;
  max-width: 900px;
  font-size: 32px;
  line-height: 1.35;
  font-weight: 400;
  color: #2f2f2f;
}

.upload-stage p {
  margin: 0 auto;
  max-width: 860px;
  font-size: 16px;
  line-height: 1.45;
  color: #555;
}

.text-link {
  border: 0;
  background: transparent;
  color: #4f95da;
  cursor: pointer;
  padding: 0;
}

.url-import {
  max-width: 620px;
  margin: 24px auto 0;
}

.url-import textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid #cfcfcf;
  padding: 14px;
  resize: vertical;
  background: #fff;
}

.url-import__actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 14px;
}

.major-button,
.minor-button,
.upload-button,
.copy-button {
  border: 0;
  cursor: pointer;
  height: 56px;
  padding: 0 28px;
  font-size: 18px;
  letter-spacing: 1px;
}

.major-button {
  background: #2f86d0;
  color: #fff;
}

.minor-button {
  background: #d9d9d9;
  color: #353535;
}

.selection-grid {
  margin-top: 38px;
}

.thumb-stack {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 116px;
}

.thumb-card {
  position: relative;
  width: 104px;
  height: 104px;
  background: #d8d8d8;
  overflow: hidden;
}

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

.thumb-card__remove,
.thumb-card__edit {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid #b0b0b0;
  border-radius: 50%;
  background: #fff;
  color: #5f5f5f;
  cursor: pointer;
  padding: 0;
}

.thumb-card__remove {
  top: -4px;
  left: -4px;
  font-size: 16px;
  line-height: 20px;
}

.thumb-card__edit {
  top: 18px;
  left: -4px;
}
.thumb-card__edit::before {
  content: '✎';
  font-size: 12px;
}

.selection-controls {
  margin-top: 34px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #2f2f2f;
}

.form-select {
  width: 420px;
  max-width: calc(100vw - 40px);
  height: 44px;
  padding: 0 12px;
  border: 1px solid #cfcfcf;
  background: #f2f2f2;
  color: #333;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 176px;
  margin-top: 20px;
  background: #2fb758;
  color: #fff;
}

.upload-button--inline {
  text-decoration: none;
}

.progress-thumb {
  position: relative;
  display: inline-block;
  margin-top: 30px;
  width: 104px;
  height: 104px;
  background: #d8d8d8;
  overflow: hidden;
}

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

.progress-thumb__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 33px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,.42);
  background: rgba(0,0,0,.14);
}

.upload-stage--success {
  max-width: 640px;
  margin: 0 auto;
}

.success-thumb {
  margin: 26px auto 22px;
  width: 104px;
  height: 104px;
  background: #d8d8d8;
  overflow: hidden;
}

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

.result-linkbox {
  width: 100%;
  max-width: 610px;
  margin: 8px auto 0;
  text-align: left;
}

.result-linkbox label {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
}

.copy-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.copy-row input,
.copy-row textarea {
  flex: 1;
  min-width: 0;
  border: 1px solid #cfcfcf;
  background: #f4f4f4;
  color: #333;
  padding: 13px 14px;
}

.copy-row textarea {
  min-height: 110px;
  resize: vertical;
}

.copy-button {
  min-width: 168px;
  background: #d7d7d7;
  color: #2f2f2f;
  border-left: 0;
}

.view-page {
  background: #f3f3f3;
  min-height: calc(100vh - 58px);
}

.view-page__inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 80px 20px 50px;
}

.view-frame {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.view-frame img {
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06);
}

.view-empty {
  max-width: 560px;
  margin: 120px auto 0;
  text-align: center;
}

.view-empty h1 {
  margin: 0 0 12px;
  font-size: 34px;
}

.view-empty p {
  margin: 0 0 24px;
  font-size: 18px;
  color: #555;
}

.album-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}

.album-card {
  display: block;
  background: #fff;
  padding: 8px;
}

.album-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

@media (max-width: 980px) {
  .site-header {
    height: auto;
    padding: 10px 0 12px;
  }

  .site-header__left,
  .site-header__right,
  .site-header__center {
    position: static;
    height: auto;
    justify-content: center;
  }

  .site-header__left,
  .site-header__right {
    margin-bottom: 8px;
  }

  .site-header__center {
    margin-bottom: 8px;
  }

  .header-link {
    line-height: 1;
    height: auto;
  }

  .header-link.is-active::after {
    bottom: -10px;
  }

  .hero-section h1 {
    font-size: 44px;
  }

  .hero-section p {
    font-size: 20px;
  }

  .upload-overlay {
    inset: 110px 0 0 0;
  }

  .upload-overlay__shade {
    background: linear-gradient(to bottom, rgba(246,246,246,.92) 0 48%, rgba(0,0,0,.72) 48% 100%);
  }

  .upload-stage h2 {
    font-size: 28px;
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding-top: 24px;
  }

  .hero-section h1 {
    font-size: 34px;
    text-shadow: 0 2px 4px rgba(0,0,0,.16);
  }

  .hero-section p {
    font-size: 18px;
  }

  .hero-button,
  .major-button,
  .minor-button,
  .upload-button,
  .copy-button {
    width: 100%;
    min-width: 0;
  }

  .upload-overlay__panel {
    padding-inline: 14px;
  }

  .copy-row {
    flex-direction: column;
    gap: 10px;
  }

  .copy-button {
    border-left: 1px solid #cfcfcf;
  }

  .form-select {
    width: 100%;
  }
}
