* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #24415f;
  background: linear-gradient(180deg, #bfe6fb 0%, #d7f1ff 42%, #f7fbff 100%);
  min-height: 100vh;
}

.page {
  width: min(440px, calc(100% - 32px));
  position: relative;
  margin: 28px auto 48px;
}

.store {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: #5e564c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.leaf {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #2f6f45;
}

h1 {
  margin: 8px 0 6px;
  color: #1f4f86;
  font-size: 28px;
  text-align: center;
  font-weight: 700;
  line-height: 1.35;
}

.lede {
  margin: 0 8px 0;
  color: #3d6284;
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

.greeting { position: relative; margin: 0 0 18px; text-align: center; }

.memo {
  padding: 20px;
  border-radius: 24px;
  background: #fff6e4;
  border: 2px solid #fff;
  box-shadow: 0 16px 32px rgba(31, 79, 134, 0.12);
}

.memo:has(.errors:not([hidden])) {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

legend {
  margin: 0 0 8px;
  padding: 0;
  color: #2c261f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

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

.type-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  padding: 8px 10px;
  border: 2px solid #e4d9c8;
  border-radius: 18px;
  background: #fffdf8;
  color: #2c261f;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 160ms, background-color 160ms, color 160ms;
}

.type-card-wide { grid-column: 1 / -1; }

.type-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.type-card:has(input:checked) {
  border-color: #2f6f45;
  background: #e7f2ea;
}

.field-label {
  display: block;
  margin: 0 0 6px;
  color: #2c261f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

input[type="text"],
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e4d9c8;
  border-radius: 18px;
  background: #fffdf8;
  color: #2c261f;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color 160ms, background-color 160ms, color 160ms;
}

textarea {
  height: auto;
  min-height: 140px;
  resize: vertical;
}

input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  color: #2c261f;
  font-family: inherit;
  font-size: 16px;
}

.help,
.file-name {
  margin: 4px 0 0;
  color: #5e564c;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  color: #2c261f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #2f6f45;
}

.private-note {
  margin: 4px 0 0;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  color: #5e564c;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  transition: background-color 180ms, color 180ms;
}

.private-wrap:has(#is_private:checked) .private-note {
  padding: 12px;
  background: #f6edd9;
  color: #6b4a12;
  font-weight: 700;
}

.errors {
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: #f8ece8;
  color: #8c2f2a;
}

.errors h2 {
  margin: 0 0 8px;
  color: #8c2f2a;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.errors ul {
  margin: 0;
  padding-left: 1.2rem;
}

.errors li {
  color: #8c2f2a;
  font-size: 14px;
  line-height: 1.5;
}

.submit,
.again {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 160ms, color 160ms, border-color 160ms, transform 100ms;
}

.submit {
  border: 0;
  background: #2f9a4a;
  color: #fffdf8;
}

.submit:active {
  background: #247a3a;
  transform: scale(0.98);
}

.again {
  margin-top: 20px;
  border: 1px solid #1f4f86;
  background: transparent;
  color: #1f4f86;
}

.again:active {
  transform: scale(0.98);
}

.id-label {
  margin: 0;
  color: #5e564c;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.id-num {
  margin: 4px 0 0;
  color: #2c261f;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.done-line {
  margin: 8px 0 0;
  color: #2c261f;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

.sync-notes {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: #5e564c;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.sync-notes li + li { margin-top: 4px; }

.view[hidden],
.errors[hidden],
.sync-notes[hidden],
.file-name[hidden] {
  display: none;
}

:focus-visible {
  outline: 2px solid #2f6f45;
  outline-offset: 3px;
}

@keyframes from-below-8 {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes from-below-12 {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes number-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.view.is-shown .greeting {
  animation: from-below-8 400ms ease both;
}

.view.is-shown .memo {
  animation: from-below-12 480ms ease 70ms both;
}

.view.is-shown .id-num {
  animation: number-in 280ms ease both;
}

@media (prefers-reduced-motion: reduce) {
  .view.is-shown .greeting,
  .view.is-shown .memo,
  .view.is-shown .id-num,
  .type-card,
  input,
  textarea,
  button,
  .private-note {
    animation: none;
    transition: none;
  }

  .submit:active,
  .again:active { transform: none; }
}

.cloud {
  position: absolute;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
}
.cloud:before, .cloud:after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 999px;
}
.c1 { width: 92px; top: 0; left: 0; }
.c1:before { width: 36px; height: 36px; left: 16px; top: -16px; }
.c1:after { width: 28px; height: 28px; left: 46px; top: -10px; }
.c2 { width: 70px; top: 18px; right: 0; }
.c2:before { width: 26px; height: 26px; left: 12px; top: -12px; }
.bag-art { display: flex; justify-content: center; margin: 28px 0 4px; }
.hero { width: 168px; height: 132px; }
