:root {
  --blue: #2563eb;
  --navy: #172554;
  --yellow: #facc15;
  --page: #f5f9ff;
  --surface: #fff;
  --text: #172033;
  --muted: #667085;
  --line: #dfe7f2;
  --soft: #eaf2ff;
  --success: #21865c;
  --shadow: 0 18px 55px rgba(37, 99, 235, .13);
}

* { box-sizing: border-box; }

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(37, 99, 235, .07) 1px, transparent 1.2px),
    var(--page);
  background-size: 22px 22px;
  color: var(--text);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .25);
  outline-offset: 2px;
}

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

.account-shell {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 50px;
}

.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
}

.account-header img { display: block; width: 112px; }
.account-header > a:last-child {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.account-login {
  width: min(500px, 100%);
  margin: 8vh auto 0;
  padding: clamp(25px, 7vw, 44px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, .97);
  box-shadow: var(--shadow);
  text-align: center;
}

[hidden] { display: none !important; }

.account-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: var(--blue);
  color: white;
  font-size: 24px;
  font-weight: 900;
}

.account-login h1 { margin: 0; font-size: clamp(26px, 7vw, 38px); line-height: 1.05; }
.account-login p { margin: 15px 0 22px; color: var(--muted); }
.account-login small { display: block; margin-top: 13px; color: var(--muted); font-size: 10px; }

.telegram-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  border-radius: 15px;
  background: var(--blue);
  color: white;
  font-weight: 900;
  text-decoration: none;
}

.telegram-login svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: var(--blue);
  color: white;
  font-size: 18px;
  font-weight: 900;
}

.account-profile > div { min-width: 0; }
.account-profile span { color: var(--muted); font-size: 10px; }
.account-profile h1 { margin: 0; overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.account-profile button {
  min-height: 40px;
  margin-left: auto;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--page);
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.account-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}

.account-card-head span { color: var(--muted); font-size: 10px; }
.account-card-head h2 { margin: 0; font-size: 18px; }
.account-card-head .saved-status {
  padding: 6px 9px;
  border-radius: 999px;
  background: #e4f8ee;
  color: var(--success);
  font-weight: 900;
}

.account-messages {
  min-height: 360px;
  max-height: 58vh;
  padding: 18px;
  overflow-y: auto;
  background: var(--page);
}

.account-message {
  width: fit-content;
  max-width: 82%;
  margin: 7px auto 7px 0;
  padding: 10px 12px 7px;
  border: 1px solid var(--line);
  border-radius: 5px 16px 16px 16px;
  background: var(--surface);
}

.account-message.mine {
  margin-right: 0;
  margin-left: auto;
  border-color: #bdd3ff;
  border-radius: 16px 5px 16px 16px;
  background: #dceaff;
}

.account-message p { margin: 0; white-space: pre-wrap; }
.account-message footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 4px;
}
.account-message time,
.account-message button { color: var(--muted); font-size: 9px; }
.account-message button { padding: 0; border: 0; background: none; cursor: pointer; text-decoration: underline; }

.account-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.account-composer label { display: flex; }
.account-composer input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--page);
}
.account-composer button {
  min-height: 46px;
  padding: 0 17px;
  border: 0;
  border-radius: 14px;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 480px) {
  .account-shell { width: min(100% - 18px, 760px); padding-top: 12px; }
  .account-header { margin-bottom: 20px; }
  .account-login { margin-top: 4vh; border-radius: 22px; }
  .account-profile { padding: 12px; }
  .account-messages { min-height: 52vh; padding: 12px; }
  .account-composer button { padding-inline: 12px; }
}

