:root {
  --page: #f4f6f2;
  --surface: #ffffff;
  --surface-soft: #f9faf8;
  --ink: #28322e;
  --muted: #606d66;
  --line: #d7ded6;
  --green: #2e765f;
  --green-dark: #205d4a;
  --green-soft: #eaf4f0;
  --red: #a43b42;
  --red-soft: #fcecee;
  --shadow: 0 20px 58px rgba(35, 49, 41, 0.08);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  background: var(--page);
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--green-dark);
  outline-offset: 2px;
}

.account-header {
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(244, 246, 242, 0.92);
  border-bottom: 1px solid rgba(215, 222, 214, 0.86);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 7px max(24px, calc((100vw - 1180px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
}

.account-brand {
  align-items: center;
  display: inline-flex;
  font-size: 21px;
  gap: 10px;
  text-decoration: none;
}

.account-brand img { height: 50px; object-fit: contain; width: 50px; }
.account-brand span { align-items: baseline; display: flex; gap: 4px; }
.account-brand b { color: #27313d; font-weight: 900; }
.account-brand strong { color: #2f8030; font-weight: 900; }

.header-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 800;
  padding: 8px 13px;
  text-decoration: none;
}

.account-shell { margin: 0 auto; max-width: 1228px; padding: 36px 24px 60px; }

.account-loading,
.account-error {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  margin: 11vh auto 0;
  max-width: 620px;
  padding: 46px 34px;
  text-align: center;
}

.account-loading h1,
.account-error h1 { font-size: 28px; margin: 16px 0 7px; }
.account-loading p,
.account-error p { color: var(--muted); margin: 0; }

.loading-mark {
  animation: spin 0.8s linear infinite;
  border: 3px solid var(--line);
  border-radius: 50%;
  border-top-color: var(--green);
  height: 32px;
  width: 32px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.sign-in-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
  margin: 5vh auto 0;
  max-width: 960px;
  overflow: hidden;
}

.sign-in-copy { padding: clamp(34px, 6vw, 68px); }
.sign-in-copy h1 {
  font-size: clamp(38px, 5vw, 58px);
  letter-spacing: -0.045em;
  line-height: 1.01;
  margin: 0 0 18px;
  max-width: 620px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin: 0 0 9px;
  text-transform: uppercase;
}

.lead { color: var(--muted); font-size: 18px; line-height: 1.6; margin: 0 0 28px; }

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  text-decoration: none;
}

.button:disabled { cursor: wait; opacity: 0.62; }
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--green-dark); }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--green-dark); }
.button.secondary:hover:not(:disabled) { border-color: var(--green); }
.button.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.button.danger { background: var(--surface); border-color: #ecc8cc; color: var(--red); }
.button.danger:hover:not(:disabled) { background: var(--red-soft); }

.google-button { gap: 11px; min-width: 218px; }
.google-mark {
  background: #fff;
  border-radius: 50%;
  display: block;
  height: 23px;
  width: 23px;
}

.privacy-note { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 22px 0 0; max-width: 590px; }
.inline-status, .form-status {
  background: var(--green-soft);
  border-radius: 8px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 750;
  margin: 16px 0 0;
  padding: 10px 12px;
}

.inline-status.is-error,
.form-status.is-error { background: var(--red-soft); color: var(--red); }

.sign-in-benefits {
  align-content: center;
  background: linear-gradient(145deg, #e9f4ef, #f4f8f3 70%);
  border-left: 1px solid var(--line);
  display: grid;
  padding: 48px 42px;
}

.benefit-icon {
  align-items: center;
  background: var(--green);
  border-radius: 12px;
  color: #fff;
  display: flex;
  font-size: 21px;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.sign-in-benefits h2 { font-size: 25px; letter-spacing: -0.025em; margin: 20px 0 13px; }
.sign-in-benefits ul { color: var(--muted); display: grid; gap: 12px; line-height: 1.5; margin: 0; padding-left: 20px; }

.account-error { grid-template-columns: auto 1fr auto; justify-items: start; max-width: 820px; text-align: left; }
.account-error > span {
  align-items: center; background: var(--red-soft); border-radius: 50%; color: var(--red); display: flex;
  font-size: 20px; font-weight: 900; height: 44px; justify-content: center; width: 44px;
}
.account-error h1 { margin: 0 0 5px; }

.dashboard-intro {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.dashboard-intro h1 { font-size: clamp(32px, 4vw, 46px); letter-spacing: -0.035em; line-height: 1.08; margin: 0; }
.account-email { color: var(--muted); margin: 10px 0 0; }

.report-overview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(35, 49, 41, 0.045);
  margin-bottom: 18px;
  overflow: hidden;
}

.report-overview > header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 24px;
}

.report-overview h2 { font-size: 26px; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 6px; }
.report-overview header p:not(.eyebrow) { color: var(--muted); line-height: 1.5; margin: 0; }
.overview-loading, .overview-empty { color: var(--muted); padding: 36px 26px; text-align: center; }
.overview-empty strong { color: var(--ink); display: block; font-size: 19px; margin-bottom: 6px; }
.overview-empty p { margin: 0; }
.overview-empty .button { margin-top: 16px; }
.overview-empty.is-error { background: var(--red-soft); color: var(--red); }

.overview-metrics { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px 24px 0; }
.overview-metric {
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; display: grid; min-height: 104px; padding: 16px;
}
.overview-metric.accent { background: var(--green); border-color: var(--green); color: #fff; }
.overview-metric > span { color: var(--muted); font-size: 12px; font-weight: 850; }
.overview-metric.accent > span, .overview-metric.accent small { color: rgba(255, 255, 255, 0.88); }
.overview-metric strong { align-self: center; font-size: 30px; letter-spacing: -0.035em; }
.overview-metric small { color: var(--muted); font-size: 11px; }
.overview-columns { display: grid; gap: 14px; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); padding: 14px 24px 24px; }
.overview-section { border: 1px solid var(--line); border-radius: 12px; min-width: 0; padding: 17px; }
.section-heading { align-items: baseline; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 13px; }
.section-heading h3 { font-size: 18px; margin: 0; }
.section-heading span { color: var(--muted); font-size: 11px; text-align: right; }
.overview-projects, .overview-items { display: grid; gap: 11px; }
.overview-projects-empty { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.overview-project { display: grid; gap: 6px; }
.overview-project > div { display: flex; font-size: 12px; gap: 12px; justify-content: space-between; }
.overview-project > div span { color: var(--green-dark); font-weight: 850; }
.overview-project-track { background: #edf2ee; border-radius: 999px; display: block; height: 5px; overflow: hidden; }
.overview-project-track i { background: var(--green); border-radius: inherit; display: block; height: 100%; }
.overview-item { align-items: center; border-bottom: 1px solid #edf0ec; display: grid; gap: 10px; grid-template-columns: 58px minmax(0, 1fr) auto; padding: 0 0 10px; }
.overview-item:last-child { border-bottom: 0; padding-bottom: 0; }
.overview-item time { color: var(--muted); font-size: 11px; font-weight: 800; }
.overview-item div { min-width: 0; }
.overview-item strong, .overview-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-item strong { font-size: 13px; }
.overview-item span { color: var(--muted); font-size: 11px; margin-top: 3px; }
.overview-item b { color: var(--green-dark); font-size: 12px; }
.status-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.status-card,
.sharing-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(35, 49, 41, 0.045);
}
.status-card { display: flex; flex-direction: column; padding: 20px; }
.card-heading { align-items: center; display: flex; justify-content: space-between; }
.card-icon {
  align-items: center; background: var(--green-soft); border-radius: 10px; color: var(--green-dark); display: flex;
  font-size: 20px; font-weight: 900; height: 38px; justify-content: center; width: 38px;
}
.status-badge,
.sharing-state {
  background: var(--green-soft); border-radius: 999px; color: var(--green-dark); font-size: 12px;
  font-weight: 850; padding: 7px 10px;
}
.status-badge.neutral,
.sharing-state.is-inactive { background: #f0f2ef; color: var(--muted); }
.status-card h2 { font-size: 20px; letter-spacing: -0.02em; line-height: 1.2; margin: 16px 0 8px; }
.status-card p { color: var(--muted); line-height: 1.55; margin: 0 0 16px; }
.text-action { color: var(--green-dark); font-size: 14px; font-weight: 850; margin-top: auto; text-decoration: none; }
.text-action:hover { text-decoration: underline; }

.sharing-panel > header {
  align-items: start; border-bottom: 1px solid var(--line); display: flex; gap: 30px; justify-content: space-between;
  padding: 24px;
}
.sharing-panel h2 { font-size: 26px; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 7px; }
.sharing-panel header p:not(.eyebrow) { color: var(--muted); line-height: 1.55; margin: 0; max-width: 780px; }

#sharing-form { display: grid; gap: 20px; padding: 24px; }
.sharing-shell { max-width: 980px; }
.sharing-intro { align-items: center; }
.access-options { border: 0; display: grid; gap: 10px; margin: 0; padding: 0; }
.access-options legend { font-size: 13px; font-weight: 850; margin-bottom: 9px; }
.access-choice {
  align-items: center; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; cursor: pointer;
  display: grid; gap: 13px; grid-template-columns: auto 38px minmax(0, 1fr); padding: 14px 15px;
}
.access-choice:hover { border-color: #aabbb1; }
.access-choice.is-selected { background: var(--green-soft); border-color: var(--green); box-shadow: 0 0 0 2px rgba(46, 118, 95, 0.08); }
.access-choice input { accent-color: var(--green); height: 17px; width: 17px; }
.access-choice-icon {
  align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; color: var(--green-dark);
  display: flex; font-weight: 900; height: 38px; justify-content: center; width: 38px;
}
.access-choice strong, .access-choice small { display: block; }
.access-choice strong { font-size: 14px; margin-bottom: 3px; }
.access-choice small { color: var(--muted); line-height: 1.45; }
.sharing-form-section { border-top: 1px solid var(--line); display: grid; gap: 18px; padding-top: 20px; }
.form-section-heading h3 { font-size: 18px; margin: 0 0 5px; }
.form-section-heading p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.field { display: grid; gap: 7px; }
.field > span:first-child { font-size: 13px; font-weight: 850; }
.field small { color: var(--muted); font-weight: 600; }
.field input,
.field textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; color: var(--ink);
  min-height: 46px; padding: 10px 12px; width: 100%;
}
.field textarea { line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--red); }
.url-input-wrap {
  align-items: center; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; display: flex; overflow: hidden;
}
.url-input-wrap > span { color: var(--muted); font-size: 14px; font-weight: 750; padding: 0 0 0 12px; white-space: nowrap; }
.url-input-wrap input { background: transparent; border: 0; border-radius: 0; min-width: 0; }
.url-input-wrap:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46, 118, 95, 0.12); }
.url-input-wrap input:focus { outline: 0; }
.field-help.is-error { color: var(--red); }

.current-link { background: var(--green-soft); border-radius: 10px; display: grid; gap: 4px; padding: 13px 15px; }
.current-link span { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.current-link strong { color: var(--green-dark); overflow-wrap: anywhere; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.account-footnote {
  align-items: center; color: var(--muted); display: flex; font-size: 13px; gap: 24px;
  justify-content: space-between; padding: 24px 4px 0;
}
.account-footnote p { margin: 0; }
.account-footnote div { display: flex; gap: 16px; white-space: nowrap; }
.account-footnote a { color: var(--green-dark); font-weight: 800; }
.noscript { margin: 40px auto; max-width: 680px; padding: 20px; }

@media (max-width: 820px) {
  .sign-in-panel { grid-template-columns: 1fr; margin-top: 10px; }
  .sign-in-benefits { border-left: 0; border-top: 1px solid var(--line); padding: 32px; }
  .status-grid { grid-template-columns: 1fr; }
  .overview-columns { grid-template-columns: 1fr; }
  .account-shell { padding-top: 30px; }
}

@media (max-width: 620px) {
  .account-header { min-height: 64px; padding: 6px 14px; }
  .account-brand { font-size: 19px; }
  .account-brand img { height: 44px; width: 44px; }
  .account-shell { padding: 22px 14px 42px; }
  .sign-in-copy { padding: 34px 24px; }
  .sign-in-copy h1 { font-size: 39px; }
  .sign-in-benefits { padding: 30px 24px; }
  .dashboard-intro { align-items: start; flex-direction: column; }
  .report-overview > header { align-items: stretch; flex-direction: column; padding: 21px; }
  .report-overview > header .button { width: 100%; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 14px 0; }
  .overview-metric.accent { grid-column: 1 / -1; }
  .overview-metric { min-height: 104px; }
  .overview-columns { padding: 12px 14px 14px; }
  .overview-item { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .status-card { padding: 20px; }
  .sharing-panel > header { flex-direction: column; padding: 21px; }
  #sharing-form { padding: 21px; }
  .access-choice { grid-template-columns: auto minmax(0, 1fr); }
  .access-choice-icon { display: none; }
  .url-input-wrap { align-items: stretch; display: grid; }
  .url-input-wrap > span { padding: 10px 12px 0; }
  .url-input-wrap input { padding-top: 4px; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  .form-actions .button { width: 100%; }
  .account-footnote { align-items: start; flex-direction: column; }
  .account-error { grid-template-columns: auto 1fr; padding: 26px 22px; }
  .account-error .button { grid-column: 1 / -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loading-mark { animation: none; }
}
