:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f9fbfd;
  --line: #dce4ee;
  --line-strong: #b9c7d8;
  --text: #152235;
  --muted: #536277;
  --subtle: #6f7e92;
  --blue: #2563eb;
  --blue-soft: #e5efff;
  --red: #dc4b62;
  --green: #14805e;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 75% -20%, #dceaff 0, transparent 34rem), var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.shell { width: min(100% - 2rem, 72rem); margin: 0 auto; }
.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4.75rem; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: #152235; text-decoration: none; font-weight: 850; letter-spacing: -.03em; }
.brand-mark {
  display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: .55rem;
  color: #fff; background: linear-gradient(145deg, #3777ec, #2454c3); box-shadow: 0 8px 20px #1f5ec733;
}
.header-actions { display: flex; align-items: center; gap: .45rem; }
.page-main { padding: 2.1rem 0 4rem; }
.eyebrow { margin: 0; color: #2563eb; font-size: .66rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: .35rem 0 0; font-size: clamp(1.55rem, 4vw, 2.2rem); letter-spacing: -.045em; }
h2 { margin: 0; font-size: 1rem; letter-spacing: -.025em; }
.lead { max-width: 42rem; margin: .7rem 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.stack { display: grid; gap: 1rem; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.panel, .metric {
  min-width: 0; padding: 1.15rem; border: 1px solid var(--line); border-radius: .75rem;
  background: linear-gradient(140deg, #fff, var(--panel));
}
.metric { position: relative; overflow: hidden; }
.metric::after { position: absolute; top: -2rem; right: -1rem; width: 5rem; height: 5rem; border-radius: 50%; background: var(--blue); content: ""; opacity: .12; }
.metric p { margin: 0; color: var(--muted); font-size: .75rem; }
.metric strong { display: block; position: relative; margin-top: .55rem; font-size: 1.5rem; letter-spacing: -.045em; }
.metric small { display: block; margin-top: .38rem; color: #356ab9; font-size: .68rem; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading p { margin: .25rem 0 0; color: var(--subtle); font-size: .72rem; }
.button, .button-secondary, .button-danger, .text-button {
  display: inline-flex; min-height: 2.35rem; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .75rem; border: 1px solid transparent; border-radius: .5rem; text-decoration: none; font-size: .75rem; font-weight: 800;
}
.button { color: white; background: #2563eb; box-shadow: 0 8px 18px #2563eb29; }
.button:hover { background: #1d4ed8; }
.button-secondary { color: #284362; border-color: #c4d1df; background: #fff; }
.button-secondary:hover { border-color: #8ca6c1; background: #f0f5fb; }
.button-danger { color: #a62d42; border-color: #f2bec8; background: #fff4f5; }
.text-button { min-height: 2rem; padding: .25rem .4rem; color: #2563eb; background: transparent; }
.text-button:hover { color: #174bb5; background: #eaf2ff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: .38rem; color: #43546a; font-size: .72rem; font-weight: 750; }
input, textarea {
  width: 100%; min-height: 2.45rem; padding: .55rem .65rem; border: 1px solid var(--line-strong); border-radius: .5rem;
  outline: none; color: var(--text); background: #fff; font-size: .82rem;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, textarea:focus { border-color: #69a5f5; box-shadow: 0 0 0 .18rem #4f8ff52e; }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.hint { margin: .5rem 0 0; color: var(--subtle); font-size: .7rem; line-height: 1.45; }
.alert { margin: 0 0 1rem; padding: .75rem .9rem; border: 1px solid #efb6c1; border-radius: .55rem; color: #9d283b; background: #fff3f5; font-size: .78rem; }
.list { display: grid; }
.list-row {
  display: flex; align-items: center; gap: .8rem; min-width: 0; padding: .85rem 0; border-top: 1px solid var(--line);
}
.list-row:first-child { padding-top: 0; border-top: 0; }
.list-icon {
  display: grid; width: 2.1rem; height: 2.1rem; flex: 0 0 2.1rem; place-items: center; border-radius: .5rem;
  color: #2563eb; background: #e6efff; font-size: .8rem; font-weight: 850;
}
.list-main { min-width: 0; flex: 1; }
.list-main strong, .list-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main strong { color: #1b2b3e; font-size: .8rem; }
.list-main small { margin-top: .2rem; color: #6d7d90; font-size: .7rem; }
.row-actions { display: flex; flex: 0 0 auto; align-items: center; gap: .2rem; }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .45rem; border: 1px solid #bed1e7; border-radius: 999px; color: #31639b; background: #eff6ff; font-size: .62rem; font-weight: 800; }
.pill.off { color: #a63c4e; border-color: #efbbc5; background: #fff1f3; }
.empty { margin: 0; padding: 1.2rem 0 .25rem; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.share-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2563eb; text-decoration: none; }
.login-shell { display: grid; width: min(100% - 2rem, 27rem); min-height: 100vh; place-items: center; margin: 0 auto; }
.login-card { width: 100%; padding: 1.4rem; border: 1px solid var(--line); border-radius: .85rem; background: #fff; box-shadow: 0 28px 90px #1c36501a; }

.bio-wrap { display: grid; min-height: 100vh; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 50% -10%, #e7f0ff, transparent 32rem), #f8fafc; }
.bio-page { width: min(100%, 35rem); text-align: center; }
.bio-avatar {
  display: grid; width: 4.6rem; height: 4.6rem; place-items: center; margin: 0 auto 1rem; border: 1px solid #ffffff22;
  border-radius: 1.35rem; color: #fff; background: var(--accent); box-shadow: 0 16px 42px #23415a22; font-size: 1.55rem; font-weight: 900;
}
.bio-page h1 { font-size: clamp(1.45rem, 6vw, 2rem); }
.bio-copy { max-width: 29rem; margin: .65rem auto 1.35rem; color: #58677a; font-size: .9rem; line-height: 1.55; white-space: pre-line; }
.bio-links { display: grid; gap: .7rem; }
.bio-link {
  display: flex; min-height: 3.65rem; align-items: center; justify-content: center; padding: .8rem 1rem; border: 1px solid #ffffff1c;
  border-radius: .75rem; color: #172639; border-color: #d7e1ec; background: #fff; box-shadow: 0 9px 30px #23415a12; text-decoration: none; font-size: .88rem; font-weight: 800;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.bio-link:hover, .bio-link:focus-visible { border-color: var(--accent); background: #f8fbff; transform: translateY(-2px); outline: none; }
.bio-footer { margin: 1.6rem 0 0; color: #718194; font-size: .67rem; }
.not-found { text-align: center; }

@media (max-width: 640px) {
  .shell { width: min(100% - 1.3rem, 72rem); }
  .page-main { padding-top: 1.35rem; }
  .top-row, .panel-heading { align-items: stretch; flex-direction: column; }
  .grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .top-row .button { width: 100%; }
  .list-row { align-items: flex-start; }
  .row-actions { flex-wrap: wrap; justify-content: flex-end; }
}
