:root {
  color-scheme: light;
  --paper: #f7f6f1;
  --white: #fff;
  --ink: #171416;
  --muted: #686260;
  --line: #d8d2ca;
  --green: #315b47;
  --green-dark: #244535;
  --green-soft: #e4ece7;
  --charcoal: #221e20;
  --ivory: #f6f1e8;
  --sage: #87917b;
  --sage-pale: #c0c6b8;
  --danger: #8e3f44;
  --ui: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: Baskerville, "Baskerville Old Face", "Iowan Old Style", Palatino, Georgia, serif;
  --radius: 2px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { max-width: 100%; cursor: pointer; overflow-wrap: anywhere; }
button:disabled { cursor: wait; opacity: .6; }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }
.skip-link {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--green-dark);
  border-radius: var(--radius);
  transform: translateY(calc(-100% - 12px));
}
.skip-link:focus-visible { transform: translateY(0); }

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.auth {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 32px;
  padding: 64px 24px;
  color: var(--ivory);
  background-color: var(--charcoal);
  background-image: url('/wedding/photos/orchid-engraving-ivory.webp');
  background-repeat: no-repeat;
  background-position: right -90px top 32px;
  background-size: clamp(260px, 40vw, 580px);
}
.auth > h1, .home-header h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.1;
}
.ampersand, .auth > h1 span { color: var(--sage-pale); font-size: .74em; font-style: italic; }
.auth-panel {
  width: min(100%, 480px);
  padding: clamp(22px, 4vw, 42px);
  color: var(--ink);
  background: var(--ivory);
}
.setup-disclosure { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.setup-disclosure summary { min-height: 44px; display: flex; align-items: center; color: var(--green); cursor: pointer; font-weight: 650; }
.setup-disclosure[open] summary { margin-bottom: 18px; }

.form-stack, .editor-form { display: grid; gap: 17px; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .2em; text-transform: uppercase; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: 3px solid var(--green-soft); }
.context-fields { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.context-fields legend { padding: 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.field-help { margin: 10px 0 0; color: var(--muted); font-size: 12px; font-weight: 450; }
.check-row { font-size: 13px; letter-spacing: normal; text-transform: none; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.form-message { min-height: 1.2em; margin: 0; color: var(--danger); font-size: 13px; }

.primary, .quiet {
  min-height: 44px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.primary { padding: 10px 16px; color: var(--white); background: var(--green); border: 1px solid var(--green); }
.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.quiet { padding: 10px 16px; color: var(--green); background: transparent; border: 1px solid var(--sage); }
.quiet:hover { background: var(--green-soft); }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.shell.is-home { grid-template-columns: minmax(0, 1fr); }
.home-header {
  grid-column: 1 / -1;
  padding: 16px clamp(24px, 5vw, 72px) 36px;
  color: var(--ivory);
  background-color: var(--charcoal);
  background-image: url('/wedding/photos/orchid-sprig-ivory.webp');
  background-repeat: no-repeat;
  background-position: right 12% bottom -90px;
  background-size: 250px;
}
.home-nav { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.monogram { display: inline-flex; align-items: center; gap: .35em; min-height: 44px; color: var(--ivory); font-family: var(--display); font-size: 16px; letter-spacing: .16em; text-decoration: none; text-transform: uppercase; }
.monogram span { color: var(--sage-pale); font-style: italic; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.account-actions a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ivory); font-family: var(--display); font-size: 16px; text-decoration: none; }
.account-actions a:hover { text-decoration: underline; }
.account-actions .quiet { color: var(--ivory); }
.account-actions .quiet:hover { color: var(--green); }
.home-nav .account-actions { gap: 0; }
.home-nav .account-actions > * + *::before { content: '·'; padding-inline: 10px; color: var(--sage-pale); }
.home-nav .account-actions .quiet { display: inline-flex; align-items: center; padding: 0; border: 0; font-family: var(--display); font-size: 16px; font-weight: 400; letter-spacing: normal; }
.home-nav .account-actions .quiet:hover { color: var(--sage-pale); background: transparent; text-decoration: underline; }
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 248px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 22px;
  color: var(--ivory);
  background: var(--charcoal);
}
.side-heading { margin-bottom: 20px; }
.side nav { display: grid; gap: 0; }
.nav-group-label { margin: 20px 0 6px; color: var(--sage-pale); font-size: 10px; font-weight: 650; letter-spacing: .2em; text-transform: uppercase; }
.side nav button, .side nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 7px 0;
  color: var(--ivory);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
}
.side nav button:hover, .side nav a:hover { color: var(--sage-pale); }
.side nav button[aria-current="true"] { border-bottom-color: var(--sage); }
.side-footer { margin-top: auto; padding-top: 24px; }
.connection { display: block; margin-bottom: 12px; color: var(--green); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.connection:empty { display: none; }
.revision { color: var(--muted); font-size: 11px; }

.workspace { grid-column: 2; min-width: 0; padding: 38px clamp(24px, 5vw, 72px) 72px; }
.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
}
.toolbar-actions { min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.toolbar h2 { margin: 0; font-family: var(--display); font-size: clamp(34px, 4vw, 48px); font-weight: 400; letter-spacing: -.025em; }
.content { padding-top: 26px; }

.is-home .workspace { grid-column: 1; width: min(100%, 1200px); margin: 0 auto; padding-top: 22px; }
.is-home .content { padding-top: 0; }
.home-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 40px; }
.home-group { min-width: 0; }
.home-group-label { margin: 0 0 10px; color: var(--muted); font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.home-list { display: grid; border-top: 1px solid var(--ink); }
.home-row {
  min-width: 0;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  text-decoration: none;
}
.home-row:hover, .home-row:focus-visible { color: var(--green); background: var(--green-soft); }
.home-row-copy { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 4px 12px; }
.home-row-title { min-width: 0; font-family: var(--display); font-size: 21px; font-weight: 400; line-height: 1.2; }
.home-row-fact { color: var(--muted); font-family: var(--ui); font-size: 12px; line-height: 1.5; text-align: right; }
.home-status-open { color: var(--green); }
.home-overdue { color: var(--danger); }
.home-row-arrow { flex: 0 0 auto; color: var(--sage); font-size: 22px; }
.notes-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 32px 0 12px; }
.notes-heading h2 { margin: 0; font-family: var(--display); font-size: 32px; font-weight: 400; }
.decided, .all-open { margin-top: 18px; }
.decided > summary, .all-open > summary { min-height: 44px; padding: 10px 0; color: var(--green); cursor: pointer; }
@media (min-width: 900px) {
  .home-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .home-row-copy { flex-wrap: wrap; }
  .home-row-copy > span { flex-shrink: 0; max-width: 100%; }
  .home-row-fact { text-align: left; }
}

.palette-intro { max-width: 760px; margin-bottom: 28px; }
.palette-intro h3 { margin: 0 0 10px; font-family: var(--display); font-size: clamp(28px, 3vw, 38px); font-weight: 400; }
.palette-intro p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.palette-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.palette-card { min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.palette-swatch { display: block; aspect-ratio: 1.45; border: 1px solid var(--line); border-radius: var(--radius); }
.palette-swatch-charcoal { background: #221e20; }
.palette-swatch-ivory { background: #f6f1e8; }
.palette-swatch-white { background: #fff; }
.palette-swatch-deep-green { background: #315b47; }
.palette-swatch-sage { background: #87917b; }
.palette-swatch-pale-sage { background: #c0c6b8; }
.palette-card h3 { margin: 14px 0 2px; font-family: var(--display); font-size: 23px; font-weight: 400; }
.palette-card strong { color: var(--green-dark); font-size: 12px; letter-spacing: .08em; }
.palette-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.palette-download { max-width: 100%; text-align: center; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; margin-top: 20px; padding: 10px 16px; color: var(--white); background: var(--green); border-radius: var(--radius); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }
.palette-download:hover { background: var(--green-dark); }

.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; margin-bottom: 18px; border-top: 1px solid var(--ink); }
.summary article { min-width: 0; min-height: 128px; padding: 20px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.summary strong { display: block; margin-bottom: 8px; font-family: var(--display); font-size: clamp(27px, 3vw, 37px); font-weight: 400; }
.summary p { margin: 0; color: var(--muted); font-size: 12px; }
.finance-summary strong { max-width: 100%; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.registry-value-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 10px; }
.registry-value-summary article { min-height: 112px; padding: 16px; }
.registry-value-summary strong { font-size: clamp(22px, 2.4vw, 32px); }
.registry-value-caption { color: var(--muted); font-size: 12px; line-height: 1.6; }
.registry-value-details { margin: 14px 0 24px; padding: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.registry-value-details > summary { min-height: 48px; padding: 14px 0; color: var(--green); font-weight: 650; cursor: pointer; }
.registry-value-retailers, .registry-value-bands { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.registry-value-retailers article, .registry-value-bands article { min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.registry-value-retailers h4, .registry-value-bands h5 { margin: 0 0 10px; font-size: 14px; }
.registry-value-retailers dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0; font-size: 12px; }
.registry-value-retailers dt { color: var(--muted); }
.registry-value-retailers dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.registry-value-bands { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.registry-value-bands strong { font-size: 14px; }
.registry-value-bands meter { display: block; width: 100%; height: 16px; margin-top: 6px; accent-color: var(--green); }
.registry-value-bands p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.notice { margin: 0 0 18px; padding: 14px 0; color: var(--muted); border-bottom: 1px solid var(--line); }
.notice a { font-weight: 700; }
.section-heading { margin: 30px 0 10px; font-family: var(--display); font-size: 25px; font-weight: 400; }

.list-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: 22px 0 12px; }
.list-tools input { width: min(100%, 360px); background: var(--paper); }
.items { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.item {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.item:hover { background: var(--green-soft); }
.item > div { min-width: 0; overflow-wrap: anywhere; }
.item.registry-item { grid-template-columns: 128px minmax(0, 1fr) auto; }
.registry-photo { width: 128px; min-height: 128px; display: grid; place-items: center; align-self: start; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.registry-item .registry-photo a { display: block; width: 100%; margin: 0; }
.registry-photo img { display: block; width: 100%; height: 128px; padding: 6px; object-fit: contain; }
.registry-photo-fallback { padding: 14px 8px; color: var(--muted); font-size: 12px; text-align: center; }
.registry-item > div:not(.registry-photo) { min-width: 0; overflow-wrap: anywhere; }
.item-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.item-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--green-dark); font-size: 12px; font-weight: 700; }
.item a { display: inline-block; margin-top: 5px; font-size: 12px; }
.item-details { margin-top: 6px; color: var(--muted); font-size: 12px; }
.item-details summary { width: fit-content; min-height: 32px; color: var(--green); cursor: pointer; font-weight: 700; }
.item-detail-text { max-height: 18rem; overflow-y: auto; white-space: pre-line; overflow-wrap: anywhere; overscroll-behavior: contain; }
.badge { padding: 5px 0; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; max-width: 100%; overflow-wrap: anywhere; }
.item-edit { min-height: 44px; padding: 10px 8px; color: var(--green); background: transparent; border: 0; font-size: 12px; }
.item-edit:hover, .item-edit:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.empty { min-height: 140px; display: grid; place-items: center; margin: 0; color: var(--muted); padding: 24px 12px; border-bottom: 1px solid var(--line); text-align: center; }

.phase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.phase { min-width: 0; padding: 18px 0; border-top: 1px solid var(--ink); }
.phase h3 { margin-bottom: 14px; font-family: var(--display); font-size: 23px; font-weight: 400; }
.phase .items { gap: 0; }
.phase .item { min-height: 62px; padding: 11px 12px; grid-template-columns: minmax(0, 1fr) auto; }
.phase-empty { margin: 0; padding: 24px 12px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }

.group-block { margin-bottom: 24px; }
.group-block h3 { margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .2em; text-transform: uppercase; }

.deadline-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.deadline-column { min-width: 0; padding: 18px 0; border-top: 1px solid var(--ink); }
.deadline-column h3 { margin-bottom: 14px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .2em; text-transform: uppercase; }
.deadline-column .items { gap: 0; }
.deadline-column .item { min-height: 62px; grid-template-columns: minmax(0, 1fr) auto; padding: 11px 12px; }
.deadline-empty { margin: 0; padding: 24px 12px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }

#editor { width: min(650px, calc(100vw - 24px)); max-height: calc(100vh - 30px); padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
#editor::backdrop { background: var(--charcoal); opacity: .65; }
.editor-form { max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 26px; }
.dialog-heading { position: sticky; top: -26px; z-index: 2; display: flex; justify-content: space-between; gap: 18px; margin: -1px -1px 0; padding: 1px 1px 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 0; font-family: var(--display); font-size: 31px; font-weight: 400; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

@media (max-width: 900px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .palette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .auth { padding: 48px 16px; background-position: right -120px top -30px; background-size: 300px; }
  .auth-panel { padding: 26px 20px; }
  .auth > h1 { font-size: clamp(42px, 12vw, 56px); }
  .home-header { padding: 12px 16px 36px; background-size: 155px; background-position: right -45px bottom -65px; }
  .home-header h1 { font-size: clamp(42px, 12vw, 58px); }
  .home-nav { gap: 8px; margin-bottom: 28px; }
  .account-actions { gap: 12px; }
  .account-actions .quiet { padding-inline: 10px; }
  .home-nav .account-actions { flex-wrap: nowrap; }
  .home-nav .account-actions > * + *::before { padding-inline: 6px; }
  .home-nav .account-actions .quiet { padding-inline: 0; }
  .form-pair { grid-template-columns: 1fr; }
  .shell { display: block; }
  .side { position: static; height: auto; width: auto; padding: 18px 16px 10px; max-width: 100%; border: 0; }
  .side-heading { margin-bottom: 14px; }
  .side nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .side nav::-webkit-scrollbar { display: none; }
  .side nav .nav-group-label { display: none; }
  .side nav button, .side nav a { flex: 0 0 auto; min-height: 44px; padding: 7px 12px; white-space: nowrap; text-align: center; font-size: 18px; scroll-snap-align: start; }
  .side-footer { padding-top: 10px; }
  .side-footer .account-actions { justify-content: space-between; }
  .workspace { padding: 22px 16px 54px; }
  .toolbar { align-items: center; flex-wrap: wrap; gap: 12px; }
  .toolbar-actions { justify-content: flex-start; }
  .toolbar .eyebrow { display: none; }
  .toolbar h2 { font-size: 31px; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary article { min-height: 112px; padding: 16px; }
  .summary strong { font-size: 27px; }
  .list-tools { justify-content: stretch; }
  .list-tools input { width: 100%; }
  .item { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .item > .item-edit { max-width: 90px; }
  .item.registry-item { grid-template-columns: 88px minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px; }
  .registry-item .registry-photo { grid-column: 1; grid-row: 1 / 3; width: 88px; min-height: 88px; }
  .registry-item .registry-photo img { height: 88px; padding: 4px; }
  .registry-item > div:not(.registry-photo) { grid-column: 2 / 4; }
  .registry-item > button { grid-column: 3; }
  .phase-grid { grid-template-columns: 1fr; }
  .deadline-board { grid-template-columns: 1fr; }
  .editor-form { padding: 22px 18px; }
}

@media (max-width: 440px) {
  .summary { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: 1fr; }
  .summary article { min-height: auto; }
  .finance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-summary article { min-height: 106px; padding: 14px; }
  .finance-summary strong { font-size: clamp(22px, 7vw, 27px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
