:root {
  --tg-bg: #e7ebf0;
  --tg-panel: #ffffff;
  --tg-header: #229ed9;
  --tg-header-text: #ffffff;
  --tg-user: #dcf8c6;
  --tg-bot: #ffffff;
  --tg-admin: #f0f0ff;
  --tg-text: #1f2937;
  --tg-border: #d7dde6;
  --danger: #d9534f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Segoe UI", "Noto Sans", sans-serif;
  color: var(--tg-text);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a,
button,
input,
label,
select,
textarea {
  touch-action: manipulation;
}

.web-index-body,
.web-auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #f8fbff 0%, #dcebf8 40%, #c8ddf2 100%);
  padding: 16px;
}

.web-index-shell {
  width: min(1080px, 100%);
  display: grid;
  gap: 18px;
}

.web-index-hero {
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(34, 158, 217, 0.14), rgba(255, 255, 255, 0.92)),
    #ffffff;
  border: 1px solid var(--tg-border);
  border-radius: 22px;
  box-shadow: 0 16px 36px rgba(31, 41, 55, 0.12);
}

.web-index-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: #1b6f9a;
}

.web-index-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 0.98;
}

.web-index-copy {
  margin: 0;
  max-width: 680px;
  font-size: 15px;
  color: #536373;
}

.web-site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.web-site-card {
  display: grid;
  gap: 14px;
  min-height: 200px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 247, 253, 0.94)),
    #ffffff;
  border: 1px solid var(--tg-border);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(31, 41, 55, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.web-site-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(31, 41, 55, 0.14);
  border-color: #9fc8e2;
}

.web-site-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.web-site-card-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  background: #fff;
}

.web-site-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff7fd;
  border: 1px solid #cfe7f7;
  font-size: 12px;
  font-weight: 700;
  color: #155a80;
}

.web-site-card h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1;
}

.web-site-card p {
  margin: 0;
  color: #57697a;
  font-size: 14px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--tg-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.auth-brand {
  text-align: center;
  margin-bottom: 14px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-brand h1 {
  margin: 8px 0 4px;
  font-size: 22px;
}

.auth-brand p {
  margin: 0;
  color: #5f6b7a;
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-form label { font-weight: 600; }

.auth-form input,
.settings-form input,
.chat-footer textarea {
  width: 100%;
  border: 1px solid var(--tg-border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  background: #fff;
}

.auth-form button,
.settings-form button,
.menu-card button,
.send-btn,
.quick-keyboard button,
.attach-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.auth-form button,
.settings-form button,
.send-btn {
  background: var(--tg-header);
  color: #fff;
  font-weight: 600;
}

.auth-form button[disabled] {
  cursor: not-allowed;
}

.auth-form button.is-loading {
  background: #6ca5c3;
}

.auth-form button.is-cooldown {
  background: linear-gradient(135deg, #5f7388, #466175);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.auth-help {
  margin: 0;
  color: #607180;
  font-size: 13px;
}

.auth-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: #26804a;
}

.auth-status.error { color: #b3261e; }

.web-chat-body {
  background: var(--tg-bg);
}

.web-chat-body.drawer-open {
  overflow: hidden;
}

.chat-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: 56px 1fr auto auto;
}

.chat-stage {
  position: relative;
  min-height: 0;
}

.chat-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    var(--tg-header);
  color: var(--tg-header-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 20px rgba(8, 45, 69, 0.12);
}

.header-left {
  display: flex;
  align-items: center;
}

.header-center {
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.burger-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(7, 38, 58, 0.14);
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.burger-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.burger-btn:hover,
.burger-btn.is-open {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.62);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(7, 38, 58, 0.2);
}

.menu-drawer {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  background: rgba(9, 28, 43, 0.28);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 40;
}

.menu-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.menu-panel {
  width: min(390px, 100vw);
  height: 100dvh;
  margin-left: auto;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    linear-gradient(180deg, rgba(242, 248, 253, 0.98), rgba(255, 255, 255, 0.98) 22%),
    #ffffff;
  border-left: 1px solid #d9e6f1;
  box-shadow: -22px 0 44px rgba(15, 42, 62, 0.18);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  overflow: hidden;
}

.menu-drawer.open .menu-panel {
  transform: translateX(0);
}

.menu-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #e2ebf3;
  background:
    radial-gradient(circle at top right, rgba(34, 158, 217, 0.16), rgba(34, 158, 217, 0) 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 254, 0.98));
}

.menu-panel-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
}

.menu-panel-logo,
.menu-panel-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  flex: 0 0 auto;
}

