:root {
      --primary: #005a9c;
      --dark: #333;
      --light: #f4f4f4;
      --white: #fff;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      background: var(--light);
      color: var(--dark);
      padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }

    .main-header {
      background: var(--white);
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
      position: sticky;
      top: 0;
      z-index: 100;
      padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      color: inherit;
      text-decoration: none;
      min-width: 0;
    }

    .logo-img {
      height: 45px;
      width: auto;
      flex-shrink: 0;
    }

    .site-name {
      font-weight: 700;
      color: var(--primary);
      font-size: 0.95rem;
      line-height: 1.2;
    }

    .icon-nav {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .icon-link {
      width: 44px;
      height: 44px;
      border-radius: 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--white);
      background: var(--primary);
      text-decoration: none;
      transition: background-color 0.2s ease, transform 0.2s ease;
    }

    .icon-link:hover {
      background: #00497f;
      transform: translateY(-1px);
    }

    .icon-link svg {
      width: 20px;
      height: 20px;
      fill: currentColor;
    }

    .container {
      width: min(100%, 640px);
      margin: 16px auto 0;
      padding: 0 12px;
    }

    .card {
      background: var(--white);
      border-radius: 12px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
      padding: 16px;
      margin-bottom: 12px;
    }

    .card h1 {
      margin: 0 0 8px;
      color: var(--primary);
      font-size: 1.1rem;
    }

    .card h2 {
      margin: 0 0 10px;
      color: #1f2937;
      font-size: 1rem;
      line-height: 1.4;
      font-weight: 600;
    }

    .top-tabs {
      display: flex;
      gap: 8px;
      margin: 0 0 12px;
    }

    .top-tab-btn {
      border: 1px solid #cfd9e6;
      background: #fff;
      color: #1f3b62;
      border-radius: 8px;
      padding: 8px 12px;
      font-size: 0.9rem;
      font-weight: 700;
      cursor: pointer;
    }

    .top-tab-btn.active {
      background: var(--primary);
      color: #fff;
      border-color: var(--primary);
    }

    .tab-panel { display: none; }
    .tab-panel.active { display: block; }

    .flash-wrap {
      margin: 0 0 12px;
      display: grid;
      gap: 8px;
    }

    .flash {
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 0.9rem;
      font-weight: 600;
    }

    .flash.success {
      background: #e8f7ee;
      color: #166534;
      border: 1px solid #bbf7d0;
    }

    .flash.error {
      background: #fef2f2;
      color: #991b1b;
      border: 1px solid #fecaca;
    }

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

    .form-fieldset {
      border: 1px solid #dbe3ee;
      border-radius: 10px;
      padding: 12px;
      background: #f9fbff;
      margin-bottom: 12px;
    }

    .form-fieldset legend {
      color: var(--primary);
      font-weight: 700;
      padding: 0 6px;
      font-size: 0.92rem;
    }

    .form-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
    }

    .form-group label {
      display: block;
      margin-bottom: 5px;
      font-size: 0.88rem;
      color: #374151;
      font-weight: 600;
    }

    .form-group input,
    .form-group textarea {
      width: 100%;
      border: 1px solid #cfd9e6;
      border-radius: 8px;
      padding: 10px 11px;
      font-size: 0.92rem;
      color: #1f2937;
      background: #fff;
    }

    .form-group textarea {
      min-height: 92px;
      resize: vertical;
    }

    .form-group input:focus,
    .form-group textarea:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.12);
    }

    .choice-row {
      display: flex;
      gap: 14px;
      flex-wrap: wrap;
      margin-top: 2px;
    }

    .choice-item {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.92rem;
      color: #1f2937;
      padding: 6px 8px;
      border-radius: 8px;
      background: #fff;
      border: 1px solid #dbe3ee;
    }

    .choice-item input {
      width: auto;
      margin: 0;
    }

    .error-message {
      margin-top: 5px;
      font-size: 0.82rem;
      color: #b91c1c;
      display: none;
    }

    .error-message.show {
      display: block;
    }

    .submit-btn {
      width: 100%;
      border: none;
      border-radius: 10px;
      background: var(--primary);
      color: var(--white);
      padding: 12px 14px;
      font-size: 0.98rem;
      font-weight: 700;
      cursor: pointer;
      transition: background-color 0.2s ease, opacity 0.2s ease;
    }

    .submit-btn:hover {
      background: #00497f;
    }

    .submit-btn:disabled {
      background: #9ca3af;
      cursor: not-allowed;
      opacity: 0.8;
    }

    .full-width {
      grid-column: 1 / -1;
    }

    @media (max-width: 640px) {
      .logo-img { height: 40px; }
    }

    @media (min-width: 760px) {
      .site-name { font-size: 1.05rem; }
      .container { padding: 0 18px; margin-top: 24px; }
      .card { padding: 20px; }
      .form-grid { grid-template-columns: 1fr 1fr; }
    }
