@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/montserrat-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/montserrat-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/montserrat-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/montserrat-cyrillic-700.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  color-scheme: dark;
  --black: #111111;
  --white: #ffffff;
  --orange: #ff9000;
  --muted: rgba(255, 255, 255, 0.72);
  --line: #333333;
  --card: #1b1b1b;
  --danger: #ffb1a3;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: Montserrat, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

body.page-feedback {
  background: #101012;
  color: #f5f5f5;
  overflow-x: hidden;
}

.screen {
  width: min(100%, 32rem);
  margin: 0 auto;
  min-height: 100dvh;
  padding:
    calc(1.25rem + env(safe-area-inset-top))
    1.25rem
    calc(1.5rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.narrow { width: min(100%, 26rem); }

.logo {
  margin: 0;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.22em;
  line-height: 1;
}

.brand-note {
  margin: 0.35rem 0 0;
  color: var(--orange);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2 { font-weight: 700; line-height: 1.15; }

h1 { margin: 0.8rem 0 0; font-size: clamp(1.8rem, 8vw, 2.45rem); }

h2 { margin: 0; font-size: 1.45rem; }

.lede, .explain { margin: 0.6rem 0 0; color: var(--muted); font-size: 1.05rem; }

.star-form, .complaint, .stack { display: flex; flex-direction: column; gap: 0.9rem; }

fieldset.stars {
  margin: 0.4rem 0 0;
  padding: 0;
  border: 0;
}

.star-row {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
}

.star-field {
  position: relative;
  width: 4.2rem;
  height: 4.2rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
}

.star-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}

.star {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.star-icon {
  width: 3rem;
  height: 3rem;
  fill: rgba(255, 255, 255, 0.38);
}

.star-field.is-lit .star-icon,
.star-input:checked + .star .star-icon { fill: var(--orange); }

.star-field:focus-within {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.score-line, .score-pill { margin: 0; text-align: center; }

.score-pill {
  margin-top: 0.35rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: #1c1c1c;
}

.button, .yandex-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 0;
  background: var(--orange);
  color: var(--black);
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  cursor: pointer;
}

.button:disabled { opacity: 0.6; cursor: wait; }

.button-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--orange);
}

.button-small { width: auto; min-height: 2.75rem; }

.js .button-next { display: none; }

.yandex-link {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--orange);
}

.yandex-wrap { margin: 0.4rem 0 0; }

.status { min-height: 1.4rem; margin: 0; text-align: center; }

.status:empty { display: none; }

.status[data-kind="loading"] {
  color: var(--orange);
  animation: pulse 1s ease-in-out infinite;
}

.status[data-kind="success"] { color: var(--white); }

.status[data-kind="error"] { color: var(--danger); }

@keyframes pulse {
  50% { opacity: 0.45; }
}

.status-error { color: var(--danger); text-align: left; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

label, .label { font-weight: 700; }

.optional { color: var(--muted); font-weight: 400; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #181818;
  color: var(--white);
  font: inherit;
  font-size: 16px;
  padding: 0.85rem 1rem;
}

textarea { resize: vertical; min-height: 8rem; }

input:focus-visible, textarea:focus-visible, select:focus-visible, .button:focus-visible, .yandex-link:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.consent input {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.15rem;
  accent-color: var(--orange);
  padding: 0;
}

.consent label { font-weight: 400; }

.thanks {
  padding: 1rem;
  border-radius: 1rem;
  background: #1c1c1c;
}

.thanks p { margin: 0; }

.muted, .empty { color: var(--muted); }

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--orange);
  color: var(--black);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus { transform: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin {
  width: min(100%, 56rem);
  margin: 0 auto;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom));
}

