html {
  font-size: 18px;
}

body {
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 1.125rem;
  margin: 0;
  padding: 0;
  color: #222;
}

header {
  background-color: #fafcff;
}

h1 {
  font-size: 1.4rem;
  margin-top: 0.8rem;
  margin-bottom: 0.65rem;
}

section h1,
article h1,
aside h1,
nav h1 {
  font-size: 1.4rem;
}

h1 {
  font-size: 1.4rem;
  margin-top: 0.8rem;
  margin-bottom: 0.65rem;
}

h2 {
  font-size: 1.3rem;
  margin-top: 1.4rem;
  margin-bottom: 0.55rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

h1,
h2,
h3 {
  color: #222222;
}

p,
ul,
ol,
dl {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

ul {
  padding-inline-start: 1em;
}

a.navbar-title {
  text-decoration: none;
  color: #fff;
}

a.navbar-title:visited {
  text-decoration: none;
  /*color: #fff;*/
}

a:link {
  color: #004db3;
}

a:visited {
  color: #004db3;
}

a:hover {
  color: #004db3;
}

a:active {
  color: #004db3;
}

#quick-converter {
  background: #fafcff;
  border: 1.5px solid #e3eaf3;
  border-radius: 10px;
  margin: 24px auto;
  max-width: 900px;
  padding: 20px 10px 10px 10px;
  box-shadow: 0 2px 12px 0 #e3eaf3;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #004db3;
  color: #ffffff;
  border: none;
  border-radius: 0.3rem 0.3rem 0 0;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.tab-btn.active,
.tab-btn:focus {
  background: #fafcff;
  color: #004db3;
  border-bottom: 2px solid #fafcff;
  z-index: 2;
}

.tab-btn:disabled {
  background: #f0f4fa;
  color: #b0b8c1;
  cursor: not-allowed;
}

.converter-row {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}

.converter-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 180px;
  min-width: 160px;
}

.converter-input {
  width: 94%;
  font-size: 1.15rem;
  padding: 0.625rem;
  margin-bottom: 0.625rem;
  border: 0.09375rem solid #c6d4e5;
  border-radius: 0.4375rem;
  background: #fff;
  color: #222;
  text-align: center;
  transition: border 0.2s;
}

.converter-input:focus {
  border: 1.5px solid #004db3;
  outline: none;
}

.converter-input[readonly] {
  background: #f5f8fa;
  font-weight: 600;
}

.converter-listbox {
  width: 100%;
  font-size: 1.08rem;
  min-height: 13.75rem;
  border: 0.09375rem solid #c6d4e5;
  border-radius: 0.4375rem;
  background: #fff;
  color: #222;
  margin-bottom: 0.5rem;
  transition: border 0.2s;
}

.converter-listbox:focus {
  border: 1.5px solid #004db3;
  outline: none;
}

.converter-col label {
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  align-self: flex-start;
}

.navbar {
  width: 100%;
  padding: 0.7em 0 0.7em 0;
  box-shadow: 0 2px 8px #e3eaf3;
  margin-bottom: 0.5em;
}

.navbar-center {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0 2vw;
}

.slogan {
  font-size: 1.2rem;
  color: #004db3;
  margin-left: 0.8rem;
  margin-bottom: 1.5rem;
  margin-top: 0.2rem;
  font-weight: 500;
}

.main-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2vw;
}

.main-content {
  flex: 2 1 480px;
  min-width: 0;
  margin-left: 0.6rem;
  margin-right: 0.6rem;
}

.sidebar {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 320px;
  margin-top: 1.5em;
}

.sidebar-box {
  border: 1.5px solid #e3eaf3;
  border-radius: 10px;
  padding: 1.2em 1em 1em 1em;
  box-shadow: 0 2px 8px #e3eaf3;
}

.sidebar-box h3 {
  margin-top: 0;
  margin-bottom: 0.7em;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1em 0;
}

.sidebar-list li {
  color: #222;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

#categories-section {
  max-width: 900px;
  margin: 2.5em auto 0 auto;
  background: #fff;
  border: 1.5px solid #e3eaf3;
  border-radius: 10px;
  padding: 1.5em 1em 1em 1em;
  box-shadow: 0 2px 8px #e3eaf3;
}

#categories-section h2 {
  color: #004db3;
  font-size: 1.5rem;
  margin-top: 0;
}

#categories-section ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2em;
  list-style: none;
  padding: 0;
  margin: 0;
}

#categories-section li {
  color: #004db3;
  font-weight: 600;
  font-size: 1rem;
}

@media (max-width: 900px) {
  .main-layout {
    flex-direction: column;
    gap: 0;
    padding: 0 1vw;
  }

  .sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 2em;
    margin-bottom: 0;
  }
}

@media (max-width: 700px) {
  .main-layout {
    padding: 0 0.5vw;
  }

  .main-content {
    min-width: 0;
  }

  #quick-converter {
    padding: 10px 2vw 10px 2vw;
  }
}

#converter-categories {
  max-width: 900px;
  margin: 0 auto 0 auto;
}

#converter-categories h2 {
  margin-bottom: 0.7em;
}

