:root {
  color-scheme: light dark;
  --surface: #fff;
  --soft: #f3f4f6;
  --accent: #287490;
  --stat: #4186a3;
  --forest: #153f32;
  --mint: #b8edc2;
  --ink: #19191c;
  --muted: #60616a;
  --line: #d6d7db;
  --paper: #fff;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.48 Montserrat,Arial,sans-serif;
}

h1,h2,h3,p {
  margin: 0;
}

h1,h2,h3 {
  font-family: Montserrat, -apple-system, sans-serif;
  line-height: 1.25;
}

h1 { font-size: 1.25rem; font-weight: 500; }
h2 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

a,button,input,select,textarea {
  font: inherit;
}

button {
  transition: background-color .15s,color .15s;
}

button:disabled {
  opacity: .55;
  cursor: wait;
}

[hidden] {
  display: none!important;
}

svg {
  width: 20px;
  height: 20px;
  flex: none;
}

button:focus-visible,a:focus-visible {
  outline: 3px solid #127552;
  outline-offset: 3px;
}

.skip {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  background: var(--surface);
  padding: .75rem;
}

.skip:not(:focus) {
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip:focus {
  top: 1rem;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 31px 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--forest);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1;
}

.brand {
  align-self: flex-start;
  margin: 0 12px;
}

.brand img {
  background: var(--forest);
  border-radius: 10px;
  width: 35px;
  height: 35px;
  padding: 2px;
}

.side-nav {
  margin-top: 52px;
  display: grid;
  gap: 5px;
}

.side-nav button {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 13px;
  min-height: 46px;
  border-radius: 9px;
  padding: 9px 13px;
  font-weight: 550;
  font-size: .92rem;
}

.side-nav button:hover,.square:hover {
  background: #f0f5ef;
}

.side-nav button[aria-current] {
  background: #e1efdf;
  color: #204931;
  font-weight: 670;
}

.side-nav hr {
  width: calc(100% - 22px);
  border: 0;
  border-top: 1px solid var(--line);
  margin: 13px auto;
}

