:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --ink: #17211d;
  --muted: #68736d;
  --line: #ded8cc;
  --brand: #0f766e;
  --brand-dark: #0b5b55;
  --rose: #b84b62;
  --gold: #c89533;
  --paper: #fffdf8;
  --shadow: 0 18px 42px rgba(21, 35, 31, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 38%),
    var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
  box-shadow: var(--shadow);
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 12px;
  align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(222, 216, 204, 0.7);
}

.topbar strong,
.topbar span {
  display: block;
}

.topbar strong {
  font-size: 15px;
}

.topbar div span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-size: 22px;
}

main {
  padding-bottom: 92px;
}

.view {
  display: none;
  padding: 16px;
}

.view.active {
  display: block;
}

.photo-band {
  min-height: 310px;
  border-radius: 0 0 8px 8px;
  background:
    linear-gradient(180deg, rgba(14, 36, 31, 0.05), rgba(14, 36, 31, 0.72)),
    url("assets/buffet-party.svg") center/cover;
  margin: -16px -16px 18px;
  display: flex;
  align-items: flex-end;
}

.photo-overlay {
  color: #fff;
  padding: 28px 20px;
  width: 100%;
}

.photo-overlay p,
.invite-card span,
.panel-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(30px, 9vw, 44px);
  line-height: 1.02;
  margin-bottom: 10px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

.section-grid,
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-panel,
.document-panel,
.rsvp-form,
.signature-form,
.guest-list,
.metric-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.summary-panel.alt {
  border-color: rgba(184, 75, 98, 0.28);
}

.summary-panel strong,
.metric-grid strong {
  display: block;
  font-size: 22px;
  line-height: 1.05;
  margin-bottom: 8px;
}

.summary-panel p,
.document-panel p,
.timeline p,
.contract-box p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.primary-action,
.secondary-action {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  margin-top: 8px;
}

.primary-action {
  background: var(--brand);
  color: #fff;
}

.secondary-action {
  background: #efe9dc;
  color: var(--ink);
}

.timeline {
  padding: 22px 2px 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 8px 0 14px;
}

.timeline-item > span {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border: 2px solid var(--gold);
  border-radius: 50%;
}

.timeline-item.done > span {
  background: var(--brand);
  border-color: var(--brand);
}

.invite-card {
  min-height: 360px;
  border-radius: 8px;
  color: #fff;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(20, 27, 25, 0.1), rgba(20, 27, 25, 0.8)),
    url("assets/invite-table.svg") center/cover;
}

.invite-card p {
  font-size: 17px;
  line-height: 1.45;
}

form {
  margin-top: 14px;
}

label {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

input,
textarea {
  width: 100%;
  display: block;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fffdf8;
  color: var(--ink);
  outline-color: var(--brand);
}

.checkbox-line {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  line-height: 1.35;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}

.contract-box {
  background: #f6f4ef;
  border-radius: 8px;
  padding: 14px;
}

.form-message {
  min-height: 22px;
  color: var(--brand-dark);
  font-weight: 800;
  margin: 12px 0 0;
}

.admin-header {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: end;
}

.metric-grid {
  grid-template-columns: repeat(3, 1fr);
  margin: 14px 0;
}

.metric-grid article {
  padding: 14px 10px;
}

.metric-grid strong {
  font-size: 18px;
}

.metric-grid span,
.guest-list span {
  color: var(--muted);
  font-size: 12px;
}

.guest-list ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.guest-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 6;
  width: min(100%, 480px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 248, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.tabbar button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  min-height: 54px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.tabbar button span {
  font-size: 20px;
  line-height: 1;
}

.tabbar button.active {
  color: var(--brand-dark);
  background: #e5f1ef;
}

@media (max-width: 360px) {
  .section-grid,
  .metric-grid,
  .admin-header {
    grid-template-columns: 1fr;
  }

  .photo-band,
  .invite-card {
    min-height: 300px;
  }
}