.menu-panel-logo {
  object-fit: cover;
  background: #fff;
  border: 1px solid #d8e8f3;
}

.menu-panel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ffffff, #e8f3fb);
  border: 1px solid #d8e8f3;
  font-size: 22px;
}

.menu-panel-copy {
  min-width: 0;
}

.menu-panel-copy h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.menu-panel-copy p {
  margin: 4px 0 0;
  color: #607387;
  font-size: 13px;
  line-height: 1.35;
}

.drawer-close-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  font: inherit;
  cursor: pointer;
  border: 1px solid #d5e4ef;
  border-radius: 12px;
  background: #fff;
  color: #4b6579;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(29, 70, 98, 0.08);
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.drawer-close-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.drawer-close-btn:hover {
  background: #f6fbff;
  color: #1a6f9e;
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(29, 70, 98, 0.12);
}

.menu-panel-body {
  overflow-y: auto;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.menu-user-chip,
.menu-section {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid #dce8f2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.98)),
    #fff;
  box-shadow: 0 10px 26px rgba(27, 54, 76, 0.06);
}

.menu-user-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #698096;
}

.menu-user-chip strong,
.menu-section-note strong {
  font-size: 15px;
  color: #18384d;
  word-break: break-word;
}

.menu-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #32546e;
}

.menu-section-note {
  color: #5f7284;
  font-size: 14px;
  line-height: 1.45;
}

.menu-action-list {
  display: grid;
  gap: 10px;
}

.menu-action-form {
  margin: 0;
}

.menu-action-form,
.menu-action-form .menu-action-btn {
  width: 100%;
}

