:root {
  color-scheme: light;
  --ink: #20201e;
  --muted: #66635d;
  --paper: #fffdf6;
  --ground: #f3efe3;
  --line: #c9c0ad;
  --red: #bd2631;
  --red-dark: #8f1722;
  --blue: #244c5a;
  --green: #385b4a;
  --shadow: 0 16px 38px rgba(59, 49, 32, 0.12);
  font-family: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ground);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--ground);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #17699a;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  top: 12px;
}

.site-header,
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  min-height: 78px;
  border-bottom: 1px solid rgba(83, 72, 52, 0.25);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  letter-spacing: 0.06em;
}

.wordmark > span {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 21px;
}

.wordmark b {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 19px;
}

.site-header nav {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
}

.site-header nav a {
  color: #4b4944;
  font-size: 13px;
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--red);
}

.home,
.postal-page,
.content-page,
.not-found {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.lookup-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(280px, 1fr);
  grid-template-rows: auto auto;
  gap: 24px 56px;
  padding: 58px 5% 44px;
  overflow: hidden;
}

.lookup-heading {
  align-self: center;
}

.lookup-heading > p {
  margin: 0 0 7px;
  color: var(--red-dark);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 14px;
  letter-spacing: 0.13em;
}

.lookup-heading h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(31px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.data-seal {
  display: grid;
  width: 148px;
  grid-template-columns: auto 1fr;
  margin-top: 26px;
  padding: 12px 13px 10px;
  border: 1px solid rgba(189, 38, 49, 0.6);
  color: var(--red-dark);
  transform: rotate(-2deg);
}

.data-seal b {
  font-family: Georgia, serif;
  font-size: 17px;
}

.data-seal span {
  align-self: end;
  margin-left: 5px;
  font-size: 10px;
}

.data-seal time {
  grid-column: 1 / -1;
  margin-top: 3px;
  border-top: 1px solid rgba(189, 38, 49, 0.35);
  padding-top: 4px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.envelope {
  position: relative;
  align-self: center;
  aspect-ratio: 1.68;
  width: min(100%, 480px);
  justify-self: end;
  overflow: hidden;
  border: 1px solid #c1b49a;
  background: #fffaf0;
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.envelope::before {
  position: absolute;
  inset: 0;
  border: 7px double rgba(155, 139, 112, 0.08);
  content: "";
}

.stamp {
  position: absolute;
  right: 7%;
  top: 11%;
  display: grid;
  width: 58px;
  height: 70px;
  place-items: center;
  border: 3px double var(--red);
  color: var(--red);
}

.stamp span {
  font-family: Georgia, serif;
  font-size: 27px;
}

.stamp i {
  font-family: ui-monospace, monospace;
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.12em;
}

.postal-boxes {
  display: flex;
  align-items: center;
  gap: 5px;
}

.envelope > .postal-boxes {
  position: absolute;
  left: 10%;
  top: 20%;
}

.postal-boxes i {
  display: grid;
  width: 24px;
  height: 31px;
  place-items: center;
  border: 1.5px solid var(--red);
  color: var(--red-dark);
  font-family: ui-monospace, monospace;
  font-size: 16px;
  font-style: normal;
}

.postal-boxes span {
  color: var(--red);
}

.address-lines {
  position: absolute;
  left: 24%;
  right: 20%;
  top: 50%;
  display: grid;
  gap: 15px;
}

.address-lines span {
  height: 1px;
  background: #afa58f;
}

.address-lines span:nth-child(2) {
  margin-left: 12%;
}

.address-lines span:nth-child(3) {
  margin-left: 38%;
}

.flap {
  position: absolute;
  right: -60px;
  bottom: -86px;
  width: 75%;
  height: 145px;
  border-top: 1px solid #d5cbb6;
  transform: rotate(-19deg);
}

.search-form {
  grid-column: 1 / -1;
  position: relative;
  z-index: 2;
  padding: 22px 24px 18px;
  border: 1px solid #bbae94;
  background: rgba(255, 253, 246, 0.95);
  box-shadow: 0 8px 22px rgba(55, 45, 29, 0.09);
}

.search-form > label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.search-slot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  border-bottom: 2px solid var(--ink);
}

.search-slot > span {
  padding: 0 12px 0 4px;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 28px;
}

.search-slot input {
  min-width: 0;
  border: 0;
  padding: 14px 4px 12px;
  background: transparent;
  color: var(--ink);
  font-size: clamp(18px, 2.4vw, 25px);
  letter-spacing: 0.03em;
  outline: 0;
}

.search-slot input::placeholder {
  color: #9a958b;
  font-size: clamp(14px, 1.8vw, 18px);
}

.search-slot button,
.page-cta,
.not-found > a {
  border: 1px solid var(--red-dark);
  padding: 11px 24px;
  background: var(--red);
  color: white;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.search-slot button:hover,
.page-cta:hover {
  background: var(--red-dark);
}

.search-slot button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.search-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
}

.search-tools > label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.search-tools select {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 7px 28px 7px 9px;
  background: var(--paper);
  color: var(--ink);
}

.example-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.example-row button {
  border: 1px solid #c5bba8;
  padding: 6px 9px;
  background: transparent;
  color: #59554d;
  cursor: pointer;
  font-size: 11px;
}

.example-row button:hover {
  border-color: var(--red);
  color: var(--red);
}

.search-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.is-loading .search-status::before {
  content: "〒 ";
  color: var(--red);
}

.notice-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  border-block: 1px solid rgba(93, 82, 62, 0.22);
  padding: 12px 5%;
  color: #5f5a50;
  font-size: 12px;
}

.notice-strip > span {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 18px;
}

.notice-strip p {
  margin: 0;
}

.notice-strip a {
  white-space: nowrap;
  text-underline-offset: 3px;
}

.work-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 34px;
  padding: 42px 0 70px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 20px;
  letter-spacing: 0.09em;
}

