:root {
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96,165,250,0.10), transparent 28%),
    radial-gradient(circle at top right, rgba(37,99,235,0.08), transparent 30%),
    #f5f7fb;
  margin: 0;
  line-height: 1.6;
  color: #222;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html,
body {
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

.container {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37,99,235,0.35);
  outline-offset: 3px;
}

button,
a,
input,
.card,
.container,
#result-box {
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

#result-box {
  margin-top: 24px;
  padding: 22px;
  background: #f1f6ff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
  border: 1px solid #dbe7ff;
  display: block;
}

#result {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

/* Header / navigation */

header {
  background: rgba(30, 41, 59, 0.96);
  color: white;
  text-align: center;
  padding: 15px;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

header h2,
header nav {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

header h2 {
  color: white;
  font-size: 28px;
  margin: 0 0 14px;
  letter-spacing: -0.3px;
}

header h2::after {
  display: none;
}

nav a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: #60a5fa;
  transition: width 0.25s ease;
}

nav a:hover {
  color: #dbeafe;
}

nav a:hover::after {
  width: 100%;
}

a {
  transition: color 0.2s ease;
}

.container a:not(.card) {
  color: #2563eb;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Main layout */

.container {
  width: calc(100% - 24px);
  max-width: 900px;
  margin: 40px auto;
  background: white;
  padding: 30px;
  border-radius: 10px;

  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.9);

  animation: fadeIn 0.35s ease;
  will-change: transform;
}

.container:hover {
  transform: translateY(-2px);
}

.container > * + * {
  margin-top: 18px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.homepage-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.feature-card {
  background: white;
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15,23,42,0.06);
  border: 1px solid rgba(226,232,240,0.8);
}

.feature-card h3 {
  margin-bottom: 12px;
  color: #111827;
}

.feature-card p {
  color: #4b5563;
  line-height: 1.6;
}

.card-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1.2rem;
  line-height: 1.7;
  color: #4b5563;
  max-width: 760px;
  margin-top: 18px;
}

.section-subtitle {
  color: #64748b;
  font-size: 16px;
  margin-top: -10px;
  margin-bottom: 26px;
  line-height: 1.6;
}

.home-search {
  margin: 32px 0;
}

.home-search input {
  width: 100%;
  font-size: 18px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
}

.search-count {
  margin-top: 10px;
  font-size: 14px;
  color: #4b5563;
  font-weight: 600;
}

#noSearchResults {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff4f4;
  border: 1px solid #f5c2c2;
  color: #b42318;
  font-weight: 600;
}

.search-count {
  margin-top: 10px;
  color: #475569;
  font-size: 0.95rem;
  font-weight: 600;
}

.search-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.search-chips button,
.search-chips a {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;

  background: #eef2ff;
  color: #1e3a8a;
  border: 1px solid #c7d2fe;

  padding: 8px 14px;
  margin: 0;

  min-height: auto;

  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.search-chips button:hover,
.search-chips a:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.search-wrapper {
  display: flex;
  gap: 10px;
}

.search-wrapper input {
  flex: 1;
}

.clear-search-btn {
  width: auto;
  min-height: 56px;
  padding: 0 18px;
  background: #6b7280;
  border-radius: 12px;
  font-size: 15px;
}

.popular-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.popular-searches a {
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e3a8a;
  border: 1px solid #c7d2fe;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.popular-searches a:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 30px;
}

.quick-links a {
  background: #ffffff;
  border: 1px solid #dbe4ff;
  color: #2563eb;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.quick-links h3 {
  width: 100%;
  margin-bottom: 12px;
  font-size: 18px;
  color: #1e293b;
}

.quick-links a:hover {
  background: #eff6ff;
  transform: translateY(-1px);
}

.section-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 32px;
}

.section-jumps a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: #eef2ff;
  color: #2563eb;
  border: 1px solid #c7d2fe;
  font-weight: 600;
  text-decoration: none;
}

.section-jumps a:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

.hero-buttons {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
}

.primary-btn {
  background: #2563eb;
  color: #ffffff;
}

