
:root {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a1420;
  background: #f6f3f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --purple: #8224f2;
  --purple-dark: #5f16b7;
  --ink: #17131a;
  --cream: #fae9dc;
  --muted: #77717e;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid #f7d244; outline-offset: 3px; }
::selection { color: #fff; background: #6d1bd0; }

.public-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  padding: 20px 24px 25px;
  color: #fff;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(213, 55, 255, .68) 0%, rgba(177, 47, 255, .42) 37%, transparent 72%),
    linear-gradient(158deg, #894bf2 0%, #a035f0 45%, #ce28df 100%);
}
.public-page::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.07), transparent 32%, rgba(61, 0, 132, .08));
  content: "";
}
.page-glow { position: absolute; z-index: -1; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.page-glow-one { width: 340px; height: 340px; top: 160px; left: -220px; background: rgba(198, 105, 255, .25); }
.page-glow-two { width: 320px; height: 320px; top: 570px; right: -220px; background: rgba(219, 43, 231, .22); }
.public-topbar { max-width: 980px; height: 40px; margin: 0 auto; display: flex; align-items: center; justify-content: flex-end; }
.tiny-brand, .admin-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.brand-spark { font-size: 22px; line-height: 1; }
.admin-entry { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 8px 13px; color: rgba(255,255,255,.92); text-decoration: none; font-size: 12px; font-weight: 600; background: rgba(65, 13, 128, .18); transition: background .2s ease, transform .2s ease; }
.admin-entry:hover { transform: translateY(-1px); background: rgba(65, 13, 128, .32); }
.admin-dot, .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #d3ffb1; box-shadow: 0 0 0 3px rgba(211,255,177,.14); }
.profile-hero { position: relative; display: flex; flex-direction: column; align-items: center; padding: 62px 16px 35px; text-align: center; }
.avatar-frame { width: 132px; height: 132px; padding: 6px; border-radius: 50%; background: rgba(81, 24, 177, .37); box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 16px 50px rgba(65, 10, 118, .2); }
.avatar-image, .avatar-fallback { width: 100%; height: 100%; border-radius: 50%; }
.avatar-image { display: block; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #6b24c5, #5120ad); font-family: "Space Grotesk", sans-serif; font-size: 48px; font-weight: 700; letter-spacing: -.06em; }
.profile-kicker { margin: 23px 0 6px; color: rgba(255,255,255,.7); font-size: 10px; font-weight: 700; letter-spacing: .25em; }
.profile-hero h1 { max-width: 100%; margin: 23px 0 0; font-family: "Space Grotesk", sans-serif; font-size: clamp(38px, 7vw, 62px); font-weight: 700; line-height: 1.05; letter-spacing: -.055em; overflow-wrap: anywhere; text-shadow: 0 2px 15px rgba(73, 0, 138, .1); }
.profile-tagline { margin: 10px 0 0; color: rgba(255,255,255,.78); font-size: 14px; letter-spacing: .01em; }
.social-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; }
.social-button { display: grid; width: 47px; height: 47px; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 15px; color: white; text-decoration: none; background: rgba(97, 27, 183, .2); transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.social-button:hover { transform: translateY(-3px) rotate(-2deg); border-color: rgba(255,255,255,.55); background: rgba(97,27,183,.38); }
.link-list { position: relative; width: min(100%, 690px); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.link-card { min-height: 86px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; gap: 8px; padding: 15px 20px; border: 2.5px solid #17131a; border-radius: 25px; color: #19151b; background: var(--cream); box-shadow: 6px 7px 0 #141116; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; animation: card-in .45s both; animation-delay: var(--delay, 0ms); }
.link-card:hover { transform: translate(-2px, -3px); box-shadow: 8px 10px 0 #141116; background: #fff0e4; }
.link-card:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #141116; }
.link-label { grid-column: 2; text-align: center; font-family: "Space Grotesk", sans-serif; font-size: clamp(17px, 2.8vw, 23px); font-weight: 600; letter-spacing: -.025em; overflow-wrap: anywhere; }
.link-arrow { grid-column: 3; display: grid; place-items: center; color: #746c75; transition: transform .2s ease, color .2s ease; }
.link-card:hover .link-arrow { transform: translate(2px, -2px); color: var(--purple-dark); }
.empty-links { margin: 0; padding: 22px; border: 1px dashed rgba(255,255,255,.55); border-radius: 20px; text-align: center; color: rgba(255,255,255,.86); }
.public-footer { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 35px auto 0; color: rgba(255,255,255,.65); font-size: 11px; letter-spacing: .04em; }
.public-footer a { color: rgba(255,255,255,.75); text-decoration: none; font-size: 15px; letter-spacing: .08em; }
.loading-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; color: #fff; background: linear-gradient(145deg, #894bf2, #c52be2); }
.load-error { width: min(100%, 460px); padding: 30px; border-radius: 24px; color: #231829; background: #fff7f1; box-shadow: 8px 8px 0 rgba(23,19,26,.85); }
.load-error h1 { margin: 12px 0; font-family: "Space Grotesk", sans-serif; font-size: 30px; }
.load-error p { color: #665e6c; line-height: 1.6; }

.admin-page { min-height: 100vh; color: #211d25; background: #f6f3f8; }
.admin-header { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1150px) / 2)); border-bottom: 1px solid #e8e3eb; background: rgba(255,255,255,.84); }
.admin-brand { color: #3a254e; text-decoration: none; }
.admin-brand .brand-spark { color: #8c36e8; }
.admin-user { display: flex; align-items: center; gap: 10px; color: #5e5864; font-size: 13px; }
.user-avatar { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: #8843db; font-weight: 700; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 10px; color: #6e6875; background: transparent; cursor: pointer; }
.icon-button:hover { color: #54259a; background: #f0e8f7; }
.admin-shell { width: min(100% - 44px, 1120px); margin: 0 auto; padding: 38px 0 70px; }
.admin-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: #746b7d; text-decoration: none; font-size: 13px; font-weight: 600; }
.back-link:hover { color: #7427c4; }
.eyebrow { margin: 16px 0 8px; color: #8b48cb; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.admin-heading-row h1, .auth-card h1 { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: clamp(29px, 4vw, 42px); line-height: 1.1; letter-spacing: -.045em; }
.admin-subtitle { margin: 8px 0 0; color: #756e7a; font-size: 14px; }
.primary-button, .secondary-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 13px; padding: 0 17px; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.primary-button { border: 1px solid #7022bd; color: #fff; background: #7828ca; box-shadow: 0 4px 10px rgba(111,37,180,.16); }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); background: #6620b2; box-shadow: 0 6px 14px rgba(111,37,180,.23); }
.primary-button:disabled { cursor: wait; opacity: .65; }
.secondary-button { border: 1px solid #e2dce7; color: #463c4d; background: #fff; }
.secondary-button:hover { background: #f8f3fb; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 24px; }
.editor-column { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.editor-card { padding: 23px; border: 1px solid #ebe6ef; border-radius: 19px; background: #fff; box-shadow: 0 5px 20px rgba(43,27,58,.035); }
.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 19px; }
.step-number { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 10px; color: #7a2ec2; background: #f3eafd; font-family: "Space Grotesk", sans-serif; font-size: 11px; font-weight: 700; }
.section-heading h2 { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 19px; letter-spacing: -.025em; }
.section-heading p { margin: 4px 0 0; color: #807987; font-size: 12px; }
.profile-edit-row { display: flex; align-items: center; gap: 16px; margin: 0 0 20px 43px; }
.edit-avatar { width: 78px; height: 78px; flex: 0 0 78px; display: grid; place-items: center; overflow: hidden; border: 4px solid #f0e5fc; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #8b41e9, #c52bdb); font-family: "Space Grotesk", sans-serif; font-size: 30px; font-weight: 700; }
.edit-avatar img, .mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.upload-label { min-height: 38px; cursor: pointer; }
.text-button { border: 0; padding: 8px; color: #95503e; background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; }
.field-help { flex-basis: 100%; color: #8c8591; font-size: 11px; }
.field-label { display: block; margin: 0 0 7px 43px; color: #514957; font-size: 12px; font-weight: 700; }
.text-input { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #e5dfe9; border-radius: 10px; padding: 9px 11px; outline: none; color: #29232f; background: #fff; font-size: 13px; transition: border-color .16s ease, box-shadow .16s ease; }
.text-input:focus { border-color: #a360dc; box-shadow: 0 0 0 3px rgba(150,79,211,.12); }
.text-input::placeholder { color: #aaa3ae; }
#display-name { width: calc(100% - 43px); margin-left: 43px; }
.demo-note { margin: -3px 0 17px 43px; border-left: 2px solid #dbb6f4; padding-left: 10px; color: #807987; font-size: 11px; line-height: 1.5; }
.link-editor-list, .social-editor-list { display: flex; flex-direction: column; gap: 11px; }
.link-editor-item { display: grid; grid-template-columns: 31px minmax(0, 1fr) 34px; align-items: start; gap: 9px; }
.item-index { padding-top: 12px; color: #a49ba9; font-family: "Space Grotesk", sans-serif; font-size: 10px; font-weight: 700; }
.link-fields { display: flex; flex-direction: column; gap: 7px; }
.url-input-wrap { position: relative; }
.url-input-wrap > svg { position: absolute; top: 13px; left: 11px; color: #9b91a0; }
.text-input.url-input { padding-left: 34px; }
.remove-button { display: grid; width: 34px; height: 38px; place-items: center; border: 1px solid transparent; border-radius: 9px; color: #9d919e; background: transparent; cursor: pointer; }
.remove-button:hover { border-color: #f2d7d7; color: #c74752; background: #fff5f4; }
.add-button { display: inline-flex; align-items: center; gap: 8px; margin: 15px 0 0 40px; border: 0; padding: 8px 0; color: #7629bf; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.add-button:hover { color: #4f1885; }
.social-editor-item { display: grid; grid-template-columns: 31px minmax(0, 1fr) 34px; align-items: start; gap: 9px; }
.social-editor-icon { display: grid; width: 30px; height: 30px; place-items: center; margin-top: 5px; border-radius: 9px; color: #7b31bf; background: #f5ecfc; }
.social-fields { display: grid; grid-template-columns: .75fr .75fr 1.5fr; gap: 7px; }
.platform-select { padding: 0 7px; }
.notice { display: flex; align-items: center; gap: 9px; border: 1px solid; border-radius: 12px; padding: 12px 14px; font-size: 12px; line-height: 1.5; }
.notice-success { border-color: #cde9d6; color: #21663c; background: #f0fbf3; }
.notice-error { border-color: #f0cccc; color: #913c3c; background: #fff5f3; }
.save-bottom { display: none; }
.preview-sticky { position: sticky; top: 22px; padding: 17px; border: 1px solid #ebe6ef; border-radius: 18px; background: #fff; box-shadow: 0 5px 20px rgba(43,27,58,.035); }
.preview-caption { display: flex; align-items: center; gap: 8px; color: #78717f; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.preview-caption .live-dot { width: 6px; height: 6px; background: #71c488; box-shadow: none; }
.mini-preview { margin-top: 13px; padding: 22px 13px; border-radius: 14px; text-align: center; color: #fff; background: linear-gradient(150deg, #8d49f1, #c02ce5); }
.mini-avatar { width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; margin: 0 auto 12px; border: 3px solid rgba(255,255,255,.28); border-radius: 50%; color: #fff; background: #6821bf; font-family: "Space Grotesk", sans-serif; font-size: 24px; font-weight: 700; }
.mini-preview h3 { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 20px; overflow-wrap: anywhere; }
.mini-socials { display: flex; justify-content: center; gap: 12px; margin: 12px 0 15px; }
.mini-socials span { display: grid; width: 24px; height: 24px; place-items: center; }
.mini-links { display: flex; flex-direction: column; gap: 8px; }
.mini-links > span { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #211926; border-radius: 11px; padding: 6px 9px; color: #241d25; background: #fae9dc; text-align: left; font-family: "Space Grotesk", sans-serif; font-size: 10px; font-weight: 600; }
.mini-arrow { flex: 0 0 13px; transform: rotate(45deg); color: #716977; }
.mini-preview small { display: block; margin-top: 9px; color: rgba(255,255,255,.78); font-size: 10px; }
.preview-hint { margin: 12px 4px 0; color: #8d8591; font-size: 10px; line-height: 1.5; text-align: center; }

.admin-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 20%, #f1e3fc 0, #f6f3f8 47%); }
.auth-card { width: min(100%, 430px); padding: 30px; border: 1px solid #ebe5f0; border-radius: 22px; background: #fff; box-shadow: 0 14px 44px rgba(50,27,67,.08); }
.auth-card .eyebrow { margin-top: 18px; }
.auth-card > p:not(.eyebrow) { color: #766f7d; font-size: 13px; line-height: 1.7; }
.auth-card code { border-radius: 5px; padding: 2px 4px; color: #6826a6; background: #f4ecfa; font-size: 11px; }
.admin-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(145deg, #8d42e7, #c339dc); font-size: 27px; }
.auth-button { width: 100%; margin-top: 11px; }
.fine-print { display: block; margin-top: 12px; color: #99919e; font-size: 10px; text-align: center; }
.centered { display: flex; justify-content: center; margin-top: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 850px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
  .editor-card { padding: 19px; }
  .social-fields { grid-template-columns: 1fr 1fr; }
  .social-url { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .public-page { padding: 14px 17px 22px; }
  .public-topbar { height: 37px; }
  .tiny-brand { font-size: 9px; }
  .admin-entry { padding: 7px 10px; font-size: 11px; }
  .profile-hero { padding: 48px 8px 28px; }
  .avatar-frame { width: 116px; height: 116px; }
  .profile-kicker { margin-top: 20px; font-size: 9px; }
  .profile-tagline { font-size: 13px; }
  .social-row { gap: 11px; margin-top: 21px; }
  .social-button { width: 44px; height: 44px; border-radius: 14px; }
  .link-list { gap: 15px; }
  .link-card { min-height: 77px; grid-template-columns: 22px minmax(0,1fr) 22px; padding: 13px 13px; border-radius: 22px; box-shadow: 5px 6px 0 #141116; }
  .link-card:hover { box-shadow: 7px 8px 0 #141116; }
  .link-arrow svg { width: 18px; height: 18px; }
  .public-footer { margin-top: 30px; }
  .admin-header { height: 60px; padding: 0 17px; }
  .admin-user { gap: 7px; }
  .user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .admin-shell { width: min(100% - 28px, 620px); padding: 25px 0 42px; }
  .admin-heading-row { align-items: flex-start; flex-direction: column; gap: 15px; margin-bottom: 20px; }
  .save-top { display: none; }
  .admin-layout { display: block; }
  .preview-column { display: none; }
  .editor-card { padding: 17px 14px; border-radius: 16px; }
  .profile-edit-row { margin-left: 0; }
  .field-label, #display-name { margin-left: 0; }
  #display-name { width: 100%; }
  .demo-note { margin-left: 0; }
  .link-editor-item { grid-template-columns: 24px minmax(0,1fr) 30px; gap: 6px; }
  .remove-button { width: 30px; }
  .add-button { margin-left: 29px; }
  .social-editor-item { grid-template-columns: 26px minmax(0,1fr) 30px; gap: 6px; }
  .social-editor-icon { width: 26px; height: 26px; }
  .social-fields { grid-template-columns: 1fr; }
  .social-url { grid-column: auto; }
  .save-bottom { display: inline-flex; width: 100%; margin: 2px 0 0; }
  .auth-card { padding: 25px 21px; }
}
.auth-form { display: grid; gap: 9px; margin-top: 21px; }
.auth-form .field-label { margin: 2px 0 0; }
.auth-form .text-input { margin-bottom: 5px; }
.login-error { margin: 4px 0 0; color: #ab1f3b !important; font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

[hidden], .notice[hidden] { display: none !important; }