.section-heading span {
  color: var(--muted);
  font-size: 11px;
}

.result-list {
  display: grid;
  gap: 14px;
}

.empty-result,
.no-result {
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  border: 1px dashed #b9ae99;
  background: rgba(255, 253, 246, 0.38);
  color: var(--muted);
  text-align: center;
}

.empty-result p,
.no-result p,
.no-result h3 {
  margin: 0;
}

.no-result > span {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 38px;
}

.no-result h3 {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 18px;
}

.address-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #c4b9a3;
  padding: 19px 22px 16px;
  background: var(--paper);
  box-shadow: 0 5px 12px rgba(61, 51, 35, 0.06);
}

.card-postal {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red-dark);
}

.card-postal span {
  font-family: Georgia, serif;
  font-size: 22px;
}

.card-postal strong {
  font-family: ui-monospace, "Yu Gothic UI", monospace;
  font-size: 22px;
  letter-spacing: 0.08em;
}

.card-kana {
  margin: 13px 0 3px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.address-card h3 {
  margin: 0;
  padding-right: 24px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.7;
}

.card-fold {
  position: absolute;
  right: -1px;
  top: -1px;
  width: 28px;
  height: 28px;
  border-bottom: 1px solid #c4b9a3;
  border-left: 1px solid #c4b9a3;
  background: var(--ground);
}

.result-actions,
.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
  border-top: 1px solid #e0d9ca;
  padding-top: 12px;
}

.result-actions a,
.result-actions button,
.sheet-actions button {
  border: 1px solid #a99f8b;
  padding: 7px 10px;
  background: transparent;
  color: #45423c;
  cursor: pointer;
  font-size: 11px;
  text-decoration: none;
}

.result-actions a {
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 700;
}

.result-actions button:hover,
.sheet-actions button:hover,
.result-actions .is-saved,
.sheet-actions .is-saved {
  border-color: var(--red);
  color: var(--red-dark);
}