.primary-btn:hover {
  color: #ffffff;
}

.secondary-btn {
  background: #e5e7eb;
  color: #111827;
}

.secondary-btn:hover {
  background: #d1d5db;
}



/* Typography */

h1 {
  font-size: 52px;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

h2 {
  font-size: 32px;
  margin-top: 48px;
  margin-bottom: 18px;
  color: #0f172a;
  letter-spacing: -0.5px;
}

h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

h3 {
  font-size: 24px;
  margin-top: 32px;
  margin-bottom: 12px;
  color: #1e293b;
}

p {
  max-width: 760px;
  line-height: 1.8;
  color: #334155;
  font-size: 17px;
}

p + p {
  margin-top: 18px;
}

.helper-text {
  margin-top: -10px;
  margin-bottom: 20px;
  color: #64748b;
  font-size: 14px;
  font-style: italic;
}

.tool-badge {
  display: inline-block;
  margin-bottom: 20px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #eef3ff;
  color: #2f64e1;
  font-size: 14px;
  font-weight: 600;
}

/* Inputs and buttons */

input,
select,
button {
  font-size: 16px;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  margin-bottom: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  background: #ffffff;
}

input:focus,
select:focus {
  background: #ffffff;
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px 16px;
  margin-top: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  min-height: 52px;
  transition: all 0.25s ease;
  transform: translateY(0);
}

button:hover {
  background: #1d4ed8;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 18px rgba(37,99,235,0.22);
}

button:active {
  transform: translateY(1px);
}

.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.action-buttons button {
  flex: 1;
}

.secondary-btn {
  background: #6b7280;
}

.secondary-btn:hover {
  background: #4b5563;
}

.converter-row {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.converter-row input {
  margin: 0;
}

.converter-row button {
  width: auto;
  min-width: 90px;
  margin: 0;
}

.converter-row button,
.result-actions button,
#history-section button {
  min-height: 44px;
  padding: 10px 16px;
}

.converter-page p {
  font-size: 1.12rem;
  line-height: 1.9;
  color: #4b5563;
  margin-bottom: 24px;
  max-width: 900px;
}

.converter-page h2 {
  font-size: 2.4rem;
  margin-top: 54px;
  margin-bottom: 18px;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.converter-group h2 {
  scroll-margin-top: 130px;
}

.mobile-stack-button {
  width: 100%;
  margin-bottom: 10px;
}

.quick-buttons button {
  margin-right: 10px;
}

/* Result and history */

#result-box {
  background: #eef2ff;
  border-left: 5px solid #2563eb;
  padding: 20px;
  border-radius: 8px;
  margin-top: 15px;
  opacity: 0;
  transform: translateY(10px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid rgba(37,99,235,0.08);
  backdrop-filter: blur(4px);
}

#result-box.show {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 8px 24px rgba(37,99,235,0.08);
}

#result {
  font-size: 22px;
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 20px;
}

.result-main {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.5;
  word-break: break-word;
  color: #1e293b;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.result-actions {
  margin-top: 10px;
}

.result-actions button {
  margin-right: 10px;
}

#result:empty + .result-actions button {
  opacity: 0.65;
}

#history-section {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.7s ease;
}

#history-section.show {
  opacity: 1;
  transform: translateY(0);
}

#history-section button {
  margin-top: 18px;
}

ul#history {
  padding-left: 20px;
}

ul#history li {
  margin-bottom: 6px;
  cursor: pointer;
}

ul#history li:hover {
  color: #2563eb;
}

/* Cards and grids */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 40px;
}

.card {
  display: block;
  padding: 22px;
  background: white;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
  content-visibility: auto;
  contain-intrinsic-size: 120px;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
  background: #f8fafc;
  border-color: rgba(37,99,235,0.15);
  color: #0f172a;
}

.card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px auto;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 2rem;

  border-radius: 50%;

  background: linear-gradient(
    135deg,
    #eef4ff,
    #dbeafe
  );

  box-shadow:
    0 4px 12px rgba(37, 99, 235, 0.10);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.card:hover .card-icon {
  transform: scale(1.08);

  box-shadow:
    0 8px 18px rgba(37, 99, 235, 0.18);
}