.menu-action-btn {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 4px;
  padding: 14px 15px;
  font: inherit;
  cursor: pointer;
  border: 1px solid #d6e6f2;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #ffffff, #eff7fd),
    #fff;
  color: #173d58;
  box-shadow: 0 10px 24px rgba(26, 64, 90, 0.08);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.menu-action-btn:hover {
  transform: translateY(-1px);
  border-color: #a9cfe6;
  box-shadow: 0 14px 28px rgba(26, 64, 90, 0.12);
  background:
    linear-gradient(180deg, #ffffff, #e7f3fb),
    #fff;
}

.menu-action-btn.danger {
  border-color: #edc2be;
  background:
    linear-gradient(180deg, #fff7f6, #ffeceb),
    #fff6f5;
  color: #8e2f28;
}

.menu-action-title {
  display: block;
  font-weight: 700;
  line-height: 1.2;
}

.menu-action-meta {
  display: block;
  color: #64798a;
  font-size: 13px;
  line-height: 1.35;
}

.menu-action-btn.danger .menu-action-meta {
  color: #96504a;
}

.menu-secondary-btn {
  width: 100%;
  font: inherit;
  cursor: pointer;
  border: 1px solid #d0dfea;
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  color: #355873;
  font-weight: 600;
}

.menu-secondary-btn:hover {
  background: #f5fafe;
}

.menu-panel .settings-form {
  gap: 10px;
}

.menu-panel .settings-form button { width: 100%; }

.messages {
  height: 100%;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, #edf3f8 0%, #e7edf3 100%);
}

.scroll-bottom-btn {
  position: absolute;
  right: 14px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #2aa8ea, #1686c2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 32px rgba(9, 73, 109, 0.28);
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
  z-index: 6;
}

.scroll-bottom-btn.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-bottom-btn:hover {
  background: linear-gradient(180deg, #38b0ee, #178fce);
  box-shadow: 0 18px 34px rgba(9, 73, 109, 0.34);
}

.scroll-bottom-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.msg {
  max-width: min(82%, 520px);
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid var(--tg-border);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.me {
  align-self: flex-end;
  background: var(--tg-user);
}

.msg.bot {
  align-self: flex-start;
  background: var(--tg-bot);
}

.msg.admin {
  align-self: flex-start;
  background: var(--tg-admin);
}

.msg.is-start {
  padding: 0;
  overflow: hidden;
}

.msg-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f6fbff, #edf6fd);
  border-bottom: 1px solid #d8e6f2;
}

.msg-head-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  flex: 0 0 auto;
}

.msg-head-copy {
  min-width: 0;
}

.msg-head-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
}

.msg-head-meta {
  font-size: 12px;
  color: #6b7b8b;
}

.msg time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #6c7a89;
  text-align: right;
}

.msg-text a {
  color: #1569a8;
  text-decoration: underline;
}

.msg-text b {
  font-weight: 700;
}

.msg-media {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin-top: 6px;
}

.msg.is-start .msg-media {
  width: 100%;
  margin-top: 0;
  border-radius: 0;
}

.msg.is-start .msg-text {
  padding: 10px 12px 0;
}

.msg.is-start time {
  padding: 0 12px 10px;
}

.msg-doc {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #1d4ed8;
  color: #fff;
  text-decoration: none;
}

.msg-inline-controls {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.msg-reply {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-left: 3px solid #229ed9;
  border-radius: 10px;
  background: rgba(34, 158, 217, 0.08);
}

.msg-reply-author {
  font-size: 12px;
  font-weight: 700;
  color: #176896;
}

.msg-reply-text {
  font-size: 12px;
  color: #4c5e70;
  line-height: 1.35;
}

.msg-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.msg-reply-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #d6e5f0;
  border-radius: 10px;
  background: #fff;
  color: #567289;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(14, 46, 69, 0.06);
}

.msg-reply-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.msg-reply-btn:hover {
  color: #166089;
  border-color: #b8d8ea;
  background: #f7fbff;
}

.msg-inline-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.msg-inline-btn {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #b9d8ea;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #f7fbff 0%, #ebf5fc 100%);
  color: #166089;
  font-weight: 600;
  line-height: 1.2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 1px 2px rgba(21, 86, 124, 0.08);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.12s ease,
    box-shadow 0.16s ease;
}

.msg-inline-btn:hover {
  border-color: #9fcce6;
  background:
    linear-gradient(180deg, #ffffff 0%, #e6f2fb 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 4px 12px rgba(34, 114, 162, 0.12);
}

.msg-inline-btn:active {
  transform: translateY(1px);
  background:
    linear-gradient(180deg, #eaf4fb 0%, #deedf8 100%);
  box-shadow:
    inset 0 2px 4px rgba(26, 91, 130, 0.08);
}

.msg-inline-btn:focus-visible {
  outline: 2px solid rgba(34, 158, 217, 0.28);
  outline-offset: 2px;
}

.web-control-btn {
  position: relative;
}

.web-control-btn.is-control-disabled {
  cursor: wait;
  opacity: 0.72;
}

.web-control-btn.is-control-pending {
  border-color: #5baad4 !important;
  background:
    linear-gradient(180deg, #dff2ff 0%, #cfe8fb 100%) !important;
  color: #0f5076 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 0 0 2px rgba(34, 158, 217, 0.12) !important;
}

.web-control-btn.is-control-pending::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #229ed9;
  box-shadow: 0 0 0 0 rgba(34, 158, 217, 0.35);
  animation: control-pulse 1s ease infinite;
}

@keyframes control-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 158, 217, 0.35);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(34, 158, 217, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 158, 217, 0);
  }
}

