/* ============ Шапка ============ */
.nav-account {
  display: inline-flex; align-items: center; gap: .45rem;
  margin: 0 0 0 auto; padding: .45rem .8rem; border-radius: 999px;
  color: var(--ink); font-size: .92rem; font-weight: 620; text-decoration: none; white-space: nowrap;
}
.nav-account:hover { background: rgba(18, 23, 20, .06); }
.nav-language { display: inline-flex; flex: none; padding: 3px; border-radius: 999px; background: rgba(18, 23, 20, .06); }
.nav-language button {
  padding: .3rem .6rem; border: 0; border-radius: 999px; background: none; color: var(--muted);
  font: inherit; font-size: .8rem; font-weight: 680; cursor: pointer;
}
.nav-language button:hover { color: var(--ink); }
.nav-language button[aria-current] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.unread {
  display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem;
  border-radius: 999px; background: var(--sale); color: #fff;
  font-size: .75rem; font-weight: 720; line-height: 1; font-variant-numeric: tabular-nums;
}

.footer-links { flex-wrap: wrap; gap: .75rem 1.5rem; }
.footer-links a { white-space: nowrap; }

/* ============ Вход ============ */
.auth { max-width: 460px; margin-inline: auto; }
.auth h1 { font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 770; letter-spacing: -.036em; }
.auth-sub { margin-top: .5rem; color: var(--muted); overflow-wrap: anywhere; }
.auth-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; margin-top: 1.5rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; margin-bottom: 1.5rem; padding: .25rem; border-radius: 14px; background: #eef0eb; }
.auth-tabs a { padding: .55rem .5rem; border-radius: 11px; color: var(--ink-2); font-weight: 620; text-align: center; text-decoration: none; }
.auth-tabs a[aria-current] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-foot { margin-top: 1rem; color: var(--muted); font-size: .92rem; }
.auth-foot a { color: var(--brand); font-weight: 620; text-underline-offset: .2em; }
.auth-foot + .auth-foot { margin-top: .6rem; }
.field.is-readonly { background: var(--surface-2); }
.field input { width: 100%; }
.field.is-readonly input { color: var(--ink-2); text-overflow: ellipsis; }
.field-toggle {
  flex: none; padding: .35rem .1rem; border: 0; background: none;
  color: var(--brand); font: inherit; font-size: .88rem; font-weight: 640; cursor: pointer;
}

.auth-second { margin-top: .75rem; }
.notice a { color: inherit; font-weight: 640; }
.link-button { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 640; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.confirm-note { flex-wrap: wrap; align-items: center; justify-content: flex-start; }
.confirm-note span { flex: 1 1 16rem; }
.confirm-note .icon { margin-top: 0; }

/* ============ Мои покупки ============ */
.account-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.account-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 780; letter-spacing: -.035em; }
.account-head .section-sub { overflow-wrap: anywhere; }
.account-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.orders { display: grid; gap: .85rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.order-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; padding: 1.15rem 1.35rem; }
.order-row-main { flex: 1 1 18rem; min-width: 0; }
.order-row h2 { margin-top: .5rem; font-size: 1.1rem; font-weight: 700; letter-spacing: -.018em; overflow-wrap: anywhere; }
.order-row p { margin-top: .2rem; color: var(--muted); font-size: .9rem; }
.order-row-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ============ Поддержка на странице покупки ============ */
.support {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .9rem 1.25rem;
  margin-top: 1.5rem; padding: 1.1rem 1.2rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; text-align: left;
}
.support h2 { font-size: 1.02rem; font-weight: 700; letter-spacing: -.015em; }
.support p { color: var(--muted); font-size: .9rem; }

/* ============ Чат ============ */
.page-chat .crumbs, .chat { max-width: 760px; margin-inline: auto; }
.chat { display: flex; flex-direction: column; padding: clamp(1rem, 3vw, 1.5rem); }
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.chat-head > div { min-width: 0; }
.chat-head h1 { font-size: clamp(1.1rem, 3vw, 1.35rem); font-weight: 740; letter-spacing: -.022em; overflow-wrap: anywhere; }
.chat-head p { margin-top: .15rem; color: var(--muted); font-size: .88rem; }
.chat-list {
  display: flex; flex-direction: column; gap: .85rem;
  height: clamp(16rem, calc(100dvh - 24rem), 34rem); overflow-y: auto; overscroll-behavior: contain;
  padding: 1.1rem .25rem;
}
.chat-list:focus-visible { outline: 2px solid #6aa886; outline-offset: 2px; border-radius: 12px; }
.chat-empty, .chat-earlier { margin: auto; color: var(--muted); font-size: .92rem; text-align: center; max-width: 26rem; }
.chat-earlier { margin: 0 auto; }
.chat-earlier a { color: var(--brand); font-weight: 620; }
.msg { align-self: flex-start; max-width: min(85%, 32rem); }
.msg.is-mine { align-self: flex-end; }
.msg-text {
  padding: .65rem .9rem; border-radius: 16px 16px 16px 5px; background: #eef0eb; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.is-mine .msg-text { border-radius: 16px 16px 5px 16px; background: var(--brand-50); color: var(--brand-900); }
.msg-meta { margin-top: .25rem; padding: 0 .3rem; color: var(--muted); font-size: .78rem; }
.msg.is-mine .msg-meta { text-align: right; }
.chat-error { margin: 0 0 .85rem; }
.chat-form { display: flex; align-items: flex-end; gap: .6rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.chat-form textarea {
  flex: 1; min-width: 0; min-height: 52px; padding: .8rem 1rem; resize: none;
  border: 1px solid var(--line-2); border-radius: 14px; background: #fff; color: var(--ink); font: inherit; line-height: 1.45;
}
.chat-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); outline: none; }
.chat-send { flex: none; width: 52px; min-height: 52px; padding: 0; border-radius: 14px; }
.chat-hint { margin-top: .6rem; color: var(--muted); font-size: .84rem; }

@media (max-width: 640px) {
  .site-nav { gap: .5rem; }
  .nav-account { margin: 0; padding: .4rem .25rem; }
  .nav-links a[href$="#how"] { display: none; }
  .order-row-actions, .order-row-actions .button { flex: 1 1 auto; }
  .support form, .support .button { width: 100%; }
  .chat-list { height: clamp(14rem, calc(100dvh - 22rem), 34rem); }
}
@media (max-width: 480px) {
  .nav-links { display: none; }
  .nav-account { margin-left: auto; }
  .nav-language button { padding: .3rem .5rem; }
}
@media (max-width: 360px) {
  .nav-account .icon { display: none; }
}
