:root {
  --bg: #0d0d14;
  --bg-soft: #171727;
  --text: #f3f4f8;
  --muted: #b7bad0;
  --accent: #D2691E;
  --accent-2: #ffd24a;
  --border: #2a2b3f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #0c0c13, #111322);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 13, 20, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  position: relative;
  padding-right: 88px;
}

.logo {
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
}

nav {
  display: flex;
  gap: 18px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--text);
}

.lang-switcher {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: block;
}

.lang-toggle {
  width: 38px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  background: #12152a;
}

.lang-toggle:hover {
  border-color: rgba(255, 138, 0, 0.7);
}

.lang-flag-img {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  display: block;
}

.hero {
  padding: 84px 0 48px;
}

.hero-inner {
  max-width: 760px;
}

.badge {
  display: inline-block;
  background: rgba(255, 138, 0, 0.15);
  border: 1px solid rgba(255, 138, 0, 0.42);
  color: #ffe0ad;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.86rem;
}

h1 {
  margin: 16px 0;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.1;
}

.lead {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.08rem;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  padding: 11px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn-danger {
  border: 1px solid rgba(255, 95, 95, 0.6);
  background: rgba(255, 95, 95, 0.14);
  color: #ffd8d8;
}

.section {
  padding: 34px 0 16px;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.section-top {
  margin-bottom: 14px;
}

.section p {
  color: var(--muted);
  line-height: 1.7;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.works-split {
  display: grid;
  gap: 22px;
}

.works-block h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
}

.card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.card p {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #d7d9e8;
}

.img-missing {
  padding: 50px 12px;
  text-align: center;
  color: #a9adc4;
  font-size: 0.88rem;
}

.prices {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.price-card {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 16px;
}

.price-card h3 {
  margin: 0 0 10px;
}

.price-card ul {
  margin: 0;
  padding-left: 20px;
  color: #d4d7ea;
}

.price-card li {
  margin: 8px 0;
}

.prices-note {
  margin-top: 10px;
}

.site-footer {
  margin-top: 42px;
  border-top: 1px solid var(--border);
  background: rgba(8, 8, 12, 0.6);
}

.footer-inner {
  padding: 22px 0 30px;
}

.footer-inner p {
  margin: 6px 0;
  color: var(--muted);
}

.footer-inner a {
  color: #ffdca3;
}

.muted {
  opacity: 0.8;
}

.chat-alert {
  margin: 10px 0 14px;
  border-radius: 10px;
  padding: 10px 12px;
}

.chat-error {
  background: rgba(255, 70, 70, 0.14);
  border: 1px solid rgba(255, 70, 70, 0.45);
}

.chat-success {
  background: rgba(70, 210, 115, 0.14);
  border: 1px solid rgba(70, 210, 115, 0.45);
}

.auth-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 12px;
}

.auth-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--bg-soft);
  display: grid;
  gap: 10px;
}

.auth-card h3 {
  margin: 0;
}

.chat-input,
.chat-textarea {
  width: 100%;
  background: #0f1020;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
}

.chat-textarea {
  min-height: 88px;
  resize: vertical;
}

.staff-layout {
  display: grid;
  grid-template-columns: minmax(180px, 250px) 1fr;
  gap: 12px;
}

.staff-users {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
  padding: 12px;
}

.staff-users h3 {
  margin-top: 0;
}

.staff-search-form {
  margin-bottom: 10px;
}

.staff-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  text-decoration: none;
  color: #d7d9e8;
}

.staff-user-item.active {
  border-color: rgba(255, 138, 0, 0.7);
  background: rgba(255, 138, 0, 0.12);
  color: #ffe3b7;
}

.unread-badge {
  min-width: 22px;
  text-align: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 0.76rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
}

.chat-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
  padding: 12px;
}

.manage-user-bar {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #101225;
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.manage-user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-blocked {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 95, 95, 0.6);
  color: #ffbcbc;
}