.admin-top, .card-top, .inline-form {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.admin-top h1 { margin: 0.4rem 0 0; font-size: 1.8rem; }

.admin-top form { margin: 0; }

.stats, .counts, .filters, .cards {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat, .card {
  background: var(--card);
  border: 1px solid #2a2a2a;
  border-radius: 1rem;
  padding: 1rem;
}

.stat-label { margin: 0; color: var(--muted); font-size: 0.9rem; }

.stat-value { margin: 0.3rem 0 0; font-size: 1.8rem; font-weight: 700; color: var(--orange); }

.counts {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0;
  list-style: none;
}

.counts li {
  text-align: center;
  background: #1c1c1c;
  border-radius: 0.8rem;
  padding: 0.6rem 0.2rem;
  font-size: 0.85rem;
}

.admin-nav {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-nav, .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.admin-nav a, .filters a {
  text-align: center;
  text-decoration: none;
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.4rem;
  min-height: 2.75rem;
  display: grid;
  place-items: center;
}

.admin-nav a[aria-current="page"],
.filters a[aria-current="page"] {
  background: var(--orange);
  color: var(--black);
  border-color: var(--orange);
  font-weight: 700;
}

.filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.status-badge { margin: 0; font-weight: 700; }

.status-new { color: #7eb6ff; }

.status-in_progress { color: var(--orange); }

.status-resolved { color: #3ddc97; }

.card[data-status="new"] { box-shadow: inset 4px 0 0 #3d7dff; }

.card[data-status="in_progress"] { box-shadow: inset 4px 0 0 var(--orange); }

.card[data-status="resolved"] { box-shadow: inset 4px 0 0 #2eaa6a; }

.card-actions, .dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.button-danger {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: transparent;
  color: #ff8d8d;
  border: 1px solid #ff8d8d;
}

.button-danger svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }

dialog {
  width: min(100% - 2rem, 28rem);
  background: var(--card);
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.2rem;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.72); }

dialog h2 { margin: 0 0 0.6rem; }

.settings-card h2 { margin-top: 0; }

.card { display: flex; flex-direction: column; gap: 0.45rem; }

.card p { margin: 0; }

.card-id { font-weight: 700; letter-spacing: 0.03em; }

.card-stars { color: var(--orange); font-weight: 700; }

.card-text { white-space: pre-wrap; }

.inline-form { align-items: end; }

.inline-form select { min-width: 9rem; }

@media (max-width: 700px) {
  .counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters, .admin-nav { grid-template-columns: 1fr 1fr; }
  .inline-form, .admin-top, .card-actions, .dialog-actions { flex-direction: column; align-items: stretch; }
  .star-field { width: 3.6rem; height: 3.6rem; }
  .star-icon { width: 2.6rem; height: 2.6rem; }
}

.page-feedback .screen {
  width: min(100% - 1.25rem, 600px);
  justify-content: flex-start;
  gap: 0;
  padding:
    calc(0.85rem + env(safe-area-inset-top))
    0.7rem
    calc(1.4rem + env(safe-area-inset-bottom));
}

.review-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.35rem 0.35rem 0.9rem;
}

.page-feedback h1 {
  margin: 0;
  color: #f5f5f5;
  font-size: clamp(1.7rem, 7vw, 2rem);
  letter-spacing: -0.02em;
}

.close-review {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid #36363c;
  background: #202024;
  color: #f5f5f5;
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.photo-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  border-radius: 1.15rem 1.15rem 0 0;
  overflow: hidden;
}

.photo-collage img {
  display: block;
  width: 100%;
  height: clamp(7.2rem, 28vw, 11.5rem);
  object-fit: cover;
  background: #202024;
}

.company-card {
  position: relative;
  z-index: 1;
  margin: -1.7rem 0.35rem 0;
  padding: 1.5rem 1.35rem 1.15rem;
  border-radius: 1.4rem;
  background: #242428;
}

.company-name {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.company-line,
.company-address {
  margin: 0.25rem 0 0;
  color: #96969c;
  overflow-wrap: anywhere;
}

.company-card .star-form { margin-top: 0.85rem; }

.page-feedback .star-form { gap: 0.4rem; }

.page-feedback .star-row {
  justify-content: space-between;
  gap: 0.2rem;
}

.page-feedback .star-field {
  width: 3rem;
  height: 3rem;
  flex: 1 1 0;
  border-radius: 0.7rem;
}

.page-feedback .star-icon {
  width: 2.7rem;
  height: 2.7rem;
  fill: #55555c;
  transition: fill 0.16s ease, transform 0.16s ease;
}

.page-feedback .star-field.is-lit .star-icon,
.page-feedback .star-input:checked + .star .star-icon {
  fill: #ffd65a;
  transform: scale(1.06);
}

.page-feedback .star-field:focus-within {
  outline-color: #ffd65a;
}

.page-feedback .complaint {
  margin: 1.15rem 0.35rem 0;
  gap: 0.85rem;
}

.page-feedback .complaint.is-open { animation: review-rise 0.28s ease; }

.page-feedback .complaint h2,
.page-feedback .thanks h2 {
  font-size: 1.35rem;
}

.page-feedback .explain { color: #96969c; }

.page-feedback textarea,
.page-feedback input[type="text"] {
  background: #242428;
  color: #f5f5f5;
  border: 1px solid #36363c;
  border-radius: 1.55rem;
}

.page-feedback textarea {
  min-height: 12.5rem;
  padding: 1.25rem 1.35rem;
  resize: none;
  overflow: hidden;
}

.page-feedback textarea::placeholder,
.page-feedback input::placeholder { color: #96969c; }

.page-feedback .button-send {
  background: #3b82f6;
  color: #ffffff;
  border: 0;
  border-radius: 18px;
  min-height: 3.6rem;
  font-weight: 700;
}

.page-feedback .button-send:hover,
.page-feedback .button-send:active { background: #2563eb; }

.page-feedback .button-send:disabled { opacity: 0.72; }

.page-feedback .photo-attach {
  display: grid;
  gap: 0.7rem;
}

.page-feedback .photo-attach h3 {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
}

.page-feedback .photo-count {
  margin: 0;
  color: #96969c;
}

.page-feedback .photo-picks {
  display: grid;
  gap: 0.55rem;
}

.page-feedback .photo-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--orange);
  border-radius: 18px;
  color: var(--white);
  font-weight: 700;
  text-align: center;
  touch-action: manipulation;
  cursor: pointer;
}

.page-feedback .photo-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page-feedback .photo-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-feedback .photo-previews:empty { display: none; }

.page-feedback .photo-previews li {
  display: grid;
  gap: 0.35rem;
}

.page-feedback .photo-previews img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: #242428;
}

.page-feedback .photo-remove {
  min-height: 2.75rem;
  border: 0;
  border-radius: 12px;
  background: #242428;
  color: #f5f5f5;
  font: inherit;
  font-weight: 700;
  touch-action: manipulation;
  cursor: pointer;
}

@media (min-width: 640px) {
  .page-feedback .photo-picks { grid-template-columns: 1fr 1fr; }
}

.page-feedback .yandex-link {
  background: transparent;
  color: #96969c;
  border: 0;
  min-height: 0;
  font-weight: 400;
  text-decoration: underline;
}

.review-footnote {
  margin: 0.8rem 0 0;
  color: #96969c;
  font-size: 0.85rem;
  text-align: center;
}

.page-feedback .thanks,
.page-feedback .review-choice {
  margin: 1.15rem 0.35rem 0;
  padding: 1.4rem;
  border-radius: 1.4rem;
  background: #242428;
  animation: review-rise 0.28s ease;
}

.page-feedback .review-choice h2 { margin: 0; }

.page-feedback .review-choice p { margin: 0.55rem 0 0; }

.review-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1rem;
}

.page-feedback .review-link {
  width: 100%;
  min-height: 3.25rem;
  background: var(--orange);
  color: var(--black);
  border: 0;
}

.page-feedback .thanks p + p { margin-top: 0.55rem; }

.page-feedback .status[data-kind="success"] { color: #f5f5f5; }

@keyframes review-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.photo-card h2 { margin: 0; font-size: 1.15rem; }

.photo-preview {
  width: 100%;
  height: 9rem;
  object-fit: cover;
  border-radius: 0.8rem;
  background: #202024;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.photo-actions form { flex: 1 1 auto; }

.photo-card input[type="file"] { max-width: 100%; }

.page-admin .logo {
  letter-spacing: 0.04em;
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

@media (min-width: 700px) {
  .photo-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .admin-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.telegram-toggle {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.telegram-toggle input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.button-primary {
  background: #3b82f6;
  color: #ffffff;
  border-radius: 18px;
}

.button-primary:hover,
.button-primary:active { background: #2563eb; }

.settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.settings-nav a {
  text-align: center;
  text-decoration: none;
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  min-height: 2.75rem;
  display: grid;
  place-items: center;
}

.settings-nav a[aria-current="page"] {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
  font-weight: 700;
}

.banner {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: #1b1b1b;
  border: 1px solid #2a2a2a;
  color: var(--white);
}

.auth-links { margin: 0.2rem 0 0; text-align: center; }

.auth-links a { color: var(--white); font-weight: 700; }

.mail-status { margin: 0; color: var(--white); font-weight: 700; }

.page-admin .stack .button { width: 100%; }

.interval-choice {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.interval-choice legend {
  padding: 0;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.interval-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.interval-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid #333333;
  border-radius: 0.9rem;
  background: #181818;
  color: var(--white);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.interval-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  background: transparent;
}

.interval-mark {
  display: grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  border: 1px solid #555555;
  border-radius: 999px;
}

.interval-option:has(input:checked) {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 1px var(--orange);
  color: var(--orange);
}

.interval-option:has(input:checked) .interval-mark {
  border-color: var(--orange);
  background: var(--orange);
}

.interval-option:has(input:checked) .interval-mark::after {
  content: "";
  width: 0.28rem;
  height: 0.5rem;
  border: solid #111111;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}

.interval-option:has(input:focus-visible) {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .interval-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .page-feedback .screen { padding-top: 2rem; }
  .photo-collage img { height: 11.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
