:root {
  --page: #fff;
  --surface: #f7f7f9;
  --surface-strong: #f1f1f4;
  --ink: #222225;
  --muted: #77777f;
  --line: #e8e8ec;
  --dark: #292929;
  --accent: #27a982;
  --accent-soft: #e6f8f1;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(25, 25, 30, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(210, 248, 235, 0.34), transparent 28rem),
    var(--page);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body,
button,
input,
select,
textarea {
  font-family: inherit;
}

.request-page-header {
  display: flex;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 34px) 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.request-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.request-brand img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  box-shadow: 0 7px 18px rgba(39, 169, 130, 0.18);
}

.request-brand span {
  display: grid;
}

.request-brand strong {
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.request-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.home-fade-button {
  display: inline-flex;
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 8px 13px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

.home-fade-button:hover {
  color: var(--ink);
  background: var(--surface);
  transform: none;
}

.request-page-main {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 34px) 42px;
}

.request-page-intro {
  margin-bottom: 18px;
}

.request-page-intro > span {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.request-page-intro h1 {
  margin: 5px 0 7px;
  color: var(--ink);
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-align: left;
}

.request-page-intro p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

#formMessage,
#uploadPanel {
  width: 100%;
  max-width: none !important;
  margin: 0 0 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  box-shadow: var(--shadow) !important;
}

#formMessage {
  color: var(--danger) !important;
  background: #fff4f2 !important;
}

.progress-wrap {
  height: 8px;
  background: var(--surface-strong);
}

.progress-bar,
.progress-indeterminate {
  background: var(--accent);
}

.request-form {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  animation: none;
}

.request-form > label:not(.file-input) {
  display: block;
  margin: 5px 2px 7px;
  color: #55555c;
  font-size: 12px;
  font-weight: 600;
}

.request-form input:not([type="file"]):not([type="hidden"]),
.request-form select,
.request-form textarea,
.request-form .choices__inner {
  width: 100%;
  min-height: 50px;
  margin: 0 0 14px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: none;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.request-form textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.55;
}

.request-form input:focus,
.request-form select:focus,
.request-form textarea:focus,
.request-form .choices.is-focused .choices__inner {
  border-color: rgba(39, 169, 130, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(39, 169, 130, 0.1);
}

.request-form input::placeholder,
.request-form textarea::placeholder {
  color: #9a9aa2;
}

.exact-address-source {
  display: none !important;
}

.kato-legacy-control {
  display: none !important;
}

.exact-address-label {
  display: block;
  margin: 5px 2px 7px;
  color: #55555c;
  font-size: 12px;
  font-weight: 600;
}

.selected-address-summary {
  width: 100%;
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(20, 30, 45, 0.05);
}

.selected-address-summary__text {
  padding: 13px 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .selected-address-summary__text {
    padding: 12px;
    font-size: 14px;
  }
}

.request-form .exact-address-editor {
  display: none !important;
  min-height: 96px;
  margin-bottom: 8px;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.request-form #kato_city,
.request-form #category {
  display: none !important;
}

#openCityModal,
#openCategoryModal {
  min-height: 50px;
  margin: 0 0 14px !important;
  padding: 13px 15px !important;
  border: 1px solid var(--line) !important;
  border-radius: 15px !important;
  color: var(--ink) !important;
  background: #fff !important;
  box-shadow: none !important;
  text-align: left;
  font-size: 14px !important;
  font-weight: 600;
  cursor: pointer;
}

#openCityModal::after,
#openCategoryModal::after {
  float: right;
  color: #9999a1;
  content: "›";
  font-size: 21px;
  line-height: 1;
}

#openCityModal:disabled,
#openCategoryModal:disabled {
  color: #a3a3aa !important;
  background: var(--surface) !important;
  cursor: not-allowed;
}

#btnMap,
#btnDetect {
  min-height: 48px;
  padding: 12px 15px !important;
  border: 1px solid var(--line) !important;
  border-radius: 15px !important;
  box-shadow: none;
  font-size: 13px !important;
  font-weight: 600;
}

#btnMap {
  color: #fff !important;
  background: var(--dark) !important;
}

#btnDetect {
  color: #176d56 !important;
  background: var(--accent-soft) !important;
}

#mapBox {
  overflow: hidden;
  margin: 4px 0 16px;
  border-color: var(--line) !important;
  border-radius: 18px !important;
  box-shadow: var(--shadow);
}

