:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --text: #111827;
  --muted: #6b7280;
  --card: #ffffff;
  --line: #e5e7eb;
  --accent: #111827;
  --danger: #b91c1c;
  --success: #166534;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; }
.container { width: min(1120px, calc(100% - 32px)); margin: 32px auto; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; }
.brand { font-weight: 800; text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.topbar nav a:hover { color: var(--text); }
.userpill { background: #eef2ff; color: #3730a3; padding: 6px 10px; border-radius: 999px; font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: 0 16px 40px rgba(17,24,39,.07); margin-bottom: 20px; }
.auth { max-width: 460px; margin: 56px auto; }
h1, h2 { margin-top: 0; letter-spacing: -.03em; }
label { display: grid; gap: 7px; font-weight: 700; margin: 14px 0; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; font: inherit; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--accent); color: #fff; border-radius: 14px; padding: 11px 15px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
button.secondary, .button.secondary { background: #e5e7eb; color: #111827; }
button.danger, .button.danger { background: var(--danger); color: #fff; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 20px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.list { display: grid; gap: 10px; }
.row { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; }
.flash { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-weight: 700; }
.flash.success { background: #dcfce7; color: var(--success); }
.flash.error { background: #fee2e2; color: var(--danger); }
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px; vertical-align: middle; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
.tokenbox code { display: block; word-break: break-all; background: #111827; color: #fff; padding: 14px; border-radius: 14px; }
.hero { min-height: 65vh; display: grid; place-content: center; text-align: center; }
.hero h1 { font-size: clamp(42px, 7vw, 84px); margin: 0 0 10px; }
.public .container { width: 100%; margin: 0; }
.linktree { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: linear-gradient(135deg, #111827, #374151); background-size: cover; background-position: center; }
.linkcard { width: min(520px, 100%); background: rgba(255,255,255,.9); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.4); border-radius: 30px; padding: 30px; box-shadow: 0 22px 60px rgba(0,0,0,.25); text-align: center; }
.linkcard h1 { font-size: 40px; margin-bottom: 8px; }
.bio { color: var(--muted); white-space: pre-wrap; }
.links { display: grid; gap: 12px; margin: 24px 0; }
.linkbtn { text-align: left; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); padding: 14px; border-radius: 18px; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.linkbtn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(17,24,39,.12); }
.linkbtn img { width: 48px; height: 48px; object-fit: cover; border-radius: 14px; flex: 0 0 auto; }
.linkbtn strong, .linkbtn small { display: block; }
.linkbtn small { color: var(--muted); margin-top: 2px; }
footer { color: var(--muted); font-size: 13px; }
@media (max-width: 740px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .row { grid-template-columns: 1fr; }
  .toolbar { align-items: flex-start; flex-direction: column; }
}
