:root {
  color-scheme: light;
  --bg: #f1eee7;
  --paper: #fbfaf6;
  --paper-2: #f5f2eb;
  --ink: #252c29;
  --muted: #66706b;
  --line: rgba(50, 61, 56, 0.14);
  --sage: #dfe5e1;
  --sage-2: #aab8b1;
  --blue: #667b71;
  --blue-deep: #4f6259;
  --warn: #5f6f67;
  --danger: #8f4942;
  --ok: #536b60;
  --shadow: 0 18px 48px rgba(38, 47, 43, 0.1);
  --radius: 28px;
  --radius-sm: 18px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "Noto Serif SC", serif;
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  max-width: calc(var(--max) + 32px);
  margin: 0 auto;
  padding: 18px 16px 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.hero {
  padding: 24px 20px 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(72, 96, 89, 0.12);
  border-radius: calc(var(--radius) + 6px);
  background: rgba(251, 250, 246, 0.96);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero__eyebrow {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 16px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero__stamp {
  font-size: 13px;
  color: var(--blue-deep);
  border: 1px solid rgba(79, 110, 125, 0.2);
  background: rgba(255, 255, 255, 0.5);
  padding: 8px 12px;
  border-radius: 999px;
  transform: rotate(-2deg);
}

.hero__copy {
  margin: 14px 0 0;
  max-width: 72ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chip {
  border: 1px solid rgba(83, 109, 103, 0.18);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 143, 160, 0.42);
}

.chip--soft {
  box-shadow: 0 8px 20px rgba(41, 58, 51, 0.05);
}

.app {
  display: grid;
  gap: 16px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.card {
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid rgba(72, 96, 89, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary .card {
  padding: 16px 16px 15px;
}

.summary__slot--wide {
  grid-column: span 7;
}

.summary__slot--small {
  grid-column: span 5;
}

.summary__slot--third {
  grid-column: span 4;
}

.kicker {
  color: var(--blue-deep);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.stat {
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin: 0;
}

.stat-sub {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(244, 240, 232, 0.95);
  border: 1px solid rgba(70, 88, 83, 0.12);
  color: var(--muted);
}

.pill--ok {
  color: var(--ok);
  background: rgba(80, 123, 98, 0.08);
}

.pill--warn {
  color: var(--warn);
  background: rgba(79, 98, 89, 0.07);
}

.pill--danger {
  color: var(--danger);
  background: rgba(143, 73, 66, 0.08);
}

.pill--blue {
  color: var(--blue-deep);
  background: rgba(111, 143, 160, 0.08);
}

.timeline {
  display: grid;
  gap: 14px;
}

.step {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.step::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(79, 98, 89, 0.48);
}

.step__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.step__title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.step__index {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(111, 143, 160, 0.12);
  color: var(--blue-deep);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: 0 0 auto;
}

.step__title h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.step__hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.step__status {
  flex: 0 0 auto;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid rgba(74, 94, 88, 0.18);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  border-radius: 16px;
  padding: 14px 14px;
  min-height: 48px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.textarea {
  min-height: 190px;
  resize: vertical;
  line-height: 1.7;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(111, 143, 160, 0.65);
  box-shadow: 0 0 0 4px rgba(111, 143, 160, 0.12);
  background: #fff;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 1px solid transparent;
  background: var(--blue-deep);
  color: white;
  border-radius: 16px;
  padding: 13px 16px;
  min-height: 48px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 28px rgba(79, 110, 125, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  border-color: rgba(74, 94, 88, 0.16);
  box-shadow: none;
}

.btn--danger {
  background: var(--danger);
}

.btn--soft {
  background: rgba(111, 143, 160, 0.1);
  color: var(--blue-deep);
  border-color: rgba(111, 143, 160, 0.16);
  box-shadow: none;
}

.inline-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.error-box,
.info-box {
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(74, 94, 88, 0.12);
  background: rgba(248, 245, 238, 0.92);
  line-height: 1.7;
}

.error-box {
  border-color: rgba(143, 73, 66, 0.18);
  color: var(--danger);
  background: rgba(143, 73, 66, 0.06);
}

.info-box {
  color: var(--muted);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.photo-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(74, 94, 88, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

.photo-card__preview {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
}

.photo-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper-2);
}

.photo-card__body {
  padding: 10px 12px 12px;
}

.photo-card__title {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.photo-card__meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.photo-card__remove {
  display: inline-flex;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--danger);
  min-width: 44px;
  min-height: 44px;
  padding: 8px 0;
  align-items: center;
}

.section-gap {
  margin-top: 14px;
}

.auth-card {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.share-box,
.letter-detail {
  border-top: 1px dashed rgba(74, 94, 88, 0.18);
  padding-top: 14px;
}

.letter-list__item {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.letter-list__item.is-selected {
  border-color: rgba(111, 143, 160, 0.58);
  background: rgba(111, 143, 160, 0.08);
}

.letter-body {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(74, 94, 88, 0.12);
  background: rgba(255, 255, 255, 0.78);
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.compact-button {
  flex: 0 0 auto;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.rights-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 13px;
}

.legal-links a {
  color: var(--blue-deep);
  text-underline-offset: 3px;
}

.mini-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.mini-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(74, 94, 88, 0.12);
  background: rgba(255, 255, 255, 0.76);
}

.mini-item__main {
  display: grid;
  gap: 4px;
}

.mini-item__title {
  font-size: 14px;
  font-weight: 700;
}

.mini-item__sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.timeline-line {
  margin-top: 10px;
  border-top: 1px dashed rgba(74, 94, 88, 0.14);
  padding-top: 12px;
}

.footnote {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  padding: 0 8px;
}

.footer-nav,
.legal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.footer-nav a,
.legal-footer a,
.legal-card a {
  color: var(--blue-deep);
  text-underline-offset: 3px;
}

.footer-nav a,
.legal-footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.legal-shell {
  max-width: 1080px;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px 18px;
}

.brand-link {
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.legal-card {
  padding: clamp(22px, 5vw, 48px);
  border: 1px solid rgba(72, 96, 89, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 252, 247, 0.94);
  box-shadow: var(--shadow);
}

.legal-card--narrow {
  max-width: 900px;
  margin: 0 auto;
}

.legal-card h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 54px);
  letter-spacing: -0.04em;
}

.legal-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.35;
}

.legal-card section {
  margin-top: 30px;
}

.legal-card p,
.legal-list {
  color: var(--muted);
  line-height: 1.85;
}

.legal-lead {
  max-width: 66ch;
  margin: 14px 0 0;
  font-size: 17px;
}

.legal-meta {
  margin: 12px 0 0;
  font-size: 13px;
}

.legal-list {
  margin: 0;
  padding-left: 1.35em;
}

.legal-list li + li {
  margin-top: 8px;
}

.legal-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(74, 94, 88, 0.12);
  border-radius: 18px;
}

.legal-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.58);
}

.legal-table th,
.legal-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(74, 94, 88, 0.1);
  text-align: left;
  vertical-align: top;
  line-height: 1.65;
}

.legal-table th {
  color: var(--ink);
  font-size: 13px;
  background: rgba(111, 143, 160, 0.08);
}

.legal-table td {
  color: var(--muted);
  font-size: 14px;
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-callout,
.contact-panel {
  margin-top: 30px;
  padding: 18px;
  border: 1px solid rgba(111, 143, 160, 0.18);
  border-radius: 18px;
  background: rgba(111, 143, 160, 0.07);
}

.legal-callout p,
.contact-panel p {
  margin-bottom: 0;
}

.contact-address {
  display: inline-block;
  font-size: clamp(18px, 5vw, 28px);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.legal-footer {
  justify-content: center;
  padding: 18px 8px 4px;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: min(420px, calc(100vw - 32px));
  background: rgba(31, 43, 38, 0.95);
  color: #fff;
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 50;
}

@media (min-width: 901px) {
  .page-shell {
    padding: 24px 24px 36px;
  }

  .hero {
    padding: 30px 34px 26px;
    margin-bottom: 22px;
  }

  .hero__copy {
    max-width: 78ch;
  }

  .app {
    gap: 20px;
  }

  .auth-card {
    padding: 26px 30px;
  }

  .summary {
    gap: 18px;
  }

  .summary .card {
    padding: 20px 22px 19px;
  }

  .timeline {
    gap: 18px;
  }

  .step:not(.auth-card) {
    padding: 24px 28px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 260px));
    justify-content: start;
  }

  .footnote {
    margin-top: 18px;
  }

  .legal-header {
    padding: 16px 8px 22px;
  }

  .legal-card {
    padding: 50px 56px;
  }
}

@media (max-width: 900px) {
  .summary__slot--wide,
  .summary__slot--small,
  .summary__slot--third {
    grid-column: 1 / -1;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 12px 10px 20px;
  }

  .hero,
  .step,
  .summary .card {
    border-radius: 24px;
  }

  .hero {
    padding: 18px 16px 16px;
  }

  .step__head {
    flex-direction: column;
  }

  .step__status {
    align-self: flex-start;
  }

  .btn,
  .chip {
    width: 100%;
    justify-content: center;
  }

  .button-row {
    flex-direction: column;
  }

  .rights-list {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .legal-header {
    align-items: flex-start;
  }

  .legal-header .hero__stamp {
    max-width: 190px;
    text-align: center;
  }

  .legal-card {
    padding: 22px 18px;
  }
}
