/* ==========================================================
   MGBLOG Tools — Shared Stylesheet  v3.0
   Design: Green Gradient #0c8743→#16a34a  |  Dark-mode ready
   Mobile-first  |  All tools depend on this file
   ========================================================== */

/* ─── TOOL PAGE WRAPPER ─────────────────────────────────── */
.tool-page {
  padding: 16px 0 40px;
}

/* ─── TOOL PAGE HEADER ──────────────────────────────────── */
.tool-page-header {
  text-align: center;
  padding: 28px 20px 20px;
  margin-bottom: 20px;
}

.tool-page-header h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  color: #111;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-page-header h1 .fa {
  color: #0c8743;
  font-size: 1.6rem;
}

.tool-page-header p {
  font-size: 1rem;
  color: #555;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── SPEC BADGES (200×250 px, Max 15KB, JPG) ───────────── */
.spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #0c8743, #16a34a);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin: 4px 3px;
  box-shadow: 0 2px 6px rgba(12, 135, 67, .3);
  letter-spacing: .2px;
}

.cat-badge {
  background: linear-gradient(135deg, #1565c0, #1976d2);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-left: 8px;
  vertical-align: middle;
}

/* ─── LANGUAGE SWITCHER BAR ─────────────────────────────── */
.tool-lang-bar,
.lang-switch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tool-lang-label {
  font-size: .82rem;
  color: #555;
  font-weight: 700;
  margin-right: 6px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* All lang button variants ─────────────────────────────── */
.lang-btn,
.mgb-lang-btn,
button[data-lang] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 14px;
  border: 2px solid var(--clr-primary, #0c8743);
  border-radius: 20px;
  background: var(--clr-bg, #fff);
  color: var(--clr-primary, #0c8743);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
  min-height: 30px;
  text-decoration: none;
  outline: none;
  box-shadow: none;
  font-family: inherit;
}

.lang-btn:hover,
.mgb-lang-btn:hover,
button[data-lang]:hover {
  background: var(--clr-primary, #0c8743);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

/* ACTIVE state — primary color */
.lang-btn.active,
.mgb-lang-btn.active,
button[data-lang].active {
  background: var(--clr-primary, #0c8743) !important;
  color: #fff !important;
  border-color: var(--clr-primary, #0c8743) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18) !important;
  transform: translateY(-1px);
}

/* Dark mode */
[data-theme="dark"] .tool-lang-bar,
[data-theme="dark"] .lang-switch {
  background: rgba(0, 0, 0, .08);
  border-color: rgba(255, 255, 255, .1);
}

[data-theme="dark"] .lang-btn,
[data-theme="dark"] .mgb-lang-btn,
[data-theme="dark"] button[data-lang] {
  background: transparent;
  color: var(--clr-primary, #4ade80);
  border-color: var(--clr-primary, #4ade80);
}

[data-theme="dark"] .lang-btn.active,
[data-theme="dark"] .mgb-lang-btn.active,
[data-theme="dark"] button[data-lang].active {
  background: var(--clr-primary, #4ade80) !important;
  color: #000 !important;
  border-color: var(--clr-primary, #4ade80) !important;
}

/* ─── EXAM / OJAS TABS ──────────────────────────────────── */
.ojas-tabs,
.exam-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ojas-tab,
.exam-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 2px solid #c8e6c9;
  border-radius: 24px;
  color: #555;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .2s;
  background: #fff;
  cursor: pointer;
}

.ojas-tab:hover,
.exam-tab:hover {
  border-color: #0c8743;
  color: #0c8743;
  background: #f0fdf4;
}

.ojas-tab.active,
.exam-tab.active {
  background: linear-gradient(135deg, #0c8743, #16a34a);
  color: #fff;
  border-color: #0c8743;
  box-shadow: 0 2px 8px rgba(12, 135, 67, .3);
}

[data-theme="dark"] .ojas-tab,
[data-theme="dark"] .exam-tab {
  background: #1a2416;
  color: #aaa;
  border-color: #2a3a2a;
}

/* ─── INFO / DISCLAIMER BOX ─────────────────────────────── */
.tool-info-box {
  background: #f0fdf4;
  border: 1.5px solid #c8e6c9;
  border-left: 4px solid #0c8743;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: .88rem;
  line-height: 1.6;
}

.tool-info-box strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #0c8743;
  font-size: .9rem;
  margin-bottom: 8px;
}

.tool-info-box ul {
  list-style: disc;
  padding-left: 18px;
  margin: 0;
  color: #333;
}

.tool-info-box ul li {
  margin-bottom: 3px;
}

.disclaimer-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  border-left: 4px solid #f9a825;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: .82rem;
  color: #555;
  line-height: 1.55;
}

.disclaimer-box .fa {
  color: #f9a825;
  margin-top: 2px;
  flex-shrink: 0;
  font-size: 1rem;
}

[data-theme="dark"] .tool-info-box {
  background: #162d1e;
  border-color: #2a4a2a;
}

[data-theme="dark"] .disclaimer-box {
  background: #2a2200;
  border-color: #5a4500;
}

/* ─── UPLOAD ZONE ───────────────────────────────────────── */
.upload-zone {
  border: 2.5px dashed #0c8743;
  border-radius: 14px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  background: #f9fffe;
  margin-bottom: 16px;
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #16a34a;
  background: linear-gradient(135deg, #f0fdf4, #e8f5e9);
  box-shadow: 0 4px 20px rgba(12, 135, 67, .15);
  transform: translateY(-2px);
}

.upload-icon-wrap {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #0c8743, #16a34a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 4px 16px rgba(12, 135, 67, .35);
}

.upload-icon-wrap .fa {
  color: #fff;
  font-size: 1.6rem;
}

.upload-zone h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 6px;
}

.upload-zone p {
  font-size: .85rem;
  color: #777;
  margin: 0;
}

.upload-zone .file-label {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 22px;
  background: linear-gradient(135deg, #0c8743, #16a34a);
  color: #fff;
  border-radius: 24px;
  font-weight: 700;
  font-size: .88rem;
  box-shadow: 0 2px 8px rgba(12, 135, 67, .3);
}

[data-theme="dark"] .upload-zone {
  background: #0f1f14;
  border-color: #2a5a2a;
}

[data-theme="dark"] .upload-zone:hover {
  background: #162d1e;
}

[data-theme="dark"] .upload-zone h3 {
  color: #e0e0e0;
}

/* ─── CROP AREA ──────────────────────────────────────────── */
.crop-area {
  display: none;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.crop-wrap {
  max-height: 320px;
  overflow: hidden;
  border-radius: 8px;
  background: #f5f5f5;
}

.crop-wrap img {
  display: block;
  max-width: 100%;
}

.adj-row,
.brightness-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: .85rem;
}

.adj-row label,
.brightness-control label {
  min-width: 90px;
  font-weight: 600;
  color: #444;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.adj-row input[type=range],
.brightness-control input[type=range] {
  flex: 1;
  accent-color: #0c8743;
  cursor: pointer;
}

.adj-row span,
.brightness-control span {
  min-width: 30px;
  text-align: right;
  font-size: .78rem;
  font-weight: 700;
  color: #0c8743;
}

[data-theme="dark"] .crop-area {
  background: #1a2416;
  border-color: #2a3a2a;
}

[data-theme="dark"] .crop-wrap {
  background: #0f1f14;
}

/* ─── CONTROLS GRID (age calc, compress, etc.) ──────────── */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-group label {
  font-size: .85rem;
  font-weight: 700;
  color: #444;
}

.ctrl-group input,
.ctrl-group select,
.ctrl-group textarea,
.form-inp,
.q-input,
.calc-input,
.emi-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: .95rem;
  outline: none;
  transition: border .2s, box-shadow .2s;
  box-sizing: border-box;
  background: #fff;
  color: #111;
}

.ctrl-group input:focus,
.ctrl-group select:focus,
.ctrl-group textarea:focus,
.form-inp:focus,
.q-input:focus,
.calc-input:focus,
.emi-input:focus {
  border-color: #0c8743;
  box-shadow: 0 0 0 3px rgba(12, 135, 67, .12);
}

.q-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: .9rem;
  min-height: 100px;
  resize: vertical;
  outline: none;
  transition: border .2s;
  box-sizing: border-box;
  background: #fff;
  color: #111;
}

.q-textarea:focus {
  border-color: #0c8743;
  box-shadow: 0 0 0 3px rgba(12, 135, 67, .12);
}

.q-label,
.emi-label {
  font-size: .85rem;
  font-weight: 700;
  color: #444;
  display: block;
  margin-bottom: 6px;
}

.q-group,
.emi-group {
  margin-bottom: 14px;
}

[data-theme="dark"] .ctrl-group input,
[data-theme="dark"] .ctrl-group select,
[data-theme="dark"] .ctrl-group textarea,
[data-theme="dark"] .q-input,
[data-theme="dark"] .q-textarea,
[data-theme="dark"] .form-inp,
[data-theme="dark"] .emi-input {
  background: #1a2416;
  border-color: #2a3a2a;
  color: #e0e0e0;
}

/* ─── TOOL BUTTONS ───────────────────────────────────────── */
.tool-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-tool-primary,
.btn-generate,
.btn-primary {
  background: linear-gradient(135deg, #0c8743, #16a34a);
  color: #fff;
  box-shadow: 0 4px 12px rgba(12, 135, 67, .3);
  flex: 1;
}

.btn-tool-primary:hover,
.btn-generate:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, #0a7038, #158040);
  box-shadow: 0 6px 18px rgba(12, 135, 67, .4);
  transform: translateY(-1px);
}

.btn-tool-secondary,
.btn-secondary {
  background: #fff;
  color: #0c8743;
  border: 2px solid #0c8743;
  flex: 1;
}

.btn-tool-secondary:hover,
.btn-secondary:hover {
  background: #f0fdf4;
  transform: translateY(-1px);
}

.btn-tool-download,
.btn-download {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, #0c8743, #16a34a);
  color: #fff;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(12, 135, 67, .3);
  transition: all .2s;
  margin-top: 14px;
}

.btn-tool-download:hover,
.btn-download:hover {
  background: linear-gradient(135deg, #0a7038, #158040);
  box-shadow: 0 6px 18px rgba(12, 135, 67, .4);
  transform: translateY(-1px);
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  background: #0c8743;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.btn-sm:hover {
  background: #0a7038;
}

.btn-outline {
  background: #fff;
  border: 2px solid #0c8743;
  color: #0c8743;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.btn-outline:hover {
  background: #f0fdf4;
}

[data-theme="dark"] .btn-tool-secondary,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-outline {
  background: #1a2416;
  border-color: #3a6a3a;
}

/* ─── RESULT / STATUS AREA ───────────────────────────────── */
.result-area {
  display: none;
  text-align: center;
  padding: 20px;
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e0e0e0;
  margin-bottom: 16px;
}

.result-preview {
  display: flex;
  justify-content: center;
  margin: 14px 0;
}

.result-preview img {
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}

.tool-status {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
}

.tool-status.success {
  background: #f0fdf4;
  border: 1.5px solid #c8e6c9;
  color: #0c8743;
}

.tool-status.warning {
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  color: #e65100;
}

.tool-status.error {
  background: #fff0f0;
  border: 1.5px solid #ffcdd2;
  color: #c62828;
}

[data-theme="dark"] .result-area {
  background: #1a2416;
  border-color: #2a3a2a;
}

/* ─── RES-BOX (result card with gradient) ────────────────── */
.res-box {
  background: linear-gradient(135deg, #0c8743, #16a34a);
  color: #fff;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}

.res-title {
  font-size: .9rem;
  font-weight: 600;
  opacity: .85;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.res-val {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.1;
}

.res-sec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .2);
  padding-top: 14px;
  gap: 4px;
}

.res-sec-val {
  font-size: 1.2rem;
  font-weight: 800;
}

.res-sec-lbl {
  font-size: .76rem;
  opacity: .8;
}

.res-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .2);
  padding-top: 12px;
}

.res-b-item {
  padding: 0 10px;
  border-right: 1px solid rgba(255, 255, 255, .2);
  text-align: center;
}

.res-b-item:last-child {
  border-right: none;
}

.res-b-title {
  font-size: .72rem;
  opacity: .8;
  margin-bottom: 4px;
}

.res-b-val {
  font-size: 1rem;
  font-weight: 800;
}

/* ─── PANELS (generic card panels) ──────────────────────── */
.tool-panel,
.emi-panel,
.calc-panel {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  margin-bottom: 16px;
}

.tool-panel h3,
.emi-panel h3,
.calc-panel h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #111;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-panel h3 .fa,
.emi-panel h3 .fa,
.calc-panel h3 .fa {
  color: #0c8743;
}

[data-theme="dark"] .tool-panel,
[data-theme="dark"] .emi-panel,
[data-theme="dark"] .calc-panel {
  background: #1a2416;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}

[data-theme="dark"] .tool-panel h3,
[data-theme="dark"] .emi-panel h3,
[data-theme="dark"] .calc-panel h3 {
  color: #e0e0e0;
}

/* ─── EMI / CALC GRID ────────────────────────────────────── */
.emi-grid,
.qr-grid,
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.emi-btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.emi-type-btn {
  flex: 1;
  padding: 9px 6px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  color: #555;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.emi-type-btn.active,
.emi-type-btn:hover {
  background: #0c8743;
  color: #fff;
  border-color: #0c8743;
}

.emi-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.emi-symbol {
  position: absolute;
  left: 12px;
  color: #777;
  font-weight: 700;
}

.emi-symbol.right {
  left: auto;
  right: 12px;
}

.emi-input {
  padding-left: 28px;
}

[data-theme="dark"] .emi-type-btn {
  background: #1a2416;
  border-color: #2a3a2a;
  color: #aaa;
}

/* ─── CHARTS ──────────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 200px;
  max-width: 260px;
  margin: 0 auto;
}

.chart-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  font-size: .75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .9);
}

/* ─── AMORTIZATION TABLE ─────────────────────────────────── */
.amort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.amort-table th {
  background: #f5f5f5;
  padding: 8px;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid #e0e0e0;
}

.amort-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #f0f0f0;
}

.amort-table tr:last-child td {
  border-bottom: none;
}

[data-theme="dark"] .amort-table th {
  background: #1a2416;
  border-color: #2a3a2a;
}

[data-theme="dark"] .amort-table td {
  border-color: #1f2f1f;
}

/* ─── QR TABS / FORMS ────────────────────────────────────── */
.qr-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.qr-tab {
  padding: 6px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: #555;
  transition: all .2s;
}

.qr-tab.active,
.qr-tab:hover {
  border-color: #0c8743;
  color: #0c8743;
  background: #f0fdf4;
}

.qr-tab.active {
  background: #0c8743;
  color: #fff;
}

.qr-form {
  display: none;
}

.qr-form.active {
  display: block;
}

.qr-display-box {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  text-align: center;
}

#qrcode {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.color-picker-wrap {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 12px;
}

.cp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 600;
}

[data-theme="dark"] .qr-display-box {
  background: #1a2416;
}

[data-theme="dark"] .qr-tab {
  background: #1a2416;
  border-color: #2a3a2a;
  color: #aaa;
}

/* ─── PERCENTAGE CALC TABS ───────────────────────────────── */
.pct-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pct-tab {
  padding: 6px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: #555;
  transition: all .2s;
}

.pct-tab.active {
  background: #0c8743;
  color: #fff;
  border-color: #0c8743;
}

.pct-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  margin-bottom: 14px;
}

.pct-result {
  background: linear-gradient(135deg, #0c8743, #16a34a);
  color: #fff;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}

.pct-res-val {
  font-size: 2rem;
  font-weight: 900;
}

.pct-res-lbl {
  font-size: .85rem;
  opacity: .85;
}

[data-theme="dark"] .pct-card {
  background: #1a2416;
}

/* ─── CGPA CONTROLS ──────────────────────────────────────── */
.cgpa-panel {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  margin-bottom: 16px;
}

.cgpa-sem-block {
  border: 1.5px solid #e8f5e9;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.cgpa-sem-title {
  font-weight: 800;
  color: #0c8743;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cgpa-sub-row {
  display: grid;
  grid-template-columns: 2fr 80px 80px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: .83rem;
}

[data-theme="dark"] .cgpa-panel {
  background: #1a2416;
}

[data-theme="dark"] .cgpa-sem-block {
  border-color: #2a3a2a;
}

/* ─── COVER LETTER / RESUME STEPS ───────────────────────── */
.cl-steps,
.resume-steps {
  display: flex;
  margin-bottom: 20px;
  overflow-x: auto;
  border-bottom: 2px solid #e8f5e9;
}

.cl-step,
.resume-step {
  flex: 1 0 auto;
  padding: 10px 12px;
  text-align: center;
  font-size: .8rem;
  font-weight: 700;
  color: #999;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  margin-bottom: -2px;
  transition: .2s;
}

.cl-step.active,
.resume-step.active {
  color: #0c8743;
  border-color: #0c8743;
}

.cl-form,
.resume-form {
  display: none;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

.cl-form.active,
.resume-form.active {
  display: block;
}

.cl-preview,
.resume-preview {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 24px;
  min-height: 300px;
  font-family: Georgia, serif;
  font-size: .9rem;
  line-height: 1.7;
  color: #222;
}

[data-theme="dark"] .cl-form,
[data-theme="dark"] .resume-form {
  background: #1a2416;
}

[data-theme="dark"] .cl-preview,
[data-theme="dark"] .resume-preview {
  background: #1a2416;
  border-color: #2a3a2a;
  color: #ddd;
}

/* ─── INVOICE ─────────────────────────────────────────────── */
.inv-section {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
  margin-bottom: 14px;
}

.inv-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.inv-table th {
  background: #f5f5f5;
  padding: 9px;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid #e0e0e0;
}

.inv-table td {
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.inv-table input {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 5px 8px;
  width: 100%;
  font-size: .85rem;
  box-sizing: border-box;
}

[data-theme="dark"] .inv-section {
  background: #1a2416;
}

[data-theme="dark"] .inv-table th {
  background: #162d1e;
  border-color: #2a3a2a;
}

/* ─── PDF / IMAGE UPLOAD SLOTS ───────────────────────────── */
.upload-slot {
  border: 2px dashed #c8e6c9;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  background: #fafffe;
}

.upload-slot:hover {
  border-color: #0c8743;
  background: #f0fdf4;
}

.wm-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
  margin-bottom: 14px;
}

.wm-tab {
  padding: 6px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: #555;
  transition: .2s;
}

.wm-tab.active {
  background: #0c8743;
  color: #fff;
  border-color: #0c8743;
}

.wm-preview-area {
  background: #f5f5f5;
  border: 1px dashed #ccc;
  border-radius: 8px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .wm-panel,
[data-theme="dark"] .upload-slot {
  background: #1a2416;
  border-color: #2a3a2a;
}

/* ─── ATTEST / THUMB / SIGNATURE TOOLS ──────────────────── */
.attest-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
  margin-bottom: 14px;
}

.sig-canvas-wrap {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
  background: #fff;
  touch-action: none;
}

.sig-canvas-ctrl {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.thumb-wrap {
  border: 2px dashed #c8e6c9;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  background: #fafffe;
}

.thumb-wrap:hover {
  border-color: #0c8743;
  background: #f0fdf4;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.thumb-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.thumb-card img {
  width: 100%;
  display: block;
}

.thumb-card-info {
  padding: 8px;
  font-size: .78rem;
  color: #555;
  text-align: center;
}

.thumb-dl-btn {
  display: block;
  padding: 6px;
  background: #0c8743;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 700;
  width: 100%;
}

[data-theme="dark"] .attest-panel,
[data-theme="dark"] .thumb-wrap,
[data-theme="dark"] .thumb-card {
  background: #1a2416;
  border-color: #2a3a2a;
}

/* ─── ADHAR MERGE / PASSPORT SHEET ──────────────────────── */
.aadhar-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
  margin-bottom: 14px;
}

/* ─── MP-ESB TEMPLATE ────────────────────────────────────── */
.esb-preview {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  min-height: 300px;
}

[data-theme="dark"] .esb-preview {
  background: #1a2416;
  border-color: #2a3a2a;
  color: #ddd;
}

/* ─── TOOL ARTICLE (SEO content) ────────────────────────── */
.tool-article {
  padding: 30px 0;
  border-top: 1px solid #eee;
  margin-top: 20px;
  font-size: .95rem;
  color: #333;
  line-height: 1.7;
}

.tool-article h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #111;
  margin-bottom: 12px;
}

.tool-article h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #222;
  margin: 14px 0 8px;
}

.tool-article ul,
.tool-article ol {
  list-style: initial;
  padding-left: 18px;
  margin-bottom: 12px;
}

.tool-article ol {
  list-style: decimal;
}

.tool-article ul li,
.tool-article ol li {
  margin-bottom: 4px;
}

.tool-article p {
  margin-bottom: 10px;
}

[data-theme="dark"] .tool-article {
  color: #ccc;
  border-top-color: #2a3a2a;
}

[data-theme="dark"] .tool-article h2 {
  color: #e0e0e0;
}

/* ─── SPECS TABLE ────────────────────────────────────────── */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  margin-bottom: 14px;
}

.specs-table thead th {
  background: linear-gradient(135deg, #0c8743, #16a34a);
  color: #fff;
  padding: 10px;
  text-align: left;
  font-weight: 700;
}

.specs-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

.specs-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid #f0f0f0;
}

[data-theme="dark"] .specs-table tbody tr:nth-child(even) {
  background: #162d1e;
}

[data-theme="dark"] .specs-table tbody td {
  border-color: #2a3a2a;
  color: #ccc;
}

/* ─── RELATED TOOLS ──────────────────────────────────────── */
.related-tools {
  padding: 24px 0 0;
  margin-top: 24px;
  border-top: 2px solid #e8f5e9;
}

.related-tools h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #111;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-tools h2 .fa {
  color: #0c8743;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.related-tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  background: #fff;
  border: 1.5px solid #e8f5e9;
  border-radius: 12px;
  text-decoration: none;
  color: #222;
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.related-tool-card .fa {
  font-size: 1.5rem;
  color: #0c8743;
}

.related-tool-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.related-tool-card:hover {
  border-color: #0c8743;
  background: #f0fdf4;
  box-shadow: 0 4px 16px rgba(12, 135, 67, .2);
  transform: translateY(-2px);
  color: #0c8743;
}

[data-theme="dark"] .related-tools {
  border-top-color: #2a3a2a;
}

[data-theme="dark"] .related-tools h2 {
  color: #e0e0e0;
}

[data-theme="dark"] .related-tool-card {
  background: #1a2416;
  border-color: #2a3a2a;
  color: #ccc;
}

[data-theme="dark"] .related-tool-card:hover {
  background: #162d1e;
}

/* ─── TOOLS INDEX PAGE ───────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  background: #fff;
  border: 1.5px solid #e8f5e9;
  border-radius: 14px;
  text-decoration: none;
  color: #111;
  transition: all .2s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.tool-card:hover {
  border-color: #0c8743;
  box-shadow: 0 6px 24px rgba(12, 135, 67, .18);
  transform: translateY(-3px);
}

.tool-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0fdf4, #e8f5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #c8e6c9;
}

.tool-icon .fa {
  font-size: 1.5rem;
  color: #0c8743;
}

.tool-icon img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
}

.tool-name {
  font-size: .82rem;
  font-weight: 800;
  color: #111;
  text-align: center;
  line-height: 1.3;
}

.tool-desc {
  font-size: .73rem;
  color: #777;
  text-align: center;
  line-height: 1.3;
}

[data-theme="dark"] .tools-grid .tool-card {
  background: #1a2416;
  border-color: #2a3a2a;
}

[data-theme="dark"] .tools-grid .tool-card:hover {
  border-color: #3a6a3a;
  background: #162d1e;
}

[data-theme="dark"] .tool-icon {
  background: #162d1e;
  border-color: #2a3a2a;
}

[data-theme="dark"] .tool-name {
  color: #e0e0e0;
}

[data-theme="dark"] .tool-desc {
  color: #888;
}

/* ─── WORD COUNTER / TEXT TOOLS ──────────────────────────── */
.wc-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.wc-stat {
  background: linear-gradient(135deg, #f0fdf4, #e8f5e9);
  border: 1.5px solid #c8e6c9;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.wc-stat-val {
  font-size: 1.4rem;
  font-weight: 900;
  color: #0c8743;
}

.wc-stat-lbl {
  font-size: .72rem;
  color: #666;
  margin-top: 4px;
}

.case-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

/* ─── JSON / HTML TOOLS ──────────────────────────────────── */
.code-area {
  width: 100%;
  min-height: 160px;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: .85rem;
  resize: vertical;
  outline: none;
  transition: border .2s;
  box-sizing: border-box;
  background: #fafafa;
  color: #111;
}

.code-area:focus {
  border-color: #0c8743;
  box-shadow: 0 0 0 3px rgba(12, 135, 67, .12);
}

[data-theme="dark"] .code-area {
  background: #0f1f14;
  border-color: #2a3a2a;
  color: #c8e6c9;
}

/* ─── PROGRESS BAR ───────────────────────────────────────── */
.progress-wrap {
  background: #e8f5e9;
  border-radius: 8px;
  overflow: hidden;
  height: 8px;
  margin: 12px 0;
}

.progress-bar {
  height: 8px;
  background: linear-gradient(90deg, #0c8743, #16a34a);
  width: 0%;
  transition: width .3s;
  border-radius: 8px;
}

.progress-msg {
  font-size: .8rem;
  color: #777;
  margin-top: 6px;
  text-align: center;
}

/* ─── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  color: #888;
  margin-bottom: 16px;
  padding: 8px 0;
}

.breadcrumb a {
  color: #0c8743;
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .sep {
  color: #ccc;
}

/* ─── COPY BUTTON ────────────────────────────────────────── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: #0c8743;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}

.copy-btn:hover {
  background: #0a7038;
}

.copy-btn.copied {
  background: #16a34a;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════════════════════════ */
@media(max-width:768px) {

  .emi-grid,
  .qr-grid,
  .calc-grid {
    grid-template-columns: 1fr;
  }

  .wc-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .res-breakdown {
    grid-template-columns: 1fr 1fr;
  }

  .res-b-item:nth-child(3) {
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, .2);
    padding-top: 8px;
  }

  .chart-wrap {
    height: 160px;
  }

  .cgpa-sub-row {
    grid-template-columns: 1fr 60px 60px auto;
    gap: 5px;
  }

  .inv-grid-2 {
    grid-template-columns: 1fr;
  }

  .related-tools-grid,
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  .tool-page-header h1 {
    font-size: 1.3rem;
  }

  .btn-tool {
    font-size: .88rem;
    padding: 11px 18px;
  }

  .upload-zone {
    padding: 24px 14px;
  }

  .upload-icon-wrap {
    width: 52px;
    height: 52px;
  }

  .specs-table {
    font-size: .8rem;
  }
}

@media(max-width:480px) {
  .emi-btn-row {
    flex-wrap: wrap;
  }

  .wc-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-btn-row {
    flex-direction: column;
  }

  .btn-tool-primary,
  .btn-tool-secondary {
    width: 100%;
    flex: unset;
  }

  .related-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cl-steps,
  .resume-steps {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cgpa-sub-row {
    grid-template-columns: 1fr 55px 55px auto;
  }

  .res-val {
    font-size: 1.8rem;
  }

  .tool-lang-bar,
  .lang-switch {
    gap: 4px;
  }

  .lang-btn,
  .mgb-lang-btn {
    padding: 4px 10px;
    font-size: .78rem;
  }

  .exam-tabs,
  .ojas-tabs {
    flex-wrap: wrap;
  }
}

/* ════════════════════════════════════════════════════════════
   PRINT
   ════════════════════════════════════════════════════════════ */
@media print {

  .tool-lang-bar,
  .lang-switch,
  .tool-btn-row,
  .ojas-tabs,
  .exam-tabs,
  .upload-zone,
  .related-tools,
  nav,
  header,
  footer,
  .site-header {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}