.file-input {
  display: flex;
  min-height: 52px;
  margin: 0 0 10px;
  padding: 13px 15px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}

.file-input:hover {
  border-color: rgba(39, 169, 130, 0.5);
  background: #fff;
}

.preview {
  margin: 8px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-align: left;
}

.preview img,
.preview video {
  border-radius: 14px;
  box-shadow: none;
}

#submitBtn {
  width: 100%;
  min-height: 54px;
  margin-top: 12px;
  padding: 14px 18px;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: var(--dark);
  box-shadow: 0 12px 24px rgba(25, 25, 30, 0.16);
  font-size: 14px;
  font-weight: 700;
}

#submitBtn:hover {
  background: #1f1f20;
  transform: translateY(-1px);
}

#loadingIndicator {
  display: block;
  margin: 12px 0 0 !important;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

#categoryModal,
#cityModal {
  color: var(--ink);
  background: #fff !important;
}

#categoryModal > div:first-child,
#cityModal > div:first-child {
  padding: calc(16px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 28px) 16px !important;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: none !important;
  backdrop-filter: blur(12px);
}

#closeCategoryModal,
#closeCityModal {
  width: auto;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
}

.category-catalog__nav {
  display: grid;
  width: min(760px, 100%);
  min-height: 48px;
  margin: 0 auto;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.category-catalog__nav > div {
  min-width: 0;
}

.category-catalog__nav > div > span {
  display: block;
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.category-catalog__nav h2 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#categoryBackButton {
  width: auto;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}

#categoryBackButton[hidden] {
  display: none;
}

#categorySearch,
#citySearch {
  width: 100% !important;
  min-height: 50px !important;
  margin-top: 12px !important;
  padding: 13px 15px !important;
  border: 1px solid var(--line) !important;
  border-radius: 15px !important;
  outline: 0;
  color: var(--ink);
  background: var(--surface) !important;
  font-size: 14px;
}

#categorySearch {
  display: block;
  width: min(760px, 100%) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

#categorySearch:focus,
#citySearch:focus {
  border-color: rgba(39, 169, 130, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(39, 169, 130, 0.1);
}

#categoryList,
#cityList {
  width: min(760px, 100%);
  height: calc(100dvh - 128px) !important;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 28px) calc(28px + env(safe-area-inset-bottom, 0px)) !important;
  background: #fff;
}

#categoryList.category-catalog__list {
  height: calc(100dvh - 148px) !important;
}

.category-catalog__group,
.category-catalog__specialty {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.category-catalog__group {
  display: grid;
  min-height: 74px;
  padding: 12px 8px;
  grid-template-columns: 48px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
}

.category-catalog__group-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: var(--accent-soft);
  font-size: 23px;
}

.category-catalog__group-text,
.category-catalog__specialty-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.category-catalog__group-text strong,
.category-catalog__specialty-text strong {
  font-size: 14px;
  line-height: 1.3;
}

.category-catalog__group-text small,
.category-catalog__specialty-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.category-catalog__count {
  display: grid;
  min-width: 29px;
  height: 29px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  color: #14745b;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}

.category-catalog__arrow {
  color: #a3a4a8;
  font-size: 25px;
  font-weight: 400;
}

.category-catalog__specialty {
  display: grid;
  min-height: 58px;
  padding: 15px 10px;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
}

.category-catalog__specialty.selected {
  color: #176d56;
  background: var(--accent-soft);
}

.category-catalog__group:hover,
.category-catalog__group:focus,
.category-catalog__specialty:hover,
.category-catalog__specialty:focus {
  outline: 0;
  color: #176d56;
  background: var(--accent-soft);
}

.category-catalog__empty {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

#categoryList > [role="button"],
#cityList > [role="button"] {
  min-height: 54px;
  margin: 0 !important;
  padding: 15px 10px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

#categoryList > [role="button"]:hover,
#categoryList > [role="button"]:focus,
#cityList > [role="button"]:hover,
#cityList > [role="button"]:focus {
  outline: 0;
  color: #176d56;
  background: var(--accent-soft) !important;
}

#mapModal {
  background: #fff !important;
}

#mapModal > div:first-child {
  height: 58px !important;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff !important;
}

#mapClose {
  width: auto;
  min-width: 110px;
  margin: 0 !important;
  padding: 9px 14px !important;
  border-radius: 14px !important;
  color: #fff !important;
  background: var(--dark) !important;
  text-align: center;
  font-size: 13px;
}

