@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --brand: #360048;
  --brand-soft: #7a3a8f;
  --pink: #ff65a3;
  --soft: #f0c7ff;
  --surface: rgba(18, 11, 22, 0.93);
  --surface-raised: rgba(31, 20, 37, 0.96);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --muted: rgba(255, 255, 255, 0.68);
  --radius: 22px;
  --shadow: 0 28px 85px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; overflow-x: hidden; color: #fff; background: #050406; font-family: "Open Sans", Helvetica, Arial, sans-serif; }
body::before { content: ""; position: fixed; inset: -20vh -20vw; z-index: -2; pointer-events: none; background: radial-gradient(circle at 12% 3%, rgba(122, 58, 143, .48), transparent 36rem), radial-gradient(circle at 92% 22%, rgba(255, 101, 163, .24), transparent 34rem), radial-gradient(circle at 48% 92%, rgba(54, 0, 72, .42), transparent 45rem); filter: blur(8px); }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .1; background-image: linear-gradient(rgba(255,255,255,.11) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.11) 1px, transparent 1px); background-size: 74px 74px; }
a { color: var(--soft); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(255, 101, 163, .65); outline-offset: 3px; }
[hidden] { display: none !important; }

.account-shell { position: relative; display: grid; width: min(calc(100% - 2rem), 1180px); min-height: 100vh; margin: auto; padding: clamp(1rem, 3vw, 2.4rem) 0 2.5rem; align-content: start; }
.account-topbar { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: clamp(1.2rem, 3vw, 2rem); }
.account-brand { display: inline-flex; width: fit-content; align-items: center; gap: .72rem; color: #fff; text-decoration: none; text-transform: uppercase; }
.account-brand img { width: 43px; height: 43px; }
.account-brand span { display: grid; line-height: 1.08; }
.account-brand strong { letter-spacing: .15rem; font-size: .78rem; }
.account-brand small { margin-top: .15rem; color: var(--muted); letter-spacing: .19rem; font-size: .58rem; }
.account-top-actions { display: flex; align-items: center; gap: .45rem; }
.account-top-actions a, .account-top-actions button { min-height: 44px; padding: .65rem .85rem; border: 1px solid transparent; border-radius: 11px; color: var(--muted); background: transparent; font-size: .75rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.account-top-actions :is(a, button):hover { border-color: var(--line); color: #fff; background: var(--surface-soft); }

.account-card, .dashboard-hero, .dashboard-section, .activity-panel, .profile-editor-panel { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.account-card { padding: clamp(1.4rem, 5vw, 2.5rem); border-radius: 26px; }
.account-auth-card { width: min(100%, 610px); margin: auto; }
.account-eyebrow { margin: 0 0 .58rem; color: var(--pink); font-size: .69rem; font-weight: 800; letter-spacing: .16rem; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2.15rem, 7vw, 4rem); line-height: .98; }
h2 { margin: 0; font-size: clamp(1.45rem, 4vw, 2.15rem); line-height: 1.08; }
h3 { margin: 0; }
.account-intro { color: var(--muted); line-height: 1.65; }
.account-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin: 2rem 0 1.2rem; padding: .35rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.account-tabs button { min-height: 45px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-weight: 800; cursor: pointer; }
.account-tabs button[aria-selected="true"] { color: #17091d; background: linear-gradient(135deg, var(--soft), var(--pink)); }
.account-form { display: grid; gap: .55rem; }
.account-form label:not(.account-check) { margin-top: .65rem; font-size: .78rem; font-weight: 800; }
.account-form input:not([type="checkbox"]), .account-form textarea { width: 100%; min-height: 49px; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 11px; color: #fff; background: rgba(255,255,255,.07); outline: none; }
.account-form textarea { min-height: 120px; resize: vertical; }
.account-form input[type="file"] { padding: .66rem; color: var(--muted); }
.account-form input[type="file"]::file-selector-button { margin-right: .75rem; padding: .55rem .7rem; border: 0; border-radius: 8px; color: #17091d; background: var(--soft); font-weight: 800; cursor: pointer; }
.account-form input:focus, .account-form textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255,101,163,.13); }
.account-check { display: flex; gap: .65rem; align-items: flex-start; margin: 1rem 0 .2rem; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.account-check input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--pink); }
.account-primary, .account-secondary { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: .75rem 1rem; border: 1px solid transparent; border-radius: 11px; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; }
.account-primary { margin-top: .8rem; color: #17091d; background: linear-gradient(135deg, var(--soft), var(--pink)); }
.account-secondary { color: #fff; border-color: var(--line); background: var(--surface-soft); }
.compact { min-height: 44px; margin: 0; padding: .62rem .82rem; font-size: .72rem; }
.account-link-button { display: inline-flex; min-height: 44px; align-items: center; justify-self: start; padding: .35rem 0; border: 0; color: var(--soft); background: transparent; cursor: pointer; }
.account-status { min-height: 1.3rem; margin: .45rem 0 0; color: var(--muted); font-size: .78rem; }
.account-status.is-error { color: #ffb4bf; }
.account-status.is-success { color: #9fe2b3; }
.account-back { display: inline-flex; min-height: 44px; align-items: center; justify-self: center; margin-top: 1.2rem; color: var(--muted); font-size: .8rem; text-decoration: none; }

html.is-embedded-account,
html.is-embedded-account body { scrollbar-width: none; -ms-overflow-style: none; }
html.is-embedded-account::-webkit-scrollbar,
html.is-embedded-account body::-webkit-scrollbar { display: none; width: 0; height: 0; }
html.is-embedded-account body { min-height: 100vh; background: #070508; }
html.is-embedded-account body::before { opacity: .68; }
html.is-embedded-account body::after { opacity: .055; }
html.is-embedded-account .account-shell { width: 100%; min-height: 100vh; margin: 0; padding: clamp(.75rem, 2vw, 1.35rem); }
html.is-embedded-account .account-topbar,
html.is-embedded-account .account-back,
html.is-embedded-account #signed-out-view { display: none !important; }

.account-dashboard { display: grid; gap: 1rem; }
.dashboard-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.2rem, 4vw, 2.5rem); align-items: center; padding: clamp(1.4rem, 5vw, 3.2rem); overflow: hidden; border-radius: 28px; background: radial-gradient(circle at 4% 0, rgba(255,101,163,.24), transparent 30rem), radial-gradient(circle at 100% 100%, rgba(122,58,143,.27), transparent 34rem), var(--surface); }
.dashboard-hero-copy { min-width: 0; }
.dashboard-hero-copy h1 { max-width: 900px; font-size: clamp(2.15rem, 5.6vw, 4.7rem); }
.dashboard-hero-copy > p:last-child { max-width: 720px; margin: 1rem 0 0; color: var(--muted); font-size: clamp(.86rem, 1.4vw, 1rem); line-height: 1.65; }
.hero-avatar { --avatar-size: clamp(94px, 13vw, 142px); position: relative; display: grid; flex: 0 0 auto; width: var(--avatar-size); min-width: var(--avatar-size); height: var(--avatar-size); min-height: var(--avatar-size); place-items: center; align-self: center; padding: 0; overflow: visible; border: 2px solid rgba(255,101,163,.64); border-radius: 50%; color: #17091d; background: linear-gradient(145deg, #fff 0%, #ffd6e6 42%, var(--soft) 72%, var(--pink) 100%); box-shadow: 0 18px 50px rgba(255,101,163,.2), inset 0 1px 0 rgba(255,255,255,.8); font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 800; cursor: pointer; }
.hero-avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-edit { position: absolute; right: -.1rem; bottom: .3rem; display: grid; width: 34px; height: 34px; place-items: center; border: 2px solid #150919; border-radius: 50%; color: #18091e; background: var(--pink); font-size: .78rem; }

.verification-box { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.15rem 1.25rem; border: 1px solid rgba(255,200,112,.3); border-radius: 18px; background: rgba(255,200,112,.08); }
.verification-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; color: #21120a; background: #ffd592; }
.verification-box p { margin: .3rem 0 .85rem; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.account-inline-actions { display: flex; flex-wrap: wrap; gap: .65rem; }

.dashboard-section, .activity-panel, .profile-editor-panel { padding: clamp(1.2rem, 3vw, 2rem); border-radius: var(--radius); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.section-heading > p { margin: 0; color: var(--muted); font-size: .72rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.dashboard-tile { position: relative; display: grid; min-width: 0; min-height: 166px; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: .8rem; align-items: start; padding: 1.15rem; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; color: #fff; background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.035)); box-shadow: 0 12px 35px rgba(0,0,0,.16); text-align: left; text-decoration: none; cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.dashboard-tile::before { content: ""; position: absolute; inset: auto -35% -70% 30%; height: 135%; border-radius: 50%; background: radial-gradient(circle, rgba(255,101,163,.13), transparent 62%); pointer-events: none; }
.dashboard-tile:hover { color: #fff; border-color: rgba(255,101,163,.42); background: linear-gradient(145deg, rgba(122,58,143,.2), rgba(255,101,163,.08)); box-shadow: 0 18px 44px rgba(0,0,0,.25), 0 0 28px rgba(122,58,143,.1); transform: translateY(-3px); }
.tile-icon { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: rgba(255,255,255,.08); font-size: 1.35rem; }
.tile-copy { display: grid; grid-column: 1 / -1; align-self: end; min-width: 0; gap: .25rem; }
.tile-copy strong { font-size: .98rem; }
.tile-copy small { color: var(--muted); font-size: .72rem; line-height: 1.4; }
.tile-badge { position: absolute; top: .78rem; left: 3.85rem; display: grid; min-width: 25px; height: 25px; place-items: center; padding: 0 .35rem; border: 2px solid #160b1a; border-radius: 999px; color: #1a0a20; background: var(--pink); box-shadow: 0 0 0 0 rgba(255,101,163,.45); font-size: .68rem; font-weight: 800; animation: badge-pulse 2.8s ease-in-out infinite; }
.tile-admin { border-color: rgba(255,101,163,.28); background: linear-gradient(145deg, rgba(122,58,143,.23), rgba(255,101,163,.08)); }
.dashboard-tile.is-locked { opacity: .66; }
@keyframes badge-pulse { 0%, 65%, 100% { box-shadow: 0 0 0 0 rgba(255,101,163,0); } 78% { box-shadow: 0 0 0 7px rgba(255,101,163,.13); } }

.activity-panel { scroll-margin-top: 1rem; }
.activity-heading a { display: inline-flex; min-height: 44px; align-items: center; color: var(--soft); font-size: .73rem; font-weight: 800; text-decoration: none; }
.activity-list { display: grid; gap: .55rem; }
.activity-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: .85rem; align-items: center; min-height: 72px; padding: .72rem .8rem; border: 1px solid var(--line); border-radius: 15px; color: #fff; background: var(--surface-soft); text-decoration: none; transition: border-color .18s ease, background .18s ease; }
.activity-item:hover { color: #fff; border-color: rgba(255,101,163,.34); background: rgba(255,255,255,.085); }
.activity-avatar { display: grid; width: 48px; height: 48px; place-items: center; overflow: hidden; border: 1px solid rgba(255,101,163,.34); border-radius: 50%; color: #1a0a20; background: linear-gradient(135deg, #fff, #ffd5e6 54%, var(--soft)); font-size: .72rem; font-weight: 800; }
.activity-avatar.is-icon { border-radius: 14px; font-size: 1.2rem; }
.activity-avatar img { width: 100%; height: 100%; object-fit: cover; }
.activity-copy { display: grid; min-width: 0; gap: .15rem; }
.activity-copy strong, .activity-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy strong { font-size: .82rem; }
.activity-copy span { color: var(--muted); font-size: .72rem; }
.activity-meta { display: grid; justify-items: end; gap: .25rem; }
.activity-meta time { color: var(--muted); font-size: .65rem; white-space: nowrap; }
.activity-chevron { color: var(--soft); }
.friend-response-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .35rem; }
.friend-response-actions button { min-height: 44px; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 9px; color: #fff; background: rgba(255,255,255,.07); font-size: .67rem; font-weight: 800; cursor: pointer; }
.friend-response-actions .accept { border-color: transparent; color: #1a0a20; background: linear-gradient(135deg, var(--soft), var(--pink)); }
.activity-empty { display: grid; min-height: 160px; place-items: center; justify-items: center; padding: 1.5rem; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; }
.activity-empty span { display: block; margin-bottom: .55rem; font-size: 1.65rem; }
.activity-empty strong { display: block; margin-bottom: .25rem; color: #fff; }
.activity-loading { display: grid; gap: .55rem; }
.activity-loading span { display: block; height: 72px; border-radius: 15px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.profile-editor-panel { scroll-margin-top: 1rem; }
.panel-close { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #fff; background: var(--surface-soft); font-size: 1.45rem; cursor: pointer; }
.profile-editor-layout { display: grid; grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr); gap: 1rem; }
.profile-editor-intro, .account-profile-form { padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: 17px; background: var(--surface-soft); }
.profile-editor-intro h3 { margin: 1rem 0 .45rem; font-size: clamp(1.2rem, 3vw, 1.7rem); }
.profile-editor-intro p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.profile-avatar-preview { display: grid; width: 86px; height: 86px; place-items: center; overflow: hidden; border: 2px solid rgba(255,101,163,.56); border-radius: 50%; color: #17091d; background: linear-gradient(145deg, #fff, #ffd6e6, var(--pink)); font-size: 1.2rem; font-weight: 800; }
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.optional-label { color: var(--muted); font-size: .68rem; font-weight: 600; }
.dashboard-status { margin: 0; padding: 0 .2rem; }
.dashboard-status:empty { display: none; }
button:disabled { opacity: .55; cursor: wait; }

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-editor-layout { grid-template-columns: 1fr; }
  .profile-editor-intro { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center; }
  .profile-editor-intro h3 { margin-top: 0; }
  .profile-editor-intro p { grid-column: 1 / -1; margin-top: .8rem; }
}
@media (max-width: 620px) {
  .account-shell { width: min(calc(100% - 1rem), 1180px); }
  .account-top-actions a { display: none; }
  .dashboard-hero { align-items: start; grid-template-columns: 78px minmax(0, 1fr); border-radius: 22px; }
  .hero-avatar { --avatar-size: 78px; }
  .avatar-edit { width: 29px; height: 29px; }
  .dashboard-hero-copy h1 { font-size: clamp(1.85rem, 8vw, 2.7rem); }
  .dashboard-section, .activity-panel, .profile-editor-panel { padding: 1rem; border-radius: 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .activity-heading { flex-direction: row; }
  .dashboard-tile { min-height: 150px; padding: 1rem; }
  .activity-item { grid-template-columns: 44px minmax(0, 1fr); }
  .activity-avatar { width: 44px; height: 44px; }
  .activity-meta { grid-column: 2; justify-items: start; }
  .friend-response-actions { justify-content: start; }
}
@media (max-width: 430px) {
  .account-card { border-radius: 20px; }
  .account-brand img { width: 38px; height: 38px; }
  .account-brand strong { font-size: .7rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-tile { min-height: 132px; }
  .verification-box { grid-template-columns: 1fr; }
  .account-inline-actions { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.profile-visibility-setting { min-width: 0; margin: 0.5rem 0; padding: 1rem; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; }
.profile-visibility-setting legend { padding: 0 0.35rem; font-weight: 700; }
.account-form .profile-visibility-setting label { display: flex; align-items: flex-start; gap: 0.75rem; }
.account-form .profile-visibility-setting input[type="checkbox"] { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; margin-top: 0.2rem; accent-color: #ff65a3; }
.profile-visibility-setting p { margin: 0.75rem 0 0; opacity: .75; font-size: .85rem; line-height: 1.6; }
