:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #667168;
  --paper: #f4f2eb;
  --card: #fffdf8;
  --line: #d9d7cf;
  --green: #245d45;
  --green-dark: #174431;
  --gold: #c4973b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 85% 5%, #e1eadf 0, transparent 28rem), var(--paper);
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 70rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.brand {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 700;
  text-decoration: none;
}

.brand span { color: var(--green); }

main {
  width: min(100% - 2rem, 58rem);
  margin: 3rem auto 5rem;
}

.hero { max-width: 48rem; margin-bottom: 2.5rem; }

.eyebrow, .step {
  color: var(--green);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; }

h1 {
  max-width: 45rem;
  margin: .5rem 0 1rem;
  font-size: clamp(2.5rem, 7vw, 4.8rem);
  line-height: .98;
  letter-spacing: -.04em;
}

h2 { margin: .25rem 0 .7rem; font-size: 1.75rem; }
h3 { margin: 0 0 .5rem; font-size: 1.25rem; }

.lede { color: var(--muted); font-size: 1.15rem; line-height: 1.65; }

.card {
  margin: 1rem 0;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: 0 .75rem 2rem rgba(23, 33, 27, .06);
}

.card p { color: var(--muted); line-height: 1.6; }

label { display: block; margin-bottom: .45rem; font-weight: 750; }

.field-row { display: flex; gap: .65rem; flex-wrap: wrap; }

input:not([type="checkbox"]), select, textarea {
  min-width: min(100%, 19rem);
  flex: 1;
  padding: .85rem 1rem;
  border: 1px solid #aaa9a2;
  border-radius: .55rem;
  background: white;
  color: var(--ink);
  font: inherit;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus { outline: 3px solid rgba(36, 93, 69, .2); border-color: var(--green); }

.button {
  padding: .85rem 1.1rem;
  border: 1px solid var(--green);
  border-radius: .55rem;
  background: var(--green);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.button:hover { background: var(--green-dark); }
.button:disabled { cursor: wait; opacity: .65; }
.button-quiet { background: transparent; color: var(--green); }

.notice {
  margin: 1rem 0;
  padding: .9rem 1rem;
  border-left: .3rem solid var(--gold);
  border-radius: .35rem;
  background: #fff7df;
}

.notice.error { border-color: #a74132; background: #fff0ed; }
.notice.success { border-color: var(--green); background: #edf7f1; }

.account-list { display: grid; gap: .75rem; margin-top: 1rem; }

.provider-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

.account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: white;
}

.account p { margin: .15rem 0; }
.account .email { color: var(--ink); font-weight: 750; }
.account-details { min-width: 0; flex: 1; }
.account-actions { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; flex-wrap: wrap; }
.sync-status-section { padding-bottom: .25rem; }
.card .sync-outcome { color: var(--ink); font-weight: 750; }

.account-reconnect-required {
  border: 2px solid #a74132;
  background: #fff0ed;
  box-shadow: 0 .35rem 1rem rgba(167, 65, 50, .1);
}

.account-reconnect-required .reconnect-required-label { color: #7f2f23; font-size: 1.05rem; }
.card .account-reconnect-unavailable { max-width: 22rem; color: #7f2f23; font-weight: 750; }

.card .sync-stale-warning {
  padding: .45rem .6rem;
  border-left: .2rem solid var(--gold);
  border-radius: .25rem;
  background: #fffaf0;
  color: var(--muted);
  font-weight: 650;
}

.card .warning-strong {
  padding: .65rem .75rem;
  border-left: .3rem solid var(--gold);
  border-radius: .35rem;
  background: #fff7df;
  color: var(--ink);
  font-weight: 750;
}

.forwarding-once {
  margin-top: 1rem;
  padding: 1rem;
  border: 2px solid var(--green);
  border-radius: .65rem;
  background: #edf7f1;
}

.forwarding-once h4 { margin: 0 0 .5rem; font-size: 1.05rem; }
.forwarding-once p { margin: .4rem 0 .8rem; }
.forwarding-address { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.review-editor {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: white;
}

.review-editor h4, .review-editor h5 { margin: .2rem 0 .5rem; font-size: 1.08rem; }
.review-editor-heading, .review-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.review-raw-artifact {
  margin: .8rem 0;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--paper);
}

.review-raw-artifact p { margin: .35rem 0 .65rem; }

.review-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: .8rem;
  margin: .8rem 0;
}

.review-form-grid label { margin: 0; }
.review-form-grid input, .review-form-grid select, .review-form-grid textarea { width: 100%; margin-top: .35rem; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 0;
}

.checkbox-label input { flex: none; width: 1.1rem; height: 1.1rem; }
.review-labels { display: flex; flex-wrap: wrap; gap: .4rem; margin: .65rem 0; }

.review-label {
  padding: .25rem .5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 750;
}

.review-label-warning { border-color: #c4973b; background: #fff7df; }
.review-targets, .review-evidence { display: grid; gap: .65rem; margin: .75rem 0 1rem; }

.review-target {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--card);
}

.review-target input { flex: none; margin-top: .2rem; }
.review-target p, .review-evidence-item p { margin: .2rem 0; }

.review-evidence-item {
  padding: .75rem;
  border-left: .25rem solid var(--green);
  border-radius: .35rem;
  background: var(--paper);
  overflow-wrap: anywhere;
}

.review-evidence-details, .review-reject, .review-editor details { margin-top: 1rem; }
.review-editor summary { cursor: pointer; font-weight: 750; }
.review-reject { padding-top: 1rem; border-top: 1px solid var(--line); }

footer { color: var(--muted); text-align: center; padding: 2rem; }

[hidden] { display: none !important; }

@media (max-width: 38rem) {
  main { margin-top: 1.25rem; }
  .field-row > * { width: 100%; }
  .account { align-items: stretch; flex-direction: column; }
  .account-actions { align-items: stretch; flex-direction: column; }
  .review-editor-heading, .review-section-heading { align-items: stretch; flex-direction: column; }
}