.result-actions .is-done,
.sheet-actions .is-done {
  border-color: var(--green);
  color: var(--green);
}

.saved-tray {
  position: sticky;
  top: 20px;
  align-self: start;
  min-height: 230px;
  border: 1px solid #a99c84;
  border-top: 4px solid var(--red);
  padding: 0 15px 16px;
  background: #e7deca;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.24);
}

.tray-tab {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin: 0 -4px 12px;
  border-bottom: 1px solid #bcae94;
  padding: 12px 5px 10px;
}

.tray-tab > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: "Yu Mincho", serif;
  font-size: 13px;
}

.tray-tab h2 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.tray-tab b {
  min-width: 25px;
  border-radius: 50%;
  padding: 4px;
  background: var(--red);
  color: white;
  font-size: 11px;
  text-align: center;
}

.saved-stack {
  display: grid;
  gap: 9px;
}

.empty-tray {
  margin: 24px 6px;
  color: #696257;
  font-size: 12px;
  line-height: 1.8;
}

.saved-card {
  position: relative;
  border: 1px solid #c6bba7;
  padding: 11px 12px 10px;
  background: var(--paper);
}

.saved-card a {
  color: var(--red-dark);
  font-family: ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.saved-card p {
  margin: 6px 30px 0 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 12px;
  line-height: 1.55;
}

.remove-saved {
  position: absolute;
  right: 7px;
  top: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.clear-button {
  margin-top: 14px;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 2px 0;
  background: transparent;
  color: #665e50;
  cursor: pointer;
  font-size: 11px;
}

.postal-page {
  padding: 48px 0 80px;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #57534c;
  font-size: 13px;
  text-underline-offset: 4px;
}

.address-sheet {
  position: relative;
  width: min(830px, 100%);
  margin-inline: auto;
  border: 1px solid #bbae95;
  padding: clamp(24px, 6vw, 58px);
  background-color: var(--paper);
  box-shadow: var(--shadow);
}

.address-sheet::after {
  position: absolute;
  right: 22px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(189, 38, 49, 0.45);
  border-radius: 50%;
  color: rgba(189, 38, 49, 0.55);
  content: "〒";
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  transform: rotate(-8deg);
}

.address-sheet > header {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid var(--red);
  padding-bottom: 22px;
}

.sheet-mark {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 30px;
}

.sheet-code {
  display: flex;
  gap: 6px;
}

.sheet-code span {
  display: grid;
  width: clamp(27px, 6vw, 42px);
  height: clamp(36px, 7vw, 50px);
  place-items: center;
  border: 1.5px solid var(--red);
  color: var(--red-dark);
  font-family: ui-monospace, monospace;
  font-size: clamp(17px, 3vw, 24px);
}

.sheet-code .break {
  margin-left: 16px;
}

.sheet-addresses section {
  padding: 30px 0 22px;
  border-bottom: 1px solid #d8cfbd;
}

.sheet-addresses section:last-child {
  border-bottom: 0;
}

.sheet-addresses p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.07em;
}

.sheet-addresses h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.65;
}

.source-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  width: min(830px, 100%);
  margin: 20px auto 0;
  border-left: 3px solid var(--red);
  padding: 13px 16px;
  background: rgba(255, 253, 246, 0.6);
  color: #5b574e;
  font-size: 12px;
}

.source-note p {
  margin: 0;
}

.content-page {
  padding: 52px 0 80px;
}

.content-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.content-heading > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 24px;
}

.content-heading h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 30px;
  letter-spacing: 0.1em;
}

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

.instruction-grid section,
.source-grid section,
.privacy-grid section {
  position: relative;
  border: 1px solid #c8bda8;
  padding: 25px;
  background: var(--paper);
}

.instruction-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.instruction-grid section > b {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: Georgia, serif;
}

.instruction-grid h2,
.source-grid h2,
.privacy-grid h2 {
  margin: 13px 0 9px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 18px;
}