#mapModal > div:nth-child(2) {
  top: 58px !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  border-radius: 0 !important;
}

.bottom-nav {
  display: none;
}

@media (max-width: 780px) {
  .category-catalog__nav {
    gap: 8px;
  }

  .category-catalog__nav h2 {
    font-size: 16px;
  }

  #categoryBackButton {
    padding-right: 10px;
    padding-left: 10px;
    font-size: 11px;
  }

  .category-catalog__group {
    grid-template-columns: 44px minmax(0, 1fr) auto 16px;
    gap: 9px;
  }

  .category-catalog__group-icon {
    width: 42px;
    height: 42px;
    font-size: 21px;
  }

  .request-brand small {
    display: none;
  }

  .home-fade-button {
    display: inline-flex;
  }

  .request-page-main {
    padding-top: 18px;
    padding-bottom: 28px;
  }

  .request-page-intro h1 {
    font-size: 30px;
  }

  .request-form {
    padding: 18px 16px 22px;
    border-radius: 22px;
  }

  .bottom-nav {
    position: fixed;
    z-index: 1000;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-width: 720px;
    margin: 0 auto;
    gap: 2px;
    min-height: 70px;
    overflow: hidden;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 25px;
    background: rgba(38, 38, 38, 0.97);
    box-shadow: 0 15px 38px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
  }

  .bn-link {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    padding: 6px 2px;
    border-radius: 17px;
    color: rgba(255, 255, 255, 0.48);
    text-decoration: none;
    font-size: 8px;
    font-weight: 500;
  }

  .bn-link > span:last-child {
    color: inherit;
    font-size: 8px;
    font-weight: 500;
    white-space: nowrap;
  }

  .bn-link__icon {
    color: rgba(255, 255, 255, 0.63);
    font-size: 23px !important;
    line-height: 1;
  }

  .bn-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
  }

  .bn-link.active .bn-link__icon {
    color: #fff;
  }

  .bn-link--create .bn-link__icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    color: #222;
    background: #fff;
    font-size: 22px !important;
  }

  .bn-spacer {
    height: calc(92px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 781px) {
  .request-form {
    padding: 32px;
  }
}

.address-entry-modal[hidden] {
  display: none !important;
}

.address-entry-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  justify-content: center;
  background: #f5f7fa;
}

.address-entry-panel {
  width: 100%;
  max-width: 720px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: #fff;
}

.address-entry-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.address-entry-step {
  color: #647482;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.address-entry-header h2 {
  margin: 2px 0 0;
  color: #17202a;
  font-size: 22px;
  line-height: 1.25;
  text-align: left;
}

.address-entry-close {
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #eef4f8;
  color: #17202a;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.address-entry-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}

.address-entry-save,
.address-entry-map {
  width: 100%;
  margin: 0;
  padding: 12px 10px;
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.address-entry-save {
  background: #17202a;
  color: #fff;
}

.address-entry-map {
  background: #eef4f8;
  color: #17202a;
}

.address-entry-kato {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #d9e5ef;
  border-radius: 10px;
  background: #f8fbfd;
  color: #41505c;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.address-entry-textarea {
  width: 100%;
  height: 54px;
  min-height: 54px;
  max-height: 42vh;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid #cfd9e2;
  border-radius: 12px;
  background: #fff;
  color: #17202a;
  font-size: 18px;
  line-height: 1.45;
  resize: none;
  overflow: hidden;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

@media (max-width: 780px) {
  .address-entry-modal {
    top: var(--address-entry-viewport-top, 0);
    bottom: auto;
    height: var(--address-entry-viewport-height, 100dvh);
    min-height: 0;
    overflow: hidden;
  }

  .address-entry-panel {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .address-entry-modal.is-address-entry-input-active .address-entry-panel {
    padding: max(14px, calc(env(safe-area-inset-top) + 12px)) 16px 16px;
  }

  .address-entry-modal.is-address-entry-input-active .address-entry-actions,
  .address-entry-modal.is-address-entry-input-active .address-entry-kato {
    display: none;
  }

  .address-entry-modal.is-address-entry-input-active .address-entry-header {
    margin-bottom: 10px;
  }

  .address-entry-modal.is-address-entry-input-active .address-entry-header h2 {
    font-size: 18px;
  }

  .address-entry-modal.is-address-entry-input-active .address-entry-textarea {
    margin: 0 0 10px;
    max-height: 88px;
  }
}
