:root {
  color-scheme: light;
  --ink: #1d2735;
  --muted: #64748b;
  --surface: #fff;
  --canvas: #f5f7fb;
  --line: #e4e9f1;
  --brand: #6558d3;
  --brand-dark: #5145bb;
  --green: #16846a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: none; }

.site-header {
  align-items: center;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 clamp(20px, 5vw, 72px);
  position: relative;
  z-index: 2;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 18px;
  font-weight: 750;
  gap: 10px;
  letter-spacing: -.03em;
}

.brand:hover { color: var(--brand); }
.brand-mark { height: 42px; width: 42px; }
.main-nav { align-items: center; display: flex; gap: 28px; }
.main-nav > a { color: #465368; font-weight: 600; }
.main-nav > a:hover { color: var(--brand); }
.nav-cta { background: var(--brand); border-radius: 9px; color: #fff !important; padding: 9px 16px; }

.account-menu { position: relative; }
.account-menu summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 9px;
  list-style: none;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu-name { color: var(--ink); font-size: 14px; font-weight: 650; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-chevron {
  border-bottom: 1.5px solid #718096;
  border-right: 1.5px solid #718096;
  height: 7px;
  margin: -4px 2px 0 1px;
  transform: rotate(45deg);
  transition: transform .18s ease, margin .18s ease;
  width: 7px;
}
.account-menu[open] .menu-chevron { margin-top: 4px; transform: rotate(225deg); }
.avatar { background: #e9e7ff; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); height: 40px; object-fit: cover; width: 40px; }
.avatar-fallback { align-items: center; color: var(--brand-dark); display: inline-flex; font-size: 15px; font-weight: 750; justify-content: center; }
.dropdown-menu {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(30, 42, 65, .14);
  min-width: 180px;
  padding: 7px;
  position: absolute;
  right: 0;
  top: calc(100% + 13px);
}
.dropdown-menu a { border-radius: 8px; color: var(--ink); display: block; font-weight: 550; padding: 9px 11px; }
.dropdown-menu a:hover { background: #f3f2ff; color: var(--brand-dark); }

.page-shell { margin: 0 auto; max-width: 1080px; padding: 42px 24px 72px; }
.page-heading { margin: 0 0 28px; }
.page-heading h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -.04em; line-height: 1.15; margin: 0 0 9px; }
.page-heading p, .muted { color: var(--muted); margin: 0; }
.content-grid { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 18px rgba(29,39,53,.035); padding: 24px; }
.card h2, .card h3 { letter-spacing: -.025em; margin: 0 0 16px; }
.card h2 { font-size: 20px; }
.card h3 { font-size: 17px; }
.card p:last-child { margin-bottom: 0; }
.stack { display: grid; gap: 15px; }
.field label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  background: #fff;
  border: 1px solid #d5dce7;
  border-radius: 9px;
  color: var(--ink);
  display: block;
  font: inherit;
  min-height: 44px;
  padding: 9px 12px;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(101,88,211,.13); outline: none; }
.field input[disabled] { background: #f6f7fa; color: var(--muted); }
.field-help { color: var(--muted); display: block; font-size: 13px; margin-top: 5px; }
.actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.button, button.button {
  align-items: center;
  background: var(--brand);
  border: 0;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 650;
  justify-content: center;
  min-height: 43px;
  padding: 9px 16px;
}
.button:hover, button.button:hover { background: var(--brand-dark); color: #fff; }
.button.secondary { background: #eef0f6; color: #344055; }
.button.secondary:hover { background: #e2e6ef; }
.button.success { background: var(--green); }
.button.danger { background: #fff; border: 1px solid #e6b9b9; color: #aa3434; }
.button.danger:hover { background: #fff3f3; }
.invite-link-row { align-items: center; display: flex; gap: 12px; min-width: 0; }
.invite-link { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-copy-button { flex: 0 0 auto; }
.copy-feedback { color: var(--green); font-size: 13px; min-height: 1.4em; }
.draw-management-actions form { margin: 0; }
.alert { border: 1px solid transparent; border-radius: 10px; margin: 0 0 18px; padding: 12px 15px; }
.alert-error { background: #fff1f1; border-color: #f2d0d0; color: #913d3d; }
.alert-info { background: #f0f3ff; border-color: #dce3ff; color: #3d4c82; }
.alert-success { background: #effaf5; border-color: #ccebdc; color: #256c50; }
.list { display: grid; gap: 10px; }
.list-item { background: #fff; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); display: block; padding: 14px 16px; }
.list-item:hover { border-color: #bdb7ef; box-shadow: 0 4px 14px rgba(101,88,211,.08); }
.list-item strong { display: block; font-size: 15px; }
.list-item small { color: var(--muted); }
.provider-row { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; padding: 16px 0; }
.provider-row:first-of-type { border-top: 0; padding-top: 0; }
.provider-row:last-child { padding-bottom: 0; }
.provider-row p { margin: 3px 0 0; }
.status { color: var(--green); font-size: 13px; font-weight: 650; }
.auth-layout { align-items: start; display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr) minmax(320px, .75fr); margin: 0 auto; max-width: 1000px; padding: clamp(34px, 7vw, 80px) 24px; }
.auth-intro { padding-top: 14px; }
.auth-intro h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -.05em; line-height: 1.08; margin: 0 0 16px; }
.auth-intro p { color: var(--muted); font-size: 17px; max-width: 440px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 15px 40px rgba(29,39,53,.07); padding: 28px; }
.auth-card h2 { font-size: 22px; margin: 0 0 20px; }
.auth-separator { align-items: center; color: var(--muted); display: flex; gap: 12px; margin: 20px 0; }
.auth-separator::before, .auth-separator::after { background: var(--line); content: ""; flex: 1; height: 1px; }
.social-button { align-items: center; background: white; border: 1px solid #d5dce7; border-radius: 9px; color: #273244; display: flex; font-weight: 650; gap: 11px; justify-content: center; min-height: 46px; padding: 9px 14px; width: 100%; }
.social-button { cursor: pointer; font: inherit; font-weight: 650; }
.social-button:disabled { cursor: wait; opacity: .65; }
.social-button:hover { background: #f8f9fc; border-color: #b8c2d1; color: #182232; }
.social-button + .social-button { margin-top: 10px; }
.social-icon { align-items: center; display: inline-flex; font-size: 19px; font-weight: 750; height: 22px; justify-content: center; width: 22px; }
.google-icon { background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 25% 48%, #fbbc05 48% 68%, #ea4335 68% 82%, #4285f4 82%); background-clip: text; color: transparent; font-size: 22px; }
.facebook-icon { background: #1877f2; border-radius: 50%; color: #fff; font-family: Arial, sans-serif; font-size: 18px; padding-top: 2px; }
.auth-footnote { color: var(--muted); margin: 19px 0 0; text-align: center; }
.text-button { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.text-button:hover { color: var(--brand-dark); text-decoration: underline; }
.participant-list { list-style: none; margin: 0; padding: 0; }
.participant-list li { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; padding: 10px 0; }
.participant-list li:last-child { border-bottom: 0; }
.participant-remove { flex: 0 0 auto; min-height: 35px !important; padding: 5px 10px !important; }
.empty-state { color: var(--muted); padding: 20px 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 11px; text-align: left; }
th { color: var(--muted); font-size: 13px; }
.home-hero { background: radial-gradient(ellipse at 85% 20%, #e8e5ff 0, transparent 38%), linear-gradient(135deg, #fff 0%, #f6f5ff 100%); border: 1px solid var(--line); border-radius: 24px; margin: 48px auto; max-width: 1080px; padding: clamp(36px, 7vw, 76px); }
.hero-brand { align-items: center; color: var(--brand-dark); display: inline-flex; font-size: 14px; font-weight: 700; gap: 10px; margin-bottom: 22px; }
.hero-brand img { height: 42px; width: 42px; }
.home-hero h1 { font-size: clamp(36px, 6vw, 60px); letter-spacing: -.055em; line-height: 1.04; margin: 0 0 16px; max-width: 650px; }
.home-hero p { color: var(--muted); font-size: 18px; margin: 0; max-width: 580px; }
.site-footer { display: flex; flex-wrap: wrap; gap: 12px 22px; justify-content: center; padding: 26px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.legal-copy { max-width: 820px; }
.legal-copy section { margin-top: 30px; }
.legal-copy h2 { font-size: 20px; margin-bottom: 10px; }
.legal-copy p { line-height: 1.7; }
.delete-confirmation { display: flex; align-items: start; gap: 10px; margin-top: 18px; }

@media (max-width: 720px) {
  .site-header { min-height: 64px; padding: 0 17px; }
  .main-nav { gap: 15px; }
  .account-menu-name { display: none; }
  .page-shell { padding: 30px 17px 52px; }
  .content-grid, .auth-layout { grid-template-columns: 1fr; }
  .auth-layout { gap: 20px; padding-top: 34px; }
  .home-hero { border-radius: 17px; margin: 24px 17px; }
  .card { padding: 19px; }
}

@media (max-width: 480px) {
  .invite-link-row { flex-wrap: wrap; }
  .invite-link { flex-basis: 100%; }
  .invite-copy-button, .invite-share-button { flex: 1 1 0; }
}
