:root {
      --blue: #0074e8;
      --blue2: #005bd8;
      --sky: #dff3ff;
      --text: #18234a;
      --muted: #596583;
      --line: #d8e8fb;
      --card: rgba(255,255,255,.92);
      --shadow: 0 12px 32px rgba(24, 35, 74, .08);
      --radius: 8px;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      color: var(--text);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
      background: #f4f8fc;
      min-height: 100vh;
    }

    .page {
      max-width: 1040px;
      margin: 0 auto;
      padding: 24px 18px 48px;
      position: relative;
      overflow: hidden;
    }

    .top {
      border-radius: var(--radius);
      overflow: hidden;
      background: #fff;
      border: 1px solid #d8e8fb;
    }

    .hero-image {
      display: block;
      width: 100%;
      height: auto;
      aspect-ratio: 1983 / 793;
      object-fit: contain;
    }

    .person {
      position: absolute;
      bottom: 42px;
      width: 170px;
      height: 230px;
      border-radius: 90px 90px 36px 36px;
      background: linear-gradient(#ffe2c4 0 30%, #1d2b55 31% 100%);
      opacity: .95;
      box-shadow: inset 0 -60px 0 rgba(255,255,255,.08);
    }

    .person.left { left: 38px; }
    .person.right { right: 58px; background: linear-gradient(#ffe2c4 0 30%, #113b75 31% 100%); }
    .person::before {
      content: "";
      position: absolute;
      top: 28px;
      left: 45px;
      width: 80px;
      height: 80px;
      border-radius: 50%;
      background: #ffd7b1;
      box-shadow: inset 0 22px 0 #5a371e;
    }
    .person::after {
      content: "";
      position: absolute;
      bottom: 46px;
      left: 35px;
      width: 100px;
      height: 10px;
      border-radius: 999px;
      background: rgba(255,255,255,.75);
      transform: rotate(-16deg);
    }

    .coin {
      position: absolute;
      left: 245px;
      bottom: 62px;
      width: 110px;
      height: 110px;
      border-radius: 50%;
      background: #ffda48;
      border: 8px solid #0b7de8;
      display: grid;
      place-items: center;
      font-size: 50px;
      color: #005bd8;
      font-weight: 900;
      box-shadow: 0 10px 24px rgba(0, 91, 216, .15);
    }

    .pig {
      position: absolute;
      right: 210px;
      bottom: 42px;
      width: 120px;
      height: 88px;
      border-radius: 52px;
      background: #dff1ff;
      border: 6px solid #0b7de8;
      color: #0b65d8;
    }
    .pig::before {
      content: "★";
      position: absolute;
      right: 18px;
      top: 12px;
      color: #ffcf31;
      font-size: 20px;
    }
    .pig::after {
      content: "";
      position: absolute;
      right: -19px;
      top: 34px;
      width: 26px;
      height: 26px;
      border: 5px solid #0b7de8;
      border-left: 0;
      border-bottom: 0;
      border-radius: 0 20px 0 0;
    }

    .menu,
    .person,
    .coin,
    .pig {
      display: none;
    }

    .form-card {
      margin-top: 18px;
      position: relative;
      z-index: 5;
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: clamp(22px, 4vw, 42px);
      border: 1px solid rgba(195, 226, 255, .9);
    }

    .form-heading {
      margin: 0 0 20px;
      color: var(--text);
      font-size: clamp(22px, 3vw, 30px);
      line-height: 1.4;
      letter-spacing: 0;
      text-align: center;
    }

    .info {
      display: flex;
      align-items: center;
      gap: 18px;
      background: linear-gradient(90deg, #eef8ff, #f8fcff);
      border-radius: var(--radius);
      padding: 18px 24px;
      margin-bottom: 28px;
      color: #26365e;
      font-size: 16px;
      font-weight: 600;
      line-height: 1.8;
    }

    .info-note {
      color: #53607f;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.7;
    }

    .info-icon {
      min-width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border: 3px solid var(--blue);
      color: var(--blue);
      border-radius: 50%;
      font-weight: 900;
      font-size: 24px;
    }

    .form-row {
      display: grid;
      grid-template-columns: 260px 1fr;
      gap: 20px;
      align-items: start;
      padding: 14px 0;
      border-bottom: 1px dashed var(--line);
    }

    .form-row[hidden] {
      display: none;
    }

    .form-row.valid input,
    .form-row.valid select {
      border-color: #36b37e;
    }

    .form-row.invalid input,
    .form-row.invalid select {
      border-color: #e5484d;
      background: #fff8f8;
    }

    .form-row.empty input,
    .form-row.empty select {
      border-color: #c9ddf5;
    }

    .label {
      display: block;
      font-weight: 800;
      letter-spacing: .03em;
      padding-top: 10px;
      font-size: 16px;
    }

    .required, .optional {
      display: inline-block;
      margin-left: 10px;
      padding: 2px 8px;
      border-radius: 7px;
      font-size: 12px;
      color: #fff;
      background: #d92d20;
      vertical-align: 2px;
      white-space: nowrap;
    }

    .optional {
      color: #fff;
      background: var(--blue);
      border: 1px solid var(--blue);
    }

    .control {
      position: relative;
      width: 100%;
      min-width: 0;
    }

    input, select {
      width: 100%;
      height: 64px;
      border: 2px solid #c9ddf5;
      border-radius: 8px;
      background: rgba(255,255,255,.94);
      color: var(--text);
      font-size: 16px;
      padding: 0 22px;
      outline: none;
      transition: .15s;
    }

    input[type="date"] {
      -webkit-appearance: none;
      appearance: none;
      display: block;
      width: 100%;
      inline-size: 100%;
      min-width: 0;
      min-inline-size: 0;
      max-width: 100%;
      max-inline-size: 100%;
      margin: 0;
      box-sizing: border-box;
      line-height: 1.2;
      padding-top: 0;
      padding-bottom: 0;
      text-align: center;
    }

    input[type="date"]::-webkit-date-and-time-value {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100%;
      min-width: 0;
      line-height: normal;
      padding-block: 0;
      text-align: center;
    }

    input[type="date"]::-webkit-calendar-picker-indicator {
      flex-shrink: 0;
    }

    input:focus, select:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 5px rgba(0, 116, 232, .1);
    }

    select {
      appearance: auto;
      font-weight: 700;
    }

    .prefix {
      position: absolute;
      left: 0;
      top: 0;
      width: 74px;
      height: 64px;
      display: grid;
      place-items: center;
      border-right: 2px solid #c9ddf5;
      font-size: 22px;
      font-weight: 900;
    }

    .has-prefix input { padding-left: 96px; }

    .icon {
      position: absolute;
      right: 18px;
      top: 50%;
      transform: translateY(-50%);
      color: #737d9e;
      font-size: 24px;
      pointer-events: none;
    }

    .hint {
      color: var(--muted);
      font-size: 13px;
      margin-top: 8px;
      font-weight: 600;
    }

    .field-state {
      display: flex;
      align-items: center;
      min-height: 24px;
      margin-top: 9px;
      padding: 0;
      border: 0;
      background: transparent;
      color: #6d7795;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.5;
      visibility: hidden;
    }

    .field-state.visible {
      visibility: visible;
    }

    .field-state.valid {
      color: #8f1d15;
    }

    .field-state.invalid {
      color: #b42318;
    }

    .field-state.processing {
      color: #005bd8;
    }

    .field-state.optional {
      color: #68738f;
    }

    .confirm {
      display: block;
      width: min(700px, 100%);
      margin: 42px auto 22px;
      height: 86px;
      border: 0;
      border-radius: 8px;
      background: var(--blue2);
      color: #fff;
      font-size: clamp(19px, 2.6vw, 26px);
      font-weight: 900;
      letter-spacing: 0;
      cursor: pointer;
      box-shadow: 0 18px 30px rgba(0, 91, 216, .25);
    }

    .privacy {
      text-align: center;
      color: #53607f;
      font-weight: 600;
      line-height: 1.9;
    }

    .privacy a { color: var(--blue); font-weight: 900; }

    .form-status {
      width: min(700px, 100%);
      margin: -4px auto 22px;
      min-height: 28px;
      color: #1c376e;
      font-size: 14px;
      font-weight: 800;
      line-height: 1.6;
      text-align: center;
    }

    .form-status.error { color: #b42318; }

    .confirm:disabled {
      cursor: not-allowed;
      opacity: .68;
      box-shadow: none;
    }

    .confirm-content {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
    }

    .spinner {
      display: none;
      width: 22px;
      height: 22px;
      border: 3px solid rgba(255,255,255,.45);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin .8s linear infinite;
    }

    .confirm.loading .spinner {
      display: inline-block;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    body.modal-open {
      overflow: hidden;
    }

    .confirmation-modal {
      width: min(760px, calc(100% - 32px));
      max-width: none;
      margin: auto;
      padding: 0;
      border: 0;
      border-radius: 8px;
      background: transparent;
      color: var(--text);
    }

    .confirmation-modal::backdrop {
      background: rgba(10, 24, 56, .52);
    }

    .confirmation-dialog {
      width: 100%;
      max-height: min(88vh, 820px);
      overflow-y: auto;
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 26px 70px rgba(16, 45, 91, .25);
      padding: 34px 28px 28px;
      text-align: center;
      border: 1px solid #d9eafa;
    }

    .confirmation-mark {
      width: 74px;
      height: 42px;
      margin: 0 auto 16px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      background: #eaf4ff;
      color: var(--blue2);
      font-size: 16px;
      font-weight: 900;
    }

    .confirmation-dialog h2 {
      margin: 0 0 10px;
      color: var(--text);
      font-size: 24px;
      line-height: 1.35;
    }

    .confirmation-dialog > p {
      margin: 0 0 22px;
      color: #53607f;
      font-size: 15px;
      font-weight: 700;
      line-height: 1.8;
    }

    .confirmation-list {
      margin: 0 0 24px;
      border: 1px solid #d8e8fb;
      border-radius: 8px;
      overflow: hidden;
      text-align: left;
    }

    .confirmation-row {
      display: grid;
      grid-template-columns: minmax(150px, 34%) 1fr;
      margin: 0;
      border-bottom: 1px solid #e2edf9;
    }

    .confirmation-row:last-child {
      border-bottom: 0;
    }

    .confirmation-row dt,
    .confirmation-row dd {
      margin: 0;
      padding: 13px 16px;
      overflow-wrap: anywhere;
      line-height: 1.6;
    }

    .confirmation-row dt {
      background: #f1f7fd;
      color: #33415f;
      font-weight: 800;
    }

    .confirmation-row dd {
      color: var(--text);
      font-weight: 700;
      white-space: pre-wrap;
    }

    .confirmation-status {
      min-height: 26px;
      margin: -8px 0 16px;
      color: #b42318;
      font-size: 13px;
      font-weight: 800;
      line-height: 1.6;
      text-align: center;
    }

    .confirmation-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 10px;
    }

    .confirmation-submit {
      min-width: 180px;
      min-height: 52px;
      border: 0;
      border-radius: 8px;
      background: var(--blue2);
      color: #fff;
      font-size: 16px;
      font-weight: 900;
      cursor: pointer;
    }

    .confirmation-submit:disabled {
      cursor: not-allowed;
      opacity: .68;
    }

    .confirmation-submit.loading .spinner {
      display: inline-block;
      margin-right: 8px;
      vertical-align: -4px;
    }

    .confirmation-secondary {
      min-width: 150px;
      min-height: 52px;
      border: 1px solid #9eb4cc;
      border-radius: 8px;
      background: #fff;
      color: #33415f;
      font-size: 15px;
      font-weight: 800;
      cursor: pointer;
    }

    .complete-page {
      width: min(100% - 36px, 760px);
      margin: 0 auto;
      padding: 42px 0;
    }

    .complete-card {
      margin-top: 18px;
      padding: clamp(34px, 7vw, 64px);
      border: 1px solid #d8e8fb;
      border-radius: var(--radius);
      background: #fff;
      box-shadow: var(--shadow);
      text-align: center;
    }

    .complete-mark {
      width: 76px;
      height: 76px;
      margin: 0 auto 22px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: #eefbf5;
      color: #087b4b;
      font-size: 38px;
      font-weight: 900;
    }

    .complete-card h1 {
      margin: 0 0 16px;
      font-size: clamp(24px, 4.5vw, 34px);
    }

    .complete-message {
      margin: 0;
      color: #53607f;
      font-size: 16px;
      font-weight: 700;
      line-height: 1.9;
    }

    .complete-time {
      min-height: 24px;
      margin: 20px 0 28px;
      color: #33415f;
      font-weight: 800;
    }

    .moneytree-guide {
      margin: 0 0 28px;
      padding: clamp(22px, 4vw, 30px);
      border: 1px solid #c7ddf7;
      border-radius: 12px;
      background: #f4f9ff;
      text-align: left;
    }

    .moneytree-guide h2 {
      margin: 0 0 14px;
      color: #17213e;
      font-size: clamp(18px, 3vw, 24px);
      line-height: 1.45;
    }

    .moneytree-guide p {
      margin: 0;
      color: #33415f;
      font-size: 15px;
      font-weight: 600;
      line-height: 1.9;
    }

    .moneytree-link {
      display: flex;
      width: fit-content;
      max-width: 100%;
      min-height: 58px;
      margin: 22px auto 0;
      padding: 0 30px;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      background: #f28c00;
      color: #fff;
      font-size: 16px;
      font-weight: 900;
      line-height: 1.4;
      text-decoration: none;
      box-shadow: 0 10px 22px rgba(242, 140, 0, .2);
    }

    .moneytree-link:hover {
      background: #d97900;
    }

    .moneytree-link:focus-visible {
      outline: 3px solid rgba(0, 91, 216, .32);
      outline-offset: 3px;
    }

    .complete-back {
      display: inline-flex;
      min-width: 220px;
      min-height: 56px;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      background: var(--blue2);
      color: #fff;
      font-size: 16px;
      font-weight: 900;
      text-decoration: none;
      box-shadow: 0 14px 28px rgba(0, 91, 216, .22);
    }

    .footer-illust {
      height: 80px;
      background: linear-gradient(180deg, transparent, #dff3ff);
      border-radius: 0 0 var(--radius) var(--radius);
      margin: 18px -42px -42px;
      position: relative;
    }

    .footer-illust::after { content: ""; }

    @media (max-width: 860px) {
      .page { padding-top: 12px; }
      .form-heading { margin-bottom: 16px; font-size: 22px; }
      .person, .coin, .pig { display: none; }
      .form-row {
        grid-template-columns: 1fr;
        gap: 8px;
      }
      .label { padding-top: 0; }
      .info { font-size: 14px; align-items: flex-start; }
      .info-note { font-size: 12px; }
      input, select { height: 58px; font-size: 15px; }
      .prefix { height: 58px; }
      .moneytree-link {
        width: 100%;
        padding: 12px 16px;
        text-align: center;
      }
      .confirm { height: 70px; }
      .confirmation-dialog { padding: 30px 18px 24px; }
      .confirmation-row { grid-template-columns: 1fr; }
      .confirmation-row dt { padding-bottom: 5px; }
      .confirmation-row dd { padding-top: 5px; }
      .footer-illust { margin-left: -22px; margin-right: -22px; margin-bottom: -22px; }
    }