.support {
  margin: auto 12px 0;
  font-size: .875rem;
  color: var(--muted);
  padding: 10px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.workspace {
  margin-left: 232px;
}

.topbar {
  height: 72px;
  display: grid;
  grid-template-columns: 1fr minmax(0, auto) 1fr;
  gap: 8px;
  padding: 0 clamp(16px, 4vw, 56px);
  background:
    radial-gradient(ellipse at 15% -40%, #8cd9a6a6, transparent 57%),
    radial-gradient(ellipse at 51% -70%, #fa995978, transparent 59%),
    radial-gradient(ellipse at 87% -48%, #7acceb99, transparent 61%);
}
.topbar h1 {
  grid-column: 2;
  text-align: center;
  overflow-wrap: anywhere;
}
#account-button { grid-column: 3; justify-self: end; }

.btn,.square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 650;
  font-size: .9rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 19px;
}

.btn.primary {
  background: var(--forest);
  color: white;
}

.btn.primary:hover {
  background: #265e49;
}

.btn.outline {
  background: var(--surface);
  border-color: #cbd7cd;
}

.btn.outline:hover {
  background: #edf3ec;
}

.square {
  width: 44px;
  border-radius: 50%;
}

#menu-toggle {
  display: none;
}

main {
  max-width: 800px;
  margin: auto;
  padding: 28px clamp(18px, 4vw, 48px) 60px;
}
.profile-overview {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
}
.profile-avatar {
  width: 100px;
  height: 100px;
  flex: none;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  display: grid;
  place-items: center;
  overflow: hidden;
  font: 500 1.8rem -apple-system, sans-serif;
}
.profile-avatar svg { width: 36px; height: 36px; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-stats {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
  margin: 0;
  text-align: center;
}
.profile-stats div {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}
.profile-stats dd {
  margin: 0;
  font: 400 clamp(1.5rem, 6vw, 1.9rem)/1.2 -apple-system, sans-serif;
  color: var(--stat);
}
.profile-stats dt { font-size: .8rem; color: var(--muted); font-weight: 600; }
.profile-about { padding: 18px 0; border-bottom: 1px solid var(--line); }
#profile-meta { color: var(--muted); font-size: .9rem; }
#profile-bio { margin-top: 6px; white-space: pre-line; }
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.buttons .btn {
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 50px;
  box-shadow: 0 2px 8px #192d4310;
}
.buttons .btn:hover { background: var(--soft); }
.section-heading,.sheet-head,.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-heading { margin-bottom: 15px; }
#schedule { margin-top: 28px; scroll-margin: 16px; }
.profile-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.profile-tabs button {
  color: var(--muted);
  border-bottom: 2px solid transparent;
  padding: 12px;
  font-size: 1rem;
  font-weight: 550;
}
.profile-tabs button[aria-selected=true] { color: var(--ink); border-color: currentColor; font-weight: 650; }
.event-group { margin: 22px 0 10px; font-size: 1.02rem; }
.empty { text-align: center; padding: 32px 8px; }
.empty strong { display: block; margin-bottom: 5px; }
.empty p,.hint { color: var(--muted); font-size: .9rem; }

.text-btn {
  min-height: 40px;
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  font-size: .875rem;
}

.payout-row,.agenda-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.agenda-item {
  background: linear-gradient(var(--surface),var(--surface)) padding-box,
    linear-gradient(110deg,#8cd9a6,#e8bf9f,#7acceb) border-box;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 13px;
  margin-bottom: 10px;
}
.agenda-item:hover { box-shadow: 0 2px 10px #668b9826; }
.date-tile {
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--soft);
  min-width: 47px;
  padding: 4px 6px;
  color: var(--accent);
  font-size: .75rem;
  text-transform: uppercase;
}

.date-tile b {
  font: 600 1.45rem Montserrat,sans-serif;
  line-height: 1.1;
}

.agenda-copy {
  min-width: 0;
}

.agenda-copy strong,.agenda-copy small {
  display: block;
}

.agenda-copy small,.payout-row small {
  color: var(--muted);
  font-size: .82rem;
}

.role {
  color: var(--muted);
  font-size: .78rem;
  margin-left: auto;
}

#drawer {
  position: fixed;
  inset: 0 auto 0 0;
  margin: 0;
  width: min(85vw,310px);
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  padding: 24px 16px;
  background: var(--surface);
  color: var(--ink);
}

#drawer[open] {
  display: flex;
  flex-direction: column;
}

.drawer-head .brand {
  margin: auto 0;
}

.drawer-head .square {
  margin-left: auto;
}

#drawer .side-nav {
  margin-top: 27px;
}

.sheet,.auth-dialog {
  color: var(--ink);
  background: var(--surface);
  border-radius: 20px;
}

.sheet {
  width: min(530px,calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 24px;
}

.sheet-head {
  margin-bottom: 18px;
}

.sheet h2 {
  font-size: 1.7rem;
}

.sheet form,.sheet [id$="-panel"]:not([hidden]),#confirmation:not([hidden]) {
  display: grid;
  gap: 14px;
}

.sheet label {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: .88rem;
  font-weight: 600;
}

.sheet input,.sheet textarea,.sheet select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #bbcabe;
  background: var(--surface);
  border-radius: 9px;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.sheet textarea {
  resize: vertical;
}

.sheet .pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sheet .btn {
  justify-self: start;
}

.sheet input[type=datetime-local] {
  font-size: .9rem;
}

#action-status:not(:empty),#page-status:not(:empty) {
  margin-top: 14px;
  color: #713619;
  font-size: .92rem;
}

.payout-row {
  justify-content: space-between;
}

.payout-row small {
  display: block;
}

@media(max-width:1020px) {
  .sidebar { width: 198px; padding-inline: 12px; }
  .workspace { margin-left: 198px; }
}
@media(max-width:780px) {
  .sidebar { display: none; }
  .workspace { margin: 0; }
  .topbar { height: 60px; padding: 0 12px; }
  #menu-toggle { display: flex; justify-self: start; }
  .topbar .btn { padding: 6px 12px; font-size: .85rem; }
  main { padding: 14px 16px 40px; }
}
@media(max-width:440px) {
  .profile-avatar { width: clamp(70px, 23vw, 100px); height: auto; aspect-ratio: 1; }
  .profile-overview { gap: 12px; }
  .profile-stats { gap: 5px; }
  .profile-stats dt { font-size: .75rem; }
  .buttons .btn { padding: 8px; }
  .sheet { padding: 20px; }
  .sheet .pair { grid-template-columns: 1fr; }
}
@media(prefers-color-scheme:dark) {
  :root { --paper: #0b0d0c; --surface: #1b1d1e; --soft: #292c2d; --ink: #f5f5f6; --muted: #b7b9bf; --line: #404347; --accent: #8cd9a6; --stat: #8cd9a6; --forest: #98d7ac; }
  .btn.primary { color: #11241c; }
  .btn.primary:hover { background: #b1e8c3; }
  .buttons .btn { color: var(--accent); }
  .btn.outline:hover,.side-nav button:hover,.square:hover { background: var(--soft); }
  #action-status:not(:empty),#page-status:not(:empty) { color: #f8c7ab; }
}

#connect-screen {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(16px,3vw,34px);
}

#connect-screen .section-heading {
  flex-wrap: wrap;
}

#connect-mount {
  min-height: 160px;
}