.quick-keyboard {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--tg-border);
  background: #f4f8fc;
  max-height: 180px;
  overflow-y: auto;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 0.18s ease,
    padding 0.18s ease,
    opacity 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}

.quick-keyboard.is-empty {
  display: none;
}

.quick-keyboard.is-collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-color: transparent;
  opacity: 0;
  transform: translateY(6px);
  overflow: hidden;
}

.quick-row {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.quick-keyboard button {
  border: 1px solid #9fc8e2;
  background: #ffffff;
  color: #12507b;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    opacity 0.16s ease,
    box-shadow 0.16s ease;
}

.chat-footer {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 44px 44px 1fr 44px;
  grid-template-areas:
    "reply reply reply reply"
    "files files files files"
    "restart attach composer send";
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  padding-right: calc(8px + env(safe-area-inset-right, 0px));
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  padding-left: calc(8px + env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--tg-border);
  background: #fff;
}

.composer-reply-preview,
.composer-file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d7e6f1;
  border-radius: 14px;
  background: #f7fbff;
  box-shadow: 0 8px 20px rgba(18, 62, 91, 0.05);
}

.composer-reply-preview[hidden],
.composer-file-preview[hidden] {
  display: none;
}

.composer-reply-preview {
  grid-area: reply;
}

.composer-file-preview {
  grid-area: files;
}

.composer-reply-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.composer-reply-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #176896;
}

.composer-reply-copy strong {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #31485c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-file-list {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.composer-file-chip {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e7f1f9;
  color: #235d84;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-clear-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 10px;
  background: #e8f0f6;
  color: #537189;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.composer-clear-btn:hover {
  background: #dceaf4;
  color: #1f628e;
}

.composer-input {
  grid-area: composer;
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
}

.chat-footer textarea {
  min-height: 40px;
  max-height: 120px;
  resize: none;
  padding-right: 46px;
}

.restart-btn,
.attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  padding: 0;
  box-sizing: border-box;
}

.restart-btn {
  grid-area: restart;
  border: 1px solid #c9d8e6;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #edf6fd);
  color: #1c628f;
  box-shadow: 0 6px 16px rgba(34, 158, 217, 0.12);
}

.restart-btn:hover {
  background: linear-gradient(180deg, #f7fcff, #e4f1fb);
}

.restart-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.attach-btn {
  grid-area: attach;
  background: #eef4fb;
  border: 1px solid var(--tg-border);
  color: #2b5f86;
  border-radius: 12px;
  font-size: 20px;
  line-height: 1;
  text-align: center;
}

.attach-btn input { display: none; }

.keyboard-toggle-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: #eef5fb;
  color: #4b6a82;
  cursor: pointer;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    opacity 0.16s ease;
}

.keyboard-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.keyboard-toggle-btn:hover {
  background: #e3eef8;
  color: #245d84;
}

.keyboard-toggle-btn.is-collapsed {
  background: #dcecf8;
  color: #1874aa;
  transform: translateY(-50%) rotate(180deg);
}

.keyboard-toggle-btn.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.send-btn {
  grid-area: send;
  height: 40px;
  border-radius: 10px;
}

.settings-form { display: grid; gap: 8px; }

@media (min-width: 900px) {
  .menu-drawer {
    padding: 18px;
  }

  .menu-panel {
    width: min(390px, calc(100vw - 36px));
    height: min(100dvh - 36px, 860px);
    border: 1px solid #d9e6f1;
    border-radius: 28px;
  }
}

@media (min-width: 1000px) {
  .chat-shell {
    width: min(900px, 100vw);
    margin: 0 auto;
    border-left: 1px solid var(--tg-border);
    border-right: 1px solid var(--tg-border);
    background: #fff;
  }
}

@media (max-width: 640px) {
  .web-index-hero {
    padding: 18px;
  }

  .web-site-card {
    min-height: 168px;
  }

  .web-site-card h2 {
    font-size: 22px;
  }
}
