/* EduGradUP free tools (/tools/*). Every class is egu-* so it never depends on
   the purged Tailwind build. Mobile first; print shows only #egu-print-root. */

.egu-tool { background: #f9fafb; padding: 24px 0 40px; }
.egu-tool-wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.egu-tool-wrap > *, .egu-grid > *, .egu-fieldset { min-width: 0; }
@media (min-width: 1024px) {
  .egu-tool-wrap { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); align-items: start; }
  .egu-preview-col { position: sticky; top: 84px; }
}

.egu-privacy { display: flex; gap: 8px; align-items: flex-start; background: #ecfdf5; border: 1px solid #a7f3d0;
  color: #065f46; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.45; margin-bottom: 14px; }

/* ── form ─────────────────────────────────────────────── */
.egu-form { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 16px; }
.egu-fieldset { border: 0; margin: 0 0 14px; padding: 0; }
.egu-legend { font-weight: 800; color: #4c1d95; font-size: 15px; margin-bottom: 8px; padding: 0; }
.egu-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 480px) { .egu-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .egu-span2 { grid-column: span 2; } }
.egu-field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.egu-field input, .egu-field select, .egu-field textarea {
  width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px;
  font-size: 16px; /* 16px stops iOS zoom on focus */ background: #fff; color: #111827; font-family: inherit; }
.egu-field textarea { min-height: 64px; resize: vertical; }
.egu-field input:focus, .egu-field select:focus, .egu-field textarea:focus { outline: 2px solid #8b5cf6; border-color: #8b5cf6; }
.egu-check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: #374151; margin: 6px 0; }
.egu-check input { width: 18px; height: 18px; }
.egu-hint { font-size: 12px; color: #6b7280; margin-top: 3px; }

.egu-fee-row { display: grid; grid-template-columns: 1fr 110px 40px; gap: 8px; margin-bottom: 8px; }
.egu-fee-row input { border: 1px solid #d1d5db; border-radius: 10px; padding: 10px; font-size: 16px; min-width: 0; }
.egu-icon-btn { border: 1px solid #e5e7eb; background: #fff; border-radius: 10px; font-size: 18px; color: #b91c1c; cursor: pointer; }

.egu-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px;
  padding: 10px 14px; font-weight: 700; font-size: 15px; cursor: pointer; border: 1px solid #d1d5db; background: #fff;
  color: #374151; min-height: 44px; }
.egu-btn-primary { background: #6d28d9; color: #fff; border-color: #6d28d9; }
.egu-btn-primary:hover { background: #5b21b6; }
.egu-btn-ghost { border-style: dashed; color: #6d28d9; border-color: #a78bfa; width: 100%; }

/* ── toolbar + preview ───────────────────────────────── */
.egu-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.egu-seg { display: inline-flex; border: 1px solid #d1d5db; border-radius: 10px; overflow: hidden; background: #fff; }
.egu-seg button { border: 0; background: transparent; padding: 9px 12px; font-size: 14px; font-weight: 700; color: #4b5563;
  cursor: pointer; min-height: 40px; }
.egu-seg button[aria-pressed="true"] { background: #ede9fe; color: #5b21b6; }
.egu-seg-label { font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.egu-toolbar .egu-btn-primary { margin-left: auto; }
@media (max-width: 479px) { .egu-toolbar .egu-btn-primary { margin-left: 0; width: 100%; } }

.egu-paper { background: #e5e7eb; border-radius: 16px; padding: 12px; overflow-x: auto; }
.egu-doc { background: #fff; color: #111; margin: 0 auto; box-shadow: 0 4px 18px rgba(0,0,0,.12);
  font-family: "Times New Roman", "Noto Serif Devanagari", "Kohinoor Devanagari", "Mangal", serif;
  padding: 18px; box-sizing: border-box; width: 100%; max-width: 794px; font-size: 13px; line-height: 1.45; }
.egu-doc.egu-size-A5 { max-width: 559px; font-size: 12px; }
.egu-doc.egu-lang-hi { font-family: "Noto Serif Devanagari", "Kohinoor Devanagari", "Mangal", "Nirmala UI", serif; }

/* ── document parts ──────────────────────────────────── */
.egu-lh { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 8px; }
.egu-lh-logo { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.egu-lh-text { flex: 1; text-align: center; }
.egu-lh-name { font-size: 1.55em; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; line-height: 1.2; }
.egu-lang-hi .egu-lh-name { text-transform: none; }
.egu-lh-addr { font-size: .92em; }
.egu-lh-meta { font-size: .85em; margin-top: 2px; }
.egu-doc-title { text-align: center; font-weight: 800; font-size: 1.2em; letter-spacing: .08em; margin: 8px 0 4px;
  text-decoration: underline; text-underline-offset: 4px; }
.egu-doc-sub { text-align: center; font-size: .9em; margin-bottom: 8px; }
.egu-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin: 8px 0; }
.egu-kv { display: flex; gap: 6px; border-bottom: 1px dotted #9ca3af; padding: 3px 0; min-width: 0; }
.egu-k { font-weight: 700; white-space: nowrap; }
.egu-v { overflow-wrap: anywhere; }
.egu-table, .egu-tc-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.egu-table th, .egu-table td, .egu-tc-table td { border: 1px solid #111; padding: 4px 6px; vertical-align: top; }
.egu-table th { background: #f3f4f6; }
.egu-table tfoot td { font-weight: 600; }
.egu-total td { font-weight: 800; font-size: 1.05em; background: #f3f4f6; }
.egu-c { text-align: center; width: 44px; }
.egu-r { text-align: right; }
.egu-words, .egu-mode { margin: 6px 0; }
.egu-signs { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; }
.egu-signs-3 .egu-sign { flex: 1; }
.egu-sign { border-top: 1px solid #111; padding-top: 4px; min-width: 120px; text-align: center; font-size: .92em; }
.egu-sign-right { margin-left: auto; }
.egu-note { font-size: .8em; color: #374151; margin-top: 10px; text-align: center; }
.egu-copy-tag { float: right; font-size: .75em; border: 1px solid #111; padding: 1px 6px; border-radius: 4px; }
.egu-cut { border-top: 1px dashed #6b7280; margin: 14px 0; }
.egu-top-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: .92em; margin: 4px 0; }
.egu-tc-table .egu-num { width: 28px; }
.egu-tc-table .egu-label { width: 52%; }
.egu-tc-table .egu-val { font-weight: 600; }
.egu-letter .egu-cert-body { margin: 18px 4px; font-size: 1.12em; line-height: 1.9; text-align: justify; }
.egu-cert-p { margin: 0 0 12px; text-indent: 2em; }
.egu-cert-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 48px; }
.egu-small { font-size: .8em; }

/* ── related tools / index cards ─────────────────────── */
.egu-cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .egu-cards { grid-template-columns: 1fr 1fr; } }
.egu-card { display: block; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 18px; text-decoration: none; color: #111827; }
.egu-card:hover { box-shadow: 0 6px 20px rgba(76,29,149,.12); border-color: #c4b5fd; }
.egu-card-title { font-weight: 800; color: #5b21b6; font-size: 18px; display: block; margin-bottom: 4px; }
.egu-card-text { font-size: 14px; color: #4b5563; display: block; }

#egu-print-root { display: none; }

@media print {
  body > *:not(#egu-print-root) { display: none !important; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  #egu-print-root { display: block !important; }
  #egu-print-root .egu-doc { box-shadow: none; max-width: none; width: 100%; padding: 0; margin: 0; }
  .egu-two-up .egu-receipt { page-break-inside: avoid; break-inside: avoid; }
  .egu-table th, .egu-total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
