:root {
  color-scheme: light;
  --ink: #19233a;
  --muted: #68748b;
  --line: #dfe5ef;
  --paper: #ffffff;
  --surface: #f4f7fb;
  --blue: #2677f3;
  --blue-dark: #165ed0;
  --mint: #12a57a;
  --danger: #cf3d57;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 15% 0%, #e3f0ff 0, transparent 34%), var(--surface); min-height: 100vh; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 72px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; max-width: 700px; font-size: clamp(32px, 5vw, 54px); line-height: 1.03; letter-spacing: -.04em; }
.lead { margin: 14px 0 0; color: var(--muted); font-size: 18px; }
.status-badge { flex: none; padding: 10px 14px; border-radius: 999px; font-size: 13px; font-weight: 750; }
.status-badge.muted { background: #e9edf4; color: #657084; }
.status-badge.ok { background: #dff8ef; color: #087a59; }
.grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 18px; align-items: start; }
.card { background: color-mix(in srgb, var(--paper) 94%, transparent); border: 1px solid rgba(211, 220, 233, .9); border-radius: 20px; padding: 24px; box-shadow: 0 14px 45px rgba(31, 55, 91, .08); }
.check-card, .chats-card { grid-column: 2; }
.check-card { grid-row: 1 / span 2; }
.chats-card { grid-row: 3; }
.auth-card { grid-column: 1; grid-row: 1; }
.add-card { grid-column: 1; grid-row: 2 / span 2; }
.card-heading { margin-bottom: 20px; }
.card-heading > div { display: flex; align-items: center; gap: 10px; }
.card-heading.split { display: flex; justify-content: space-between; align-items: center; }
.step { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: #e6efff; color: var(--blue); font-size: 11px; font-weight: 850; }
h2 { margin: 0; font-size: 19px; letter-spacing: -.015em; }
h3 { margin: 20px 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
label { display: block; margin: 15px 0 7px; color: #536077; font-size: 13px; font-weight: 700; }
input, select { width: 100%; min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; color: var(--ink); outline: none; transition: .18s ease; }
input:focus, select:focus { border-color: #86b1f7; box-shadow: 0 0 0 4px rgba(38, 119, 243, .11); background: white; }
.inline-form { display: flex; gap: 9px; }
button, .icon-button { border: 0; cursor: pointer; border-radius: 12px; font-weight: 750; text-decoration: none; transition: .18s ease; }
button:disabled { opacity: .58; cursor: wait; }
.primary { flex: none; padding: 13px 17px; background: var(--blue); color: white; box-shadow: 0 7px 18px rgba(38, 119, 243, .22); }
.primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.wide { width: 100%; margin-top: 18px; }
.secondary { border: 1px solid #b8cdf2; background: #eef5ff; color: #195fca; font-weight: 700; padding: 13px 16px; border-radius: 12px; cursor: pointer; }
.secondary:hover { background: #e2eeff; }
.ghost { padding: 10px 12px; background: transparent; color: var(--muted); }
.danger { color: var(--danger) !important; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.auth-user { display: flex; justify-content: space-between; align-items: center; }
.auth-user > div { position: relative; padding-left: 17px; }
.dot { position: absolute; left: 0; top: 7px; width: 8px; height: 8px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 0 4px #dff8ef; }
.count { display: grid; place-items: center; min-width: 29px; height: 29px; padding: 0 8px; border-radius: 10px; background: #eef2f7; color: var(--muted); font-size: 12px; font-weight: 800; }
.collection-toolbar { margin: -4px 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8faff; }
.collection-toolbar label { margin-top: 0; }
.collection-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.small-button { display: inline-flex; align-items: center; justify-content: center; padding: 8px 10px; border: 0; border-radius: 9px; background: #eaf0f9; color: #425674; font-size: 11px; font-weight: 750; text-decoration: none; cursor: pointer; }
.empty, .empty-result { padding: 28px 12px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
.chat-list { display: grid; gap: 10px; }
.chat-row { display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.chat-mark { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; color: white; background: linear-gradient(135deg, #2677f3, #7657e8); font-weight: 850; }
.chat-copy { min-width: 0; flex: 1; }
.chat-copy a { display: block; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 780; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.chat-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.chat-actions { display: flex; gap: 6px; }
.icon-button { display: grid; place-items: center; min-width: 34px; height: 32px; padding: 0 8px; background: #edf2fa; color: #4d607e; font-size: 11px; }
.notice { position: sticky; top: 15px; z-index: 4; margin-bottom: 18px; padding: 13px 16px; border-radius: 13px; box-shadow: 0 10px 30px rgba(30, 48, 78, .12); }
.notice.info { background: #e7f0ff; color: #174d9b; }
.notice.success { background: #dff8ef; color: #087a59; }
.notice.error { background: #ffe7eb; color: #a3233b; }
.progress { margin-top: 18px; }
.progress-track { height: 7px; overflow: hidden; background: #e6ebf2; border-radius: 99px; }
.progress-track span { display: block; width: 38%; height: 100%; background: var(--blue); border-radius: inherit; animation: loading 1.1s ease-in-out infinite alternate; }
.progress p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
@keyframes loading { to { transform: translateX(160%); } }
.results { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.result-summary { display: flex; justify-content: space-between; gap: 16px; }
.result-summary span { color: var(--muted); font-size: 12px; }
.results > a { display: block; margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: #edf5ff; color: var(--blue-dark); font-weight: 700; text-decoration: none; }
.result-error { color: var(--danger); font-size: 12px; }
.hidden { display: none !important; }
.parser-card, .avatars-card { grid-column: 1 / -1; }
textarea { width: 100%; resize: vertical; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: #fbfcfe; }
.avatar-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 18px; }
.avatar-item { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-align: center; overflow-wrap: anywhere; }
.avatar-image, .avatar-missing { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 10px; object-fit: cover; }
.avatar-missing { display: grid; place-items: center; background: #eef2f7; color: var(--muted); font-size: 12px; }
.avatar-item a { color: var(--blue-dark); font-size: 12px; }
.oauth-page { display: grid; place-items: center; padding: 24px; }
.oauth-box { width: min(460px, 100%); text-align: center; }
.oauth-box h1 { font-size: 30px; }
@media (max-width: 820px) {
  .shell { width: min(100% - 24px, 680px); padding-top: 28px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .auth-card, .add-card, .check-card, .chats-card { grid-column: 1; grid-row: auto; }
}
@media (max-width: 520px) {
  .inline-form { flex-direction: column; }
  .primary { width: 100%; }
  .card { padding: 19px; border-radius: 17px; }
}