.source-grid h2,
.privacy-grid h2 {
  margin-top: 0;
}

.instruction-grid p,
.source-grid p,
.privacy-grid p {
  margin: 0 0 10px;
  color: #5f5b53;
  font-size: 13px;
  line-height: 1.85;
}

.source-grid a {
  color: var(--blue);
  font-size: 13px;
  text-underline-offset: 4px;
}

.source-ledger dl {
  margin: 0 0 16px;
}

.source-ledger dl > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #ddd4c2;
  padding: 8px 0;
}

.source-ledger dt {
  color: var(--muted);
  font-size: 12px;
}

.source-ledger dd {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

.page-cta {
  display: inline-block;
  margin-top: 28px;
}

.not-found {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 70px 0 90px;
  text-align: center;
}

.not-found .envelope {
  width: min(400px, 90%);
}

.not-found h1 {
  margin: 12px 0 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 26px;
}

.not-found p {
  margin: 0 0 12px;
  color: var(--muted);
}

.site-footer {
  min-height: 80px;
  border-top: 1px solid rgba(83, 72, 52, 0.25);
  color: #656158;
  font-size: 11px;
}

.site-footer a {
  text-underline-offset: 3px;
}

@media (max-width: 800px) {
  .lookup-board {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-inline: 3%;
  }

  .envelope {
    grid-row: 2;
    justify-self: center;
    width: min(460px, 95%);
  }

  .search-form {
    grid-column: 1;
  }

  .work-area {
    grid-template-columns: 1fr;
  }

  .saved-tray {
    position: static;
  }

  .instruction-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header,
  .site-footer,
  .home,
  .postal-page,
  .content-page,
  .not-found {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 68px;
  }

  .wordmark b {
    font-size: 17px;
  }

  .site-header nav {
    gap: 12px;
  }

  .site-header nav a {
    font-size: 11px;
  }

  .lookup-board {
    padding: 38px 0 32px;
  }

  .lookup-heading h1 {
    font-size: 31px;
  }

  .envelope {
    width: 100%;
  }

  .stamp {
    width: 45px;
    height: 54px;
  }

  .stamp span {
    font-size: 21px;
  }

  .envelope > .postal-boxes {
    left: 6%;
  }

  .postal-boxes {
    gap: 3px;
  }

  .postal-boxes i {
    width: 19px;
    height: 26px;
    font-size: 13px;
  }

  .search-form {
    padding: 17px 14px 14px;
  }

  .search-slot > span {
    padding-right: 7px;
    font-size: 22px;
  }

  .search-slot input {
    padding-inline: 0;
    font-size: 17px;
  }

  .search-slot button {
    padding: 9px 15px;
  }

  .search-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .example-row {
    justify-content: flex-start;
  }

  .notice-strip {
    grid-template-columns: auto 1fr;
    padding-inline: 2px;
  }

  .notice-strip a {
    grid-column: 2;
  }

  .work-area {
    padding-top: 32px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .address-card {
    padding: 17px 15px 14px;
  }

  .result-actions a,
  .result-actions button,
  .sheet-actions button {
    flex: 1 1 calc(50% - 7px);
    text-align: center;
  }

  .address-sheet {
    padding: 22px 15px 38px;
  }

  .address-sheet > header {
    gap: 7px;
  }

  .sheet-mark {
    font-size: 22px;
  }

  .sheet-code {
    gap: 3px;
  }

  .sheet-code span {
    width: min(9vw, 34px);
    height: 39px;
    font-size: 17px;
  }

  .sheet-code .break {
    margin-left: 7px;
  }

  .sheet-addresses h1 {
    font-size: 22px;
  }

  .source-note,
  .source-grid,
  .privacy-grid {
    grid-template-columns: 1fr;
  }

  .source-note {
    gap: 7px;
  }

  .content-heading h1 {
    font-size: 27px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