.grid {
  position: relative;
  z-index: 2;
}

.related-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.related-grid .card {
  padding: 18px;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  position: relative;
  z-index: 3;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
}

.category-icon {
  font-size: 42px;
  margin-bottom: 16px;
  line-height: 1;
}

@media (max-width: 768px) {

  header h2 {
  font-size: 24px;
}

nav {
  gap: 8px;
}

nav a {
  font-size: 14px;
}

  .container {
    padding: 20px;
    margin: 20px auto;
  }

  h1 {
    font-size: 2.2rem;
    line-height: 1.2;
  }

  .action-buttons {
    flex-direction: column;
  }

  .quick-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  button {
    width: 100%;
  }

  #result-box {
    padding: 20px;
  }

  .converter-intro {
    font-size: 1rem;
    line-height: 1.6;
  }
}

.converter-page table {
  max-width: 420px;
  display: table;
}

.converter-page .popular-conversions {
  margin-bottom: 34px;
}

.search-wrapper {
  flex-direction: column;
}

.clear-search-btn {
  width: 100%;
}

.search-chips,
.quick-links {
  gap: 8px;
}

.search-chips button,
.search-chips a,
.quick-links a {
  font-size: 13px;
  padding: 8px 12px;
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15,23,42,0.04);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

th {
  background: #eff6ff;
  color: #1e3a8a;
  text-align: left;
  padding: 12px;
  font-weight: 700;
}

td {
  padding: 12px;
  border-top: 1px solid #e5e7eb;
}

tr:hover td {
  background: #f8fafc;
  transition: background 0.2s ease;
}

@media (hover: hover) {
  tr:hover td {
    background: #f1f5f9;
  }
}

/* Related links / footer */

.related-links {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #444;
}

.related-links h2 {
  margin-bottom: 10px;
}

.related-links a {
  display: inline-block;
  margin-bottom: 8px;
  color: #4da6ff;
  text-decoration: none;
}

.related-links a:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  padding: 30px;
  color: #94a3b8;
  font-size: 14px;
  border-top: 1px solid rgba(148,163,184,0.15);
  margin-top: 60px;
}

footer a {
  color: #cbd5e1;
  text-decoration: none;
}

footer a:hover {
  color: white;
}

footer a:hover {
  color: white;
}

footer {
    margin-top: 40px;
}

/* Category SEO Content */

.category-intro {
  font-size: 18px;
  color: #4a5568;
  margin-bottom: 30px;
  line-height: 1.7;
}

.breadcrumbs {
  font-size: 0.9rem;
  margin-bottom: 18px;
  color: #777;
}

.breadcrumbs a {
  color: #2a6df4;
  text-decoration: none;
}

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

.seo-content {
  margin: 20px 0 40px;
  line-height: 1.7;
}

.common-uses {
  margin-left: 20px;
  line-height: 1.8;
}

.popular-conversions p {
  margin: 6px 0;
}

.seo-content h2 {
  margin-bottom: 14px;
}

.seo-content p {
  margin-bottom: 18px;
  color: #4a5568;
  line-height: 1.8;
}

/* Mobile */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  header {
    padding: 20px 10px;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding-top: 8px;
  }

  nav a {
    margin: 0;
  }

  .container {
    padding: 20px;
    margin: 20px 10px;
  }

  h1 {
    font-size: 2rem;
  }

  #result-box {
    padding: 16px;
    margin-top: 14px;
  }

  .result-main {
    font-size: 22px;
  }

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

  input {
    font-size: 16px;
    min-height: 52px;
  }

  table {
    margin-top: 12px;
    margin-bottom: 30px;
  }

  th,
  td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
  }

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

/* Print */

@media print {
  header,
  footer,
  button,
  .result-actions {
    display: none;
  }

  body {
    background: white;
  }

  .container {
    box-shadow: none;
    border: none;
    margin: 0;
    width: 100%;
    max-width: 100%;
  }

}