#converter-categories h2 a {
  text-decoration: none;
  color: #004db3;
}

#converter-categories h2 a:hover {
  text-decoration: underline;
}

#converter-categories ul {
  padding-left: 1.2em;
  margin: 0 0 1.5em 0;
  list-style-type: disc;
}

#converter-categories li {
  font-size: 1.08rem;
  line-height: 1.6;
  margin-bottom: 0.3em;
}

#converter-categories li a {
  color: #004db3;
}

#converter-categories li a:hover {
  color: #174ea6;
  text-decoration: underline;
}

#converter-categories .category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

#converter-categories .category-column {
  padding: 0;
}

#converter-categories .category-column h2 {
  margin-bottom: 0.5em;
}

#converter-categories .category-column ul {
  padding-left: 1.2em;
  margin-bottom: 2em;
}

@media (max-width: 700px) {
  #converter-categories .category-column li {
    font-size: 1.2rem;
    line-height: 2;
    padding: 6px 0;
  }

  #converter-categories .category-column li a {
    display: inline-block;
    min-height: 44px;
  }
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  padding-left: 1em;
  padding-right: 1em;
}

.category-column {
  flex: 1 1 300px;
  min-width: 250px;
}

.category-column h2 {
  margin-bottom: 0.5rem;
}

.category-column ul {
  padding-left: 0;
}

.category-column ul li {
  margin: 0.3em 0;
}

.category-column a {
  text-decoration: none;
  color: #004db3;
}

.category-column a:hover {
  text-decoration: underline;
}

.category-description {
  margin-bottom: 1em;
  color: #333;
  font-size: 1.08rem;
  line-height: 1.5;
}

.category-extra-description {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #333;
  margin-top: 1.5em;
}

.category-extra-description p {
  margin-bottom: 1em;
}

.breadcrumbs {
  font-size: 0.95rem;
  color: #666;
}

.breadcrumbs ul {
  font-size: 0.8rem;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.breadcrumbs li {
  margin-right: 0.5em;
  display: flex;
  align-items: center;
}

.breadcrumbs .separator {
  margin: 0 0.3em;
  color: #ccc;
}

.converter {
  max-width: 720px;
  background: white;
  padding: 0.8rem;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.col {
  flex: 1 1 45%;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
}

.result {
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
}

.converter-human-result {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1d3557;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 4px 0 rgba(60, 120, 200, 0.04);
  transition: background 0.2s;
}

.converter-human-result:empty {
  display: none;
}

.footer {
  background-color: #fafcff;
  border-top: 1px solid #e3eaf3;
  padding: 2em 1em;
  margin-top: 3em;
  font-size: 1.1rem;
  color: #444;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2em;
  margin-bottom: 1em;
}

.footer-nav a {
  text-decoration: none;
  color: #004db3;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: #174ea6;
  text-decoration: underline;
}

.footer-copy {
  color: #444;
  font-size: 0.9rem;
}

.footer-desc {
  max-width: 720px;
  margin: 1em auto 0 auto;
  color: #333;
  text-align: center;
  line-height: 1.5;
}

dl {
  margin: 1.5em auto;
}

dt {
  font-weight: 600;
  margin-top: 1em;
}

dd {
  margin: 0.4em 0 1em 1em;
  color: #333;
  line-height: 1.6;
}

table {
  width: 100%;
  font-size: 0.9rem;
  border-collapse: collapse;
  margin: 1.5em 0;
  max-width: 720px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

thead {
  background-color: #f0f4fa;
}

th,
td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid #e3eaf3;
}

th {
  font-weight: 600;
}

tr:hover {
  background-color: #f9fbfd;
}

.converter-alt-link {
  margin-top: 1em;
  text-align: center;
  color: #444;
}

.converter-alt-link a {
  color: #004db3;
  text-decoration: none;
  font-weight: 500;
}

.converter-alt-link a:hover {
  text-decoration: underline;
}

.navbar-center {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 2vw;
}

.navbar-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 0.3em;
  letter-spacing: 0.03125rem;
}

.navbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
}

.navbar-links a {
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.3em 0;
  transition: color 0.1s;
}

.navbar-links a:hover {
  color: #cbe3ff;
}

#swap-btn,
#clear-btn {
  font-size: 1rem;
  font-weight: 600;
  background-color: #004db3;
  color: #ffffff;
  border: 2px solid #004db3;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#swap-col {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

input[type="text"],
input[type="number"],
select,
textarea {
  font-size: 1rem;
  padding: 0.6em 1em;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: white;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #004db3;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 76, 127, 0.2);
}

#output {
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  max-width: 100%;
  overflow-x: auto;
}

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

.converter-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: 10px;
  background-color: #f9fbfd;
  border: 1px solid #e3eaf3;
  text-decoration: none;
  color: #222;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.converter-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.converter-card span {
  font-weight: 600;
  font-size: 1.2rem;
  margin-top: 0.5rem;
}

.converter-card small {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  color: #555;
}

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

figure {
  margin: 1.5rem 0;
  text-align: center;
}

figcaption {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
