  * {
    box-sizing: border-box;
  }

  body {
    font-family: 'Times New Roman', Times, serif;
    margin: 0;
    padding: 12px 12px 24px;
    background:
      radial-gradient(circle at top left, #e3f2fd 0, transparent 50%),
      radial-gradient(circle at bottom right, #fce4ec 0, transparent 50%),
      #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    line-height: 1.6;
    font-size: 16px; /* base = 375×667 set */
  }


  .top-domain-bar {
  width: 100%;
  text-align: center;
  padding: 8px 0 10px;
  background: #5057760d;
  border-bottom: 1px solid #ddd;
   font-size:32px;
}

 .home-link {
  font-size: 32px;
  font-weight: 600;
  color:#1e88e5;
  text-decoration: none;
}

.home-link:hover {
  text-decoration:red;
}


  .main-layout {
    display: flex;
    flex-direction: row;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1200px;
  }

  h1 {
    margin-top: 0;
    text-align: center;
    background: linear-gradient(135deg, #1976d2, #7b1fa2);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 30px; /* 375×667 */
  }

  .left-column {
    flex: 1;
    max-width: 420px;
    min-width: 260px;
    background: rgba(255, 255, 255, 0.9);
    padding: 14px 16px 18px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(4px);
  }

  .form-group { margin-bottom: 8px; }

  label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 2px;
    font-weight: 600;
    color: #333;
  }

  .optional-note {
    color: #d32f2f;
    font-weight: 700;
    font-size: 0.78rem;
  }

  input[type="text"],
  input[type="number"],
  select {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    background-color: #fafafa;
  }

  input[type="text"]:focus,
  input[type="number"]:focus,
  select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
    background-color: #fff;
  }

  input[type="file"] {
    font-size: 0.8rem;
    padding: 2px 0;
  }

  .inline-row {
    display: flex;
    gap: 8px;
  }

  .inline-row > div { flex: 1; }

  .card-column {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    align-items:center;
    gap: 8px;
  }

  /* Row ABOVE the card: Institute / School / College name controls */
  .inst-font-panel {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 0.75rem;
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 10px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    overflow-x: auto;
  }

  .inst-font-panel .panel-title {
    font-weight: 700;
    min-width: max-content;
  }

  #instFontFamilySelect {
    font-size: 0.75rem;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #bbb;
    font-family: Georgia, 'Times New Roman', serif; /* default Georgia */
  }

  .inst-font-panel .size-label {
    font-weight: 600;
    margin-right: 4px;
    min-width: max-content;
  }

  #instFontSizeRange {
    width: 120px;
    min-width: 100px;
  }

  .card-layout-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
  }

  .card-wrapper {
    background: #ffffff;
    padding: 12px;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(0, 0, 0, 0.06);
  }

  /* -------- ID CARD PREVIEW (unchanged) -------- */

  #id-card {
    width: 340px;
    height: 215px;
    border: 2px solid #333;
    border-radius: 10px;
    padding: 6px 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(160deg, #ffffff 0%, #f3f6ff 60%, #eae7ff 100%);
    font-size: 0.92rem;
    font-family: 'Times New Roman', Times, serif;
    overflow: hidden;
    line-height: 1.08;
  }

  .card-header-full { width: 100%; }

  .inst-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    text-align: left;
    margin-bottom: 2px;
  }

  #logo-preview {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: none;
    border-radius: 50%;
  }

  #placeTitle {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.1;
    color: #1a237e;
    overflow-wrap: anywhere;
    font-family: Georgia, 'Times New Roman', serif;
  }

  .inst-address-line {
    font-size: 0.62rem;
    color: #333;
    line-height: 1.05;
    margin-bottom: 2px;
    overflow-wrap: anywhere;
    white-space: pre-line;
  }

  .card-title {
    width: 100%;
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
    color: #1a237e;
    font-size: 0.98em;
    margin-top: 1px;
    margin-bottom: 1px;
  }

  .card-body {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow: hidden;
  }

  .card-left {
    width: 28%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .id-row {
    width: 100%;
    text-align: center;
    font-size: 0.7em;
    font-weight: bold;
  }

  .photo-box {
    width: 72px;
    height: 72px;
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
  }

  #photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
  }

  .photo-placeholder {
    font-size: 0.7em;
    text-align: center;
    color: #777;
    padding: 4px;
  }

  .sign-box {
    width: 72px;
    height: 30px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
  }

  #signature-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
  }

  .sign-label {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 1px;
  }

  .card-right {
    width: 72%;
    padding-left: 6px;
    border-left: 1px solid #ddd;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-wrap: break-word;
    overflow: hidden;
  }

  .right-divider {
    width: 100%;
    border-bottom: 1px solid #1a237e;
    margin-bottom: 2px;
  }

  .card-field {
    line-height: 1.15;
    overflow-wrap: anywhere;
    font-size: 0.8rem; /* JS will scale only these */
  }

  .field-label {
    font-weight: bold;
    color: #333;
    overflow-wrap: anywhere;
  }

  .card-address-inline {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .controls-row,
  .size-format-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 10px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 520px;
  }

  .controls-row label,
  .size-format-row label {
    margin-right: 4px;
    font-size: 0.8rem;
    font-weight: 600;
  }

  .controls-row select,
  .controls-row input[type="range"] {
    font-size: 0.8rem;
  }

  .btn-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 520px;
  }

  button {
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 23px; /* H3-1px for base 375 */
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
  }

  button:active {
    transform: scale(0.97);
    box-shadow: none;
    opacity: 0.9;
  }

  #downloadBtn {
    background: linear-gradient(135deg, #43a047, #1b5e20);
    color: #fff;
    box-shadow: 0 4px 10px rgba(67, 160, 71, 0.45);
  }

  #printBtn {
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
    color: #fff;
    box-shadow: 0 4px 10px rgba(30, 136, 229, 0.45);
  }

  img.lazy {
    display: block;
    width: 100%;
    max-height: 550px;
    max-width: 950px;
    height: auto;
    margin: 0 auto 4px;
  }

  section:last-of-type p:last-child {
    margin-bottom: 0;
  }

  /* ---------- CONTENT SECTIONS BELOW CARD ---------- */

  .para {
    max-width: 1200px;
    margin: 0 auto 14px;
    padding: 0 12px;
    text-align: left;
    align-self: stretch;
  }

  .para p,
  .left-column p {
    margin: 0 0 8px;
    font-size: 16px;  /* 375×667 paragraph */
  }

  h2.para,
  section.para > h2,
  .questions > h2 {
    max-width: 1200px;
    margin: 18px auto 10px;
    padding: 0 12px;
    font-size: 27px;   /* 375×667 */
    font-weight: 700;
    text-align: left;
  }

  section.para h3 {
    margin: 14px 0 6px;
    font-size: 24px;   /* 375×667 */
    font-weight: 700;
  }

  /* ---------- FAQ ---------- */

  .questions {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 16px;
    padding: 0 12px;
    text-align: left;
    align-self: stretch;
  }

  .questions dl {
    margin: 0;
  }

  .questions dt {
    font-weight: 600;
    margin-top: 8px;
    font-size: 23px;   /* 375×667 */
  }

  .questions dd {
    margin: 0 0 4px;
    font-size: 16px;   /* 375×667 */
  }

  /* ---------- FOOTER + SHARE ---------- */

  .site-footer {
    width: 100%;
    max-width: 1200px;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #555;
  }

  .footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }

  .footer-links a {
    text-decoration: none;
    color: #1e88e5;
    font-weight: 600;
    position: relative;
    padding-bottom: 2px;
    font-size: 24px;   /* pages size 375×667 */
  }

  .footer-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #1e88e5;
    transition: width 0.2s ease;
  }

  .footer-links a:hover::after {
    width: 100%;
  }

  .share-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    align-items: center;
    max-width: 1200px;
    padding: 0 12px;
  }

  .share-btn {
    padding: 10px 16px;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 24px;       /* pages size 375×667 */
    font-weight: 600;
    display: inline-block;
  }

  .fb { background: #1877f2; }
  .wa { background: #25d366; }
  .tg { background: #0088cc; }
  .gm { background: #d44638; }
  .tw { background: #1da1f2; }
  .pn { background: #e60023; }

  html {
    scroll-behavior: smooth;
  }

  /* ======================================================
     MEDIA QUERIES – ASCENDING ORDER, YOUR EXACT RANGES
     ====================================================== */

  /* 1) up to 375px (375×667 spec – same as base, repeated for clarity) */
  @media (max-width: 375px) {

    body { font-size: 16px; }

    h1 { font-size: 30px; }

    .para p,
    .left-column,
    .left-column p,
    .left-column label,
    .left-column input[type="text"],
    .left-column input[type="number"],
    .left-column select,
    .questions dd { font-size: 16px; }

      .optional-note {
    font-size: 0.8rem;
  }

    h2.para,
    section.para > h2,
    .questions > h2 { font-size: 27px; }

    section.para h3 { font-size: 24px; }

    .questions dt { font-size: 23px; }

    .footer-links a,
    .share-btn { font-size: 24px; }

    button { font-size: 23px; }

    /* layout helpers */
    .main-layout {
      flex-direction: column;
      align-items: stretch;
    }
    .left-column,
    .card-column {
      max-width: 100%;
    }
    .card-wrapper {
      margin: 0 auto;
    }
    #id-card {
      transform: scale(0.8);
      transform-origin: top center;
      margin: 0 auto;
    }
    .inst-font-panel {
      gap: 6px;
      padding: 4px 6px;
    }
    #instFontSizeRange {
      width: 100px;
      min-width: 90px;
    }
    .share-btn {
      flex: 1 1 45%;
      text-align: center;
    }
  }

  /* 2) 376px – 413px : same typography as 375 group */
  @media (min-width: 376px) and (max-width: 413px) {

    body { font-size: 16px; }

    h1 { font-size: 30px; }

    .para p,
    .left-column,
    .left-column p,
    .left-column label,
    .left-column input[type="text"],
    .left-column input[type="number"],
    .left-column select,
    .questions dd { font-size: 16px; }
        .optional-note {
    font-size: 0.83rem;
  }

    h2.para,
    section.para > h2,
    .questions > h2 { font-size: 27px; }

    section.para h3 { font-size: 24px; }

    .questions dt { font-size: 23px; }

    .footer-links a,
    .share-btn { font-size: 24px; }

    button { font-size: 23px; }

    .main-layout {
      flex-direction: column;
      align-items: stretch;
    }
    .left-column,
    .card-column {
      max-width: 100%;
    }
    .card-wrapper {
      margin: 0 auto;
    }
    #id-card {
      transform: scale(0.9);
      transform-origin: top center;
      margin: 0 auto;
    }
    .share-btn {
      flex: 1 1 45%;
      text-align: center;
    }
  }

  /* 3) 414px – 599px  (414×896 spec) */
  @media (min-width: 414px) and (max-width: 599px) {

    body { font-size: 17px; }

    h1 { font-size: 32px; }

    .para p,
    .left-column,
    .left-column p,
    .left-column label,
    .left-column input[type="text"],
    .left-column input[type="number"],
    .left-column select,
    .questions dd { font-size: 17px; }
     .optional-note{font-size:17px;}

    h2.para,
    section.para > h2,
    .questions > h2 { font-size: 29px; }

    section.para h3 { font-size: 26px; }

    .questions dt { font-size: 25px; }

    .footer-links a,
    .share-btn { font-size: 26px; }

    button { font-size: 25px; }

    .main-layout {
      flex-direction: column;
      align-items: stretch;
    }
    .left-column,
    .card-column {
      max-width: 100%;
    }
    .card-wrapper {
      margin: 0 auto;
    }
    .share-btn {
      flex: 1 1 45%;
      text-align: center;
    }
  }

  /* 4) 600px – 719px  (Above 600×900 spec) */
  @media (min-width: 600px) and (max-width: 719px) {

    body { font-size: 18px; }

    h1 { font-size: 36px; }

    .para p,
    .left-column,
    .left-column p,
    .left-column label,
    .left-column input[type="text"],
    .left-column input[type="number"],
    .left-column select,
    .questions dd { font-size: 18px; }

        .optional-note {
    font-size: 18px;
  }

    h2.para,
    section.para > h2,
    .questions > h2 { font-size: 31px; }

    section.para h3 { font-size: 28px; }

    .questions dt { font-size: 27px; }

    .footer-links a,
    .share-btn { font-size: 28px; }

    button { font-size: 27px; }
  }

  /* 5) 720px – 1020px  (tablet / small laptop – same values as 600–719) */
  @media (min-width: 720px) and (max-width: 1020px) {

    body { font-size: 18px; }

    h1 { font-size: 36px; }

    .para p,
    .left-column,
    .left-column p,
    .left-column label,
    .left-column input[type="text"],
    .left-column input[type="number"],
    .left-column select,
    .questions dd { font-size: 18px; }

        .optional-note {
    font-size: 18px;
  }

    h2.para,
    section.para > h2,
    .questions > h2 { font-size: 31px; }

    section.para h3 { font-size: 28px; }

    .questions dt { font-size: 27px; }

    .footer-links a,
    .share-btn { font-size: 28px; }

    button { font-size: 27px; }
  }

  /* 6) 1021px – 1500px  (desktop spec) */
  @media (min-width: 1021px) and (max-width: 1500px) {

    body { font-size: 22px; }

    h1 { font-size: 42px; }

    .para p,
    .left-column,
    .left-column p,
    .left-column label,
    .left-column input[type="text"],
    .left-column input[type="number"],
    .left-column select,
    .questions dd { font-size: 22px; }

        .optional-note{font-size:22px;}

    h2.para,
    section.para > h2,
    .questions > h2 { font-size: 35px; }

    section.para h3 { font-size: 31px; }

    .questions dt { font-size: 30px; }

    .footer-links a,
    .share-btn { font-size: 31px; }

    button { font-size: 30px; }
  }

  /* extra layout helpers kept from your old file */

  @media (min-width: 901px) and (max-width: 1280px) {
    body {
      padding: 16px 20px 24px;
    }
    .left-column,
    .card-column {
      max-width: 900px;
    }
  }

  @media (min-width: 1024px) {
    body {
      padding-left: 80px;
      padding-right: 40px;
    }
  }