.chat-messages {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.chat-message {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #101225;
  padding: 10px;
}

.chat-message.mine {
  border-color: rgba(255, 138, 0, 0.5);
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.chat-message p {
  margin: 0;
  color: #d7d9e8;
  line-height: 1.6;
  white-space: normal;
}

.chat-form {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.chat-widget {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(460px, calc(100vw - 24px));
  max-height: min(78vh, 760px);
  z-index: 120;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(13, 13, 20, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.chat-widget-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-widget-link {
  color: #ffdca3;
  text-decoration: none;
}

.chat-widget-role {
  font-size: 0.82rem;
  color: var(--muted);
}

.chat-widget-body {
  padding: 12px;
  overflow: auto;
  max-height: calc(min(78vh, 760px) - 48px);
}

.chat-widget .staff-layout {
  grid-template-columns: 1fr;
}

.chat-widget .staff-users {
  max-height: 180px;
  overflow: auto;
}

.chat-widget .chat-messages {
  max-height: 240px;
}

.chat-page {
  min-height: 100vh;
}

.chat-shell {
  width: min(1240px, 96vw);
  margin: 8px auto;
  height: calc(100dvh - 80px);
  display: grid;
  grid-template-columns: 320px 1fr;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #111323;
}

.chat-shell-no-sidebar {
  grid-template-columns: 1fr;
}

.tg-sidebar {
  border-right: 1px solid var(--border);
  background: #0f1122;
  display: grid;
  grid-template-rows: auto 1fr;
}

.tg-side-top {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.tg-side-top h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.tg-dialog-list {
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.tg-group {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.tg-group-title {
  margin: 0;
  font-size: 0.82rem;
  color: #bfc3da;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tg-dialog-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #151833;
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.tg-dialog-item.active {
  border-color: rgba(255, 138, 0, 0.7);
  background: rgba(255, 138, 0, 0.14);
}

.tg-dialog-title {
  font-weight: 600;
}

.tg-dialog-title-wrap {
  display: grid;
  gap: 4px;
}

.tg-role-badge {
  width: fit-content;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  color: #d7daec;
  background: #10142a;
}

.tg-role-inline {
  font-size: 0.72rem;
  color: #cdd1e6;
  font-weight: 500;
}

.tg-main {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: linear-gradient(180deg, #111323, #0f1020);
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.tg-chat-head {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tg-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-head-actions {
  display: flex;
  gap: 8px;
}

.tg-messages {
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
}

.tg-bubble {
  max-width: min(78%, 680px);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #161a36;
  padding: 10px;
}

.tg-bubble.mine {
  margin-left: auto;
  background: rgba(255, 180, 64, 0.18);
  border-color: rgba(255, 170, 36, 0.45);
}

.tg-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.tg-bubble p {
  margin: 0;
  color: #e9eaf3;
  line-height: 1.55;
}

.tg-input-wrap {
  border-top: 1px solid var(--border);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.tg-text {
  min-height: 84px;
  max-height: 160px;
  height: 96px;
  resize: vertical;
}

.tg-input-wrap .btn {
  align-self: flex-end;
}

.tg-msg-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tg-status {
  color: var(--muted);
  font-size: 0.78rem;
}

.tg-edit-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #12152a;
  color: #e7e9f5;
  font-size: 0.78rem;
  padding: 4px 8px;
  cursor: pointer;
}

.tg-edited {
  color: #c8cce4;
  font-size: 0.72rem;
  margin-left: 6px;
}

.tg-empty {
  color: var(--muted);
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

@media (max-width: 700px) {
  nav {
    gap: 10px;
    font-size: 0.9rem;
  }

  .site-header .nav {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo lang"
      "menu menu";
    align-items: center;
    row-gap: 8px;
    min-height: auto;
    padding: 10px 0 12px;
    padding-right: 0;
  }

  .site-header .nav > .logo {
    grid-area: logo;
    white-space: nowrap;
  }

  .site-header .nav > nav {
    grid-area: menu;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    justify-content: flex-start;
  }

  .site-header .nav > .lang-switcher {
    grid-area: lang;
    position: static;
    transform: none;
    justify-self: end;
  }

  .staff-layout {
    grid-template-columns: 1fr;
  }

  .manage-user-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-widget {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .chat-shell {
    width: 100%;
    border-radius: 0;
    height: calc(100dvh - 64px);
    margin: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .tg-sidebar {
    display: grid;
    grid-template-rows: auto 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .tg-side-top {
    padding: 8px 10px;
  }

  .tg-side-top h2 {
    margin: 0 0 8px;
    font-size: 1rem;
  }

  .tg-dialog-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px 10px;
    align-items: flex-start;
    min-height: 72px;
  }

  .tg-group {
    display: grid;
    gap: 8px;
    margin: 0;
    flex-shrink: 0;
    min-width: 220px;
  }

  .tg-group-title {
    display: block;
    font-size: 0.72rem;
    margin: 0;
  }

  .tg-dialog-item {
    min-width: 200px;
  }

  .tg-group .tg-empty {
    display: block;
    min-width: 200px;
    padding: 10px;
    font-size: 0.9rem;
  }

  .tg-bubble {
    max-width: 92%;
  }

  .tg-input-wrap {
    grid-template-columns: 1fr;
  }
}
