:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #14213d;
  --muted: #667085;
  --line: #e5e7eb;
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #f97316;
  --shadow: 0 16px 40px rgba(20, 33, 61, 0.08);
  --radius: 18px;
  --soft-red: #fff1f2;
}


* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #e8f1ff 0, transparent 28%),
              radial-gradient(circle at top right, #e9fff2 0, transparent 24%),
              var(--bg);
}

a { color: var(--blue); text-decoration: none; }

.topbar {
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-link {
  color: inherit;
}

.brand-logo-img {
  height: 144px;
  width: auto;
  max-width: 520px;
  object-fit: contain;
  display: block;
}


.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: white;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.brand-title { font-size: 22px; font-weight: 800; line-height: 1; }
.brand-subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; }

.nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
  flex-wrap: wrap;
  align-items: center;
}


.container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 12px 18px 46px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 22px;
  align-items: stretch;
  margin-top: 10px;
}

.hero-copy, .security-box, .panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy { padding: 54px; }

.badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.03;
  margin: 18px 0 16px;
  letter-spacing: -1.5px;
}

.hero p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 720px;
}

.security-box {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.security-box strong { font-size: 24px; color: #7f1d1d !important; }
.security-box p { color: var(--muted); line-height: 1.6; }

.panel {
  margin-top: 22px;
  padding: 26px;
}

.panel h2 { margin: 0 0 18px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}

.check-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(0,0,0,.08);
}

.dot.tevkifat { background: #fce4d6; }
.dot.doviz { background: #fff2cc; }
.dot.iade { background: #eadcf8; }
.dot.kdvsiz { background: #e2f0d9; }

.preview-row-tevkifat { background: #fce4d6; }
.preview-row-doviz { background: #fff2cc; }
.preview-row-iade { background: #eadcf8; }
.preview-row-kdvsiz { background: #e2f0d9; }


label span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 7px;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 14px;
  color: var(--text);
}

input:focus, select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.22);
  border-color: var(--blue);
}

.drop-area {
  border: 2px dashed #b9c6dc;
  background: #fbfdff;
  border-radius: 18px;
  min-height: 190px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.18s ease;
}

.drop-area:hover, .drop-area.dragover {
  border-color: var(--blue);
  background: #f2f7ff;
}

.drop-content { text-align: center; padding: 24px; }

.drop-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.drop-content p { margin: 0; font-size: 18px; }
.drop-content span, .muted { color: var(--muted); font-size: 14px; }

.file-info { margin-top: 14px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--blue); color: white; }
.btn.primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn.success { background: var(--green); color: white; }
.btn.secondary { background: #eef2f7; color: var(--text); }

.status { margin-top: 16px; line-height: 1.5; }
.status.ok { color: var(--green); }
.status.err { color: var(--red); }
.status.warn { color: var(--orange); }

.hidden { display: none; }

.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fbfdff;
}

.card .number { font-size: 28px; font-weight: 900; }
.card .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  background: white;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

th { background: #f8fafc; font-weight: 900; }

.footer {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 18px 42px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.content-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 18px 60px;
}

.content-page .panel { line-height: 1.7; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}

@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .topbar, .footer { flex-direction: column; align-items: flex-start; }
}


.required-field > span {
  color: var(--red);
}

.required-field > span::after,
.required-check > span::after {
  content: " *";
  color: var(--red);
  font-weight: 900;
}

.required-field.field-error input,
.required-field.field-error select {
  border-color: var(--red);
  background: var(--soft-red);
}

.required-check.field-error {
  border: 1px solid var(--red);
  background: var(--soft-red);
  border-radius: 12px;
  padding: 12px;
}

.validation-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--soft-red);
  border: 1px solid #fecdd3;
  color: var(--red);
  font-size: 14px;
  line-height: 1.55;
}

.validation-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.stats-panel h2 {
  margin-bottom: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.stat-card {
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 16px;
  padding: 18px;
}

.stat-number {
  font-size: 30px;
  font-weight: 900;
  color: var(--blue-dark);
}

.stat-number.small {
  font-size: 18px;
  line-height: 1.35;
}

.stat-label {
  color: var(--muted);
  margin-top: 5px;
  font-size: 13px;
  font-weight: 700;
}

.viewer-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 18px;
  align-items: start;
}

.viewer-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: white;
}

.viewer-item {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.viewer-item:hover,
.viewer-item.active {
  background: #eef6ff;
}

.viewer-item strong {
  display: block;
  font-size: 14px;
}

.viewer-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.xml-pre {
  min-height: 520px;
  max-height: 720px;
  overflow: auto;
  background: #0f172a;
  color: #dbeafe;
  border-radius: 14px;
  padding: 18px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.viewer-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.viewer-summary div {
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
}

.viewer-summary b {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

@media (max-width: 980px) {
  .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}
  .viewer-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .brand-logo-img {
  height: 144px;
  width: auto;
  max-width: 520px;
  object-fit: contain;
  display: block;
}
  .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}
}



.footer a {
  color: var(--blue);
  font-weight: 800;
}

.footer-slogan {
  max-width: 520px;
  text-align: right;
  color: var(--text);
  font-weight: 700;
}

.copyright {
  color: var(--muted);
}

/* PDF önizleme sayfası */
.pdf-viewer-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.invoice-paper-wrap {
  background: #e5e7eb;
  border-radius: 18px;
  padding: 22px;
  overflow: auto;
  min-height: 760px;
}

.invoice-paper {
  width: 900px;
  min-height: 1180px;
  margin: 0 auto;
  background: white;
  color: #111827;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.20);
  padding: 48px;
  font-family: Arial, Helvetica, sans-serif;
}

.invoice-paper-header {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 3px solid #1d4ed8;
  padding-bottom: 22px;
  margin-bottom: 22px;
}

.invoice-paper-title h2 {
  margin: 0;
  color: #14213d;
  font-size: 34px;
}

.invoice-paper-title p {
  margin: 8px 0 0;
  color: #667085;
}

.invoice-paper-logo {
  text-align: right;
}

.invoice-paper-logo img {
  height: 74px;
  object-fit: contain;
}

.invoice-section {
  margin-top: 22px;
}

.invoice-section h3 {
  margin: 0 0 10px;
  color: #1e40af;
  font-size: 18px;
}

.invoice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.invoice-box {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 14px;
  background: #f9fafb;
}

.invoice-box b {
  display: block;
  color: #6b7280;
  font-size: 12px;
  margin-bottom: 5px;
}

.invoice-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  margin-top: 8px;
}

.invoice-table th,
.invoice-table td {
  border: 1px solid #d1d5db;
  padding: 8px;
  font-size: 12px;
}

.invoice-table th {
  background: #eff6ff;
  color: #1e3a8a;
}

.invoice-total-box {
  margin-left: auto;
  width: 360px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.invoice-total-row:last-child {
  border-bottom: 0;
  background: #eff6ff;
  font-weight: 900;
}

.raw-xml-toggle {
  margin-top: 18px;
}

.raw-xml-toggle summary {
  cursor: pointer;
  font-weight: 800;
  color: #1e40af;
}

.raw-xml-toggle pre {
  max-height: 360px;
  overflow: auto;
  background: #0f172a;
  color: #dbeafe;
  padding: 16px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 980px) {
  .pdf-viewer-layout { grid-template-columns: 1fr; }
  .invoice-paper { width: 820px; }
  .footer-slogan { text-align: left; }
}

@media print {
  body {
    background: white !important;
  }

  .topbar,
  .footer,
  .hero,
  .panel:not(#viewerResultPanel),
  .viewer-list,
  .pdf-toolbar,
  .raw-xml-toggle,
  #viewerResultPanel > h2 {
    display: none !important;
  }

  .container {
    max-width: none !important;
    padding: 0 !important;
  }

  #viewerResultPanel {
    display: block !important;
    box-shadow: none !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .pdf-viewer-layout {
    display: block !important;
  }

  .invoice-paper-wrap {
    padding: 0 !important;
    background: white !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .invoice-paper {
    width: auto !important;
    min-height: auto !important;
    box-shadow: none !important;
    padding: 24px !important;
  }
}


.footer-slogan {
  max-width: 620px;
  text-align: right;
  color: var(--text);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: 16px;
}

.footer-slogan-icon {
  font-size: 34px;
  line-height: 1;
  display: inline-block;
}

/* Orijinal fatura görüntüleme */
.original-viewer-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.original-viewer-wrap {
  background: #e5e7eb;
  border-radius: 18px;
  padding: 22px;
  overflow: auto;
  min-height: 760px;
}

.original-frame {
  width: 100%;
  min-height: 760px;
  border: 0;
  background: white;
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.original-message {
  min-height: 420px;
  background: white;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

.original-message h3 {
  margin-top: 0;
  color: #7f1d1d;
}

.viewer-summary-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.viewer-summary-box div {
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
}

.viewer-summary-box b {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.raw-xml-original {
  max-height: 580px;
  overflow: auto;
  background: #0f172a;
  color: #dbeafe;
  padding: 16px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .original-viewer-layout { grid-template-columns: 1fr; }
  .footer-slogan { text-align: left; justify-content: flex-start; }
}

@media print {
  .topbar,
  .footer,
  .hero,
  .panel:not(#viewerResultPanel),
  .viewer-list,
  .pdf-toolbar,
  #viewerResultPanel > h2 {
    display: none !important;
  }

  .container {
    max-width: none !important;
    padding: 0 !important;
  }

  #viewerResultPanel {
    display: block !important;
    box-shadow: none !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .original-viewer-layout {
    display: block !important;
  }

  .original-viewer-wrap {
    padding: 0 !important;
    background: white !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .original-frame {
    min-height: 100vh !important;
    box-shadow: none !important;
  }
}


/* v0.8 overrides */
.security-box strong {
  color: #7f1d1d !important;
  font-size: 26px !important;
  font-weight: 900 !important;
}

.footer-slogan {
  max-width: 680px;
  text-align: right;
  color: var(--text);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-size: 16px;
}

.footer-slogan-icon {
  font-size: 40px;
  line-height: 1;
  display: inline-block;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
}

@media (max-width: 980px) {
  .footer-slogan {
    text-align: left;
    justify-content: flex-start;
  }
}

/* Orijinal görüntü yazdırma: ana sayfa alanları yazdırılmaz */
body.print-original-only * {
  visibility: hidden !important;
}

body.print-original-only #originalViewer,
body.print-original-only #originalViewer * {
  visibility: visible !important;
}

body.print-original-only #originalViewer {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: white !important;
  z-index: 9999 !important;
}

body.print-original-only .original-frame {
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}


/* v0.10 landing cards */
.tool-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.tool-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(229,231,235,0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  color: var(--text);
  display: block;
  transition: 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37,99,235,0.45);
}

.primary-card {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
}

.tool-card-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.tool-card h2 {
  margin: 0 0 10px;
}

.tool-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.special-offer p {
  color: var(--muted);
  line-height: 1.6;
}

.inline-btn {
  display: inline-block;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .tool-cards {
    grid-template-columns: 1fr;
  }
}


/* v0.11 fixes */
.security-box strong {
  color: #dc2626 !important;
  font-size: 27px !important;
  font-weight: 950 !important;
}

.xml-icon {
  width: 68px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dbeafe, #dcfce7);
  color: #1d4ed8;
  border: 2px solid #bfdbfe;
  font-size: 24px !important;
  font-weight: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -1px;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-title-row h2 {
  margin: 0;
}

.section-title-row p {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--blue-dark);
  font-weight: 800;
  max-width: 860px;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
}

.contact-form .full {
  grid-column: 1 / -1;
}

.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  resize: vertical;
}

@media (max-width: 760px) {
  .contact-form {
    grid-template-columns: 1fr;
  }
}


/* v1.0 live promo */
.promo-banner {
  display: inline-flex;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-size: 17px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(154, 52, 18, 0.10);
}

.nav a {
  font-weight: 800;
}

.security-box strong {
  color: #dc2626 !important;
}





/* v1.3 ana sayfa ve menü düzeni */
.nav a {
  font-weight: 400 !important;
  letter-spacing: 0;
}

.tool-cards {
  width: 100%;
  max-width: none !important;
  margin: 24px 0 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.tool-card {
  min-height: 250px;
  padding: 38px 40px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  border-radius: 22px;
}

.tool-card:hover {
  transform: translateY(-4px);
}

.tool-card-content {
  min-width: 0;
}

.tool-card-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tool-card h2 {
  margin: 0 0 14px;
  font-size: clamp(25px, 2.1vw, 34px);
  line-height: 1.15;
}

.tool-card p {
  margin: 0;
  max-width: 680px;
  font-size: 17px;
  line-height: 1.65;
}

.tool-card-action {
  display: inline-block;
  margin-top: 20px;
  color: var(--blue-dark);
  font-size: 15px;
  font-weight: 800;
}

.tool-card-icon {
  margin: 0;
  justify-self: center;
}

.xml-icon {
  width: 88px;
  height: 76px;
  font-size: 29px !important;
}

.invoice-icon {
  font-size: 66px !important;
  line-height: 1;
}

.viewer-card {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
}

@media (max-width: 1080px) {
  .tool-cards {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 210px;
  }
}

@media (max-width: 640px) {
  .tool-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 30px 24px;
  }

  .tool-card p {
    max-width: none;
  }

  .tool-card-action {
    margin-top: 16px;
  }
}


/* =========================================================
   v1.4 TAM MOBİL / TABLET UYUMU
   ========================================================= */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

.menu-toggle {
  display: none;
  width: 46px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 23px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.topbar.nav-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.topbar.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.topbar.nav-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.table-wrap,
.original-viewer-wrap,
.invoice-paper-wrap,
.raw-xml-original,
.raw-xml-toggle pre,
.xml-pre {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1180px) {
  .topbar,
  .container,
  .footer {
    max-width: 100%;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .hero-copy {
    padding: 38px;
  }

  .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .original-viewer-layout,
  .pdf-viewer-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .topbar {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center !important;
    gap: 10px 14px;
    padding: 12px 16px !important;
  }

  .brand-link {
    min-width: 0;
  }

  .brand-logo-img {
    height: 86px !important;
    width: auto !important;
    max-width: min(330px, calc(100vw - 90px)) !important;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav {
    grid-column: 1 / -1;
    display: none !important;
    width: 100%;
    margin-top: 4px;
    padding: 10px 0 2px;
    border-top: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch !important;
    gap: 2px !important;
  }

  .topbar.nav-open .nav {
    display: flex !important;
  }

  .nav a {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.3;
  }

  .nav a:hover,
  .nav a:focus-visible {
    background: #eef4ff;
    color: var(--blue-dark);
  }

  .container {
    padding: 8px 16px 36px !important;
  }

  .hero {
    grid-template-columns: 1fr !important;
    gap: 16px;
    margin-top: 4px;
  }

  .hero-copy {
    padding: 32px !important;
  }

  .security-box {
    padding: 26px !important;
  }

  h1 {
    font-size: clamp(34px, 7vw, 48px);
    line-height: 1.07;
  }

  .panel {
    padding: 24px;
  }

  .tool-cards {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .tool-card {
    min-height: 0 !important;
    padding: 30px !important;
    grid-template-columns: 86px minmax(0, 1fr) !important;
    gap: 24px !important;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .original-viewer-layout,
  .pdf-viewer-layout,
  .viewer-layout {
    grid-template-columns: 1fr !important;
  }

  .viewer-list {
    max-height: 260px;
    overflow-y: auto;
  }

  .original-viewer-wrap,
  .invoice-paper-wrap {
    min-height: 520px !important;
    padding: 14px !important;
  }

  .original-frame {
    min-height: 620px !important;
  }

  .invoice-paper {
    width: 820px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-slogan {
    max-width: none !important;
    text-align: left !important;
    justify-content: flex-start !important;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 10px 12px !important;
  }

  .brand-logo-img {
    height: 72px !important;
    max-width: min(275px, calc(100vw - 76px)) !important;
  }

  .container {
    padding: 4px 12px 30px !important;
  }

  .content-page {
    padding: 8px 12px 38px !important;
  }

  .hero-copy,
  .security-box,
  .panel {
    border-radius: 15px;
  }

  .hero-copy {
    padding: 24px 20px !important;
  }

  .security-box {
    padding: 22px 20px !important;
  }

  h1 {
    margin: 14px 0 12px;
    font-size: clamp(29px, 9vw, 39px);
    letter-spacing: -0.7px;
  }

  .hero p {
    font-size: 16px;
    line-height: 1.55;
  }

  .security-box strong {
    font-size: 22px !important;
    line-height: 1.25;
  }

  .promo-banner {
    max-width: 100%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.3;
  }

  .panel {
    margin-top: 16px;
    padding: 20px 16px !important;
  }

  .panel h2 {
    font-size: 22px;
  }

  .tool-cards {
    margin: 16px 0 20px !important;
  }

  .tool-card {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 26px 20px !important;
    text-align: center;
    border-radius: 17px !important;
  }

  .tool-card-icon {
    justify-self: center;
  }

  .tool-card-kicker {
    font-size: 12px;
  }

  .tool-card h2 {
    font-size: 26px !important;
  }

  .tool-card p {
    font-size: 16px !important;
    line-height: 1.55 !important;
  }

  .form-grid,
  .contact-form {
    grid-template-columns: 1fr !important;
  }

  .contact-form .full {
    grid-column: auto !important;
  }

  .section-title-row {
    display: block !important;
  }

  .section-title-row p {
    margin-top: 8px !important;
    font-size: 15px !important;
  }

  input,
  select,
  textarea {
    min-height: 46px;
    font-size: 16px !important;
  }

  .check-row {
    align-items: flex-start !important;
    gap: 10px;
    line-height: 1.45;
  }

  .check-row input {
    flex: 0 0 auto;
    margin-top: 2px;
  }

  .drop-area {
    min-height: 165px;
  }

  .drop-content {
    padding: 20px 14px;
  }

  .drop-content p {
    font-size: 16px;
    line-height: 1.45;
  }

  .drop-icon {
    width: 62px;
    height: 62px;
    border-radius: 17px;
  }

  .actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .actions .btn,
  .inline-btn,
  .pdf-toolbar .btn {
    width: 100%;
    min-height: 46px;
    text-align: center;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-number {
    font-size: 27px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  .card {
    padding: 13px 11px;
  }

  .card .number {
    font-size: 23px;
  }

  .legend {
    gap: 10px;
  }

  .table-wrap {
    margin-left: -4px;
    margin-right: -4px;
    border-radius: 11px;
  }

  table {
    min-width: 900px;
  }

  th,
  td {
    padding: 10px;
  }

  .viewer-summary,
  .viewer-summary-box {
    grid-template-columns: 1fr !important;
  }

  .viewer-item {
    padding: 11px;
  }

  .original-viewer-wrap,
  .invoice-paper-wrap {
    min-height: 420px !important;
    padding: 8px !important;
    border-radius: 13px;
  }

  .original-frame {
    min-height: 500px !important;
    border-radius: 7px;
  }

  .original-message {
    min-height: 280px !important;
    padding: 18px !important;
  }

  .raw-xml-original,
  .raw-xml-toggle pre,
  .xml-pre {
    font-size: 11px;
    padding: 12px;
  }

  .invoice-paper {
    width: 760px;
    padding: 28px;
  }

  .footer {
    padding: 22px 16px 32px !important;
    text-align: center;
    align-items: center !important;
    line-height: 1.6;
  }

  .footer-slogan {
    justify-content: center !important;
    text-align: center !important;
    font-size: 15px !important;
  }

  .footer-slogan-icon {
    font-size: 34px !important;
  }
}

@media (max-width: 420px) {
  .brand-logo-img {
    height: 64px !important;
    max-width: calc(100vw - 72px) !important;
  }

  .menu-toggle {
    width: 43px;
    height: 40px;
  }

  h1 {
    font-size: 28px;
  }

  .hero-copy,
  .security-box,
  .panel {
    border-radius: 13px;
  }

  .tool-card h2 {
    font-size: 23px !important;
  }

  .cards {
    grid-template-columns: 1fr !important;
  }

  .promo-banner {
    font-size: 14px;
  }
}
