:root {
  color-scheme: dark;
  --bg: #101115;
  --panel: #18191f;
  --field: #111217;
  --line: #363842;
  --text: #f4f4f7;
  --muted: #a9a9b5;
  --accent: #f07570;
  --accent-fill: #b82629;
  --accent-hover: #9f2226;
  --accent-ink: #fff;
  --selected: #2e2025;
  font: 16px/1.55 system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f0f1f5;
    --panel: #fff;
    --field: #fbfbfd;
    --line: #cdd0d9;
    --text: #191b23;
    --muted: #585b69;
    --accent: #a92227;
    --selected: #f9e7e8;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.frame { width: min(68rem, calc(100% - 3rem)); margin-inline: auto; }
.skip-link { position: absolute; inset: 12px auto auto 12px; z-index: 2; padding: 8px; background: var(--panel); }
.skip-link:not(:focus) { clip-path: inset(50%); }
.top { border-bottom: 1px solid var(--line); background: var(--panel); }
.top-inner, .identity, .brand { display: flex; align-items: center; }
.top-inner { min-height: 4.1rem; justify-content: space-between; gap: 1rem; }
.brand { gap: .56rem; font-size: 1.32rem; letter-spacing: -.04em; font-weight: 760; text-decoration: none; }
.brand img { border-radius: 50%; }
.identity { min-width: 0; gap: .75rem; }
.header-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 570; }
.main { padding: clamp(2rem, 5vw, 4.25rem) 0 4rem; }
.page-title { padding-bottom: 1.75rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.08; letter-spacing: -.06em; font-weight: 780; }
h2 { font-size: 1.28rem; line-height: 1.3; letter-spacing: -.026em; }
h3 { font-size: 1rem; }
.page-title p { margin-top: .65rem; color: var(--muted); }

.account { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.navigation, .card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.navigation { padding: .38rem; }
.navigation a {
  display: flex; min-height: 2.8rem; justify-content: space-between; align-items: center; gap: .4rem;
  padding: .52rem .65rem; color: var(--muted); border-radius: 9px; font-size: .93rem; font-weight: 640;
  text-decoration: none;
}
.navigation a:hover { color: var(--text); background: var(--field); }
.navigation a[aria-current="page"] { color: var(--text); background: var(--selected); }
.navigation a[aria-current="page"] .nav-arrow { color: var(--accent); }
.nav-arrow { font-size: 1.25rem; line-height: 1; }
.card { padding: clamp(1rem, 3vw, 1.6rem); margin-bottom: .9rem; }
.state { max-width: 36rem; }
.state p { margin-top: .5rem; color: var(--muted); }
.state .button { margin-top: 1rem; }
.avatar-row { display: flex; align-items: center; gap: 1rem; margin: 1.2rem 0 .75rem; }
.avatar {
  display: grid; width: 72px; height: 72px; flex-shrink: 0; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--selected);
  color: var(--accent); font-size: 1.48rem; font-weight: 740; object-fit: cover;
}
.avatar-row .hint { margin-top: .4rem; }
.banner { width: 100%; max-height: 11rem; border-radius: 9px; object-fit: cover; margin-top: .75rem; }

form label { display: grid; gap: .36rem; font-size: .9rem; font-weight: 615; }
form input:not([type="checkbox"]), form textarea, form select {
  min-width: 0; width: 100%; padding: .65rem .7rem; color: var(--text);
  background: var(--field); border: 1px solid var(--line); border-radius: 8px; font-weight: 450;
}
form textarea { resize: vertical; }
#profile-form { display: grid; gap: .85rem; padding-top: .5rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.visibility { padding-block: .2rem; }
.choice { display: flex; align-items: center; gap: .5rem; margin: .65rem 0 .25rem; min-height: 1.9rem; }
.choice input { width: 1rem; height: 1rem; accent-color: var(--accent-fill); }
.choice:has(:disabled) { color: var(--muted); }
.hint, .item p, .message { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.card > .hint { margin: .4rem 0 .65rem; }
.message:not(:empty) { margin: .4rem 0; }
.message[data-error] { color: var(--accent); }
.item {
  display: flex; align-items: center; justify-content: space-between; gap: .9rem;
  padding-block: .82rem; min-height: 4rem;
}
.item + .item { border-top: 1px solid var(--line); }
.item:last-child { padding-bottom: 0; }
.item > div:first-child { min-width: 0; }
.provider .button[disabled] { cursor: default; opacity: .55; }
.row-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.button {
  display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; gap: .35rem;
  padding: .5rem .73rem; border: 1px solid var(--line); border-radius: 8px; background: var(--field);
  color: var(--text); font-size: .9rem; line-height: 1.2; font-weight: 650; text-decoration: none; white-space: nowrap;
  cursor: pointer;
}
.button:hover:not(:disabled) { border-color: var(--accent); }
.button:disabled { opacity: .55; cursor: default; }
.button-primary { background: var(--accent-fill); color: var(--accent-ink); border-color: transparent; }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-quiet { background: transparent; border-color: transparent; }
dialog {
  width: min(26rem, calc(100% - 2rem)); padding: 1.5rem; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
dialog::backdrop { background: #000a; }
dialog p { margin: .6rem 0 1rem; color: var(--muted); }
#crop-form { display: grid; gap: .7rem; }
#crop-preview { display: block; width: min(12rem, 75%); height: auto; border-radius: 50%; margin: .25rem auto; }
#crop-form input[type="range"] { padding: 0; accent-color: var(--accent-fill); }

@media (max-width: 720px) {
  .frame { width: calc(100% - 2rem); }
  .account { grid-template-columns: minmax(0, 1fr); gap: .85rem; }
  .navigation { display: grid; grid-template-columns: auto 1fr auto; }
  .navigation a { justify-content: center; text-align: center; }
  .nav-arrow { display: none; }
  .main { padding-bottom: 2rem; }
  .page-title { padding-bottom: 1.2rem; }
}
@media (max-width: 440px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .header-name { font-size: .85rem; }
  .navigation a { padding: .4rem; font-size: .82rem; }
  .item { flex-wrap: wrap; }
  .avatar-row { gap: .65rem; }
  .avatar { width: 60px; height: 60px; }
}
