* {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }

    body {
      background: linear-gradient(145deg, #eef2f7 0%, #d9e0e8 100%);
      font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
      padding: 1.2rem;
      min-height: 100vh;
    }

    .app-wrapper {
      max-width: 1400px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }

    .card {
      background: rgba(255,255,255,0.96);
      border-radius: 2rem;
      box-shadow: 0 20px 35px -12px rgba(0,0,0,0.2);
      overflow: hidden;
      transition: all 0.2s;
    }

    .form-card {
      padding: 1.5rem;
    }

    .output-card {
      padding: 0;
    }

    h1 {
      font-size: 1.7rem;
      font-weight: 700;
      background: linear-gradient(135deg, #1a3e50, #0f2f3f);
      background-clip: text;
      -webkit-background-clip: text;
      color: transparent;
      display: inline-block;
      letter-spacing: -0.3px;
    }

    .badge-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      margin-bottom: 1.2rem;
      border-bottom: 2px solid #e2edf2;
      padding-bottom: 0.8rem;
    }

    .org-selector {
      background: #eef3fc;
      padding: 0.3rem 0.8rem;
      border-radius: 40px;
      font-size: 0.75rem;
      font-weight: 600;
      color: #1f5e7e;
    }

    .form-grid {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .row-2col {
      display: flex;
      gap: 1rem;
      flex-wrap: wrap;
    }
    .row-2col .field {
      flex: 1;
      min-width: 140px;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }

    label {
      font-weight: 600;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      color: #1e4a6e;
    }

    input, select, textarea {
      width: 100%;
      padding: 0.8rem 1rem;
      font-size: 0.95rem;
      border: 1.5px solid #e0e7ef;
      border-radius: 1.2rem;
      background: #ffffff;
      transition: 0.2s;
      font-family: inherit;
      outline: none;
    }

    input:focus, select:focus, textarea:focus {
      border-color: #2c7da0;
      box-shadow: 0 0 0 3px rgba(44,125,160,0.15);
    }

    .radio-group {
      display: flex;
      gap: 1rem;
      flex-wrap: wrap;
      margin-top: 0.3rem;
    }

    .radio-group label {
      font-weight: 500;
      text-transform: none;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.85rem;
    }

    button {
      background: #1f5e7e;
      color: white;
      border: none;
      padding: 0.9rem;
      font-size: 1rem;
      font-weight: 600;
      border-radius: 2rem;
      cursor: pointer;
      transition: all 0.2s ease;
      width: 100%;
      margin-top: 0.5rem;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
    }

    button:active {
      transform: scale(0.97);
    }

    .btn-copy {
      background: #2c6e2f;
      margin-top: 0.7rem;
    }

    .output-header {
      background: #f4f9fe;
      padding: 1rem 1.5rem;
      border-bottom: 1px solid #dce9f0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
    }

    .output-header h3 {
      font-weight: 700;
      color: #0f4057;
      font-size: 1.2rem;
    }

    .letter-preview {
      padding: 1.8rem;
      background: white;
      font-family: 'Georgia', 'Times New Roman', system-ui, serif;
      line-height: 1.65;
      color: #1e2f3a;
      white-space: pre-line;
      word-wrap: break-word;
      min-height: 55vh;
      max-height: 70vh;
      overflow-y: auto;
    }

    .error-toast {
      background: #ffe6e5;
      color: #b91c1c;
      padding: 0.8rem;
      border-radius: 1.2rem;
      font-size: 0.8rem;
      text-align: center;
      margin-top: 0.8rem;
      display: none;
      font-weight: 500;
    }

    footer {
      text-align: center;
      font-size: 0.7rem;
      color: #5a7b97;
      margin-top: 1rem;
    }

    @media (min-width: 900px) {
      .app-wrapper {
        flex-direction: row;
        align-items: stretch;
      }
      .form-card {
        flex: 1.2;
      }
      .output-card {
        flex: 1.5;
      }
      body {
        padding: 2rem;
      }
    }

