:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #edf3ef;
  --ink: #17211c;
  --muted: #64706a;
  --line: #d9e0dc;
  --accent: #14795c;
  --accent-dark: #0f5f4a;
  --accent-soft: #dff1ea;
  --gold: #d49a2a;
  --danger: #b84a42;
  --shadow: 0 22px 70px rgba(23, 33, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(217, 224, 220, 0.82);
  background: rgba(246, 247, 244, 0.9);
  backdrop-filter: blur(16px);
}

.nav {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-logo {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
}

.brand-word {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.brand-dot {
  color: var(--accent);
  font-size: 0.78em;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  overflow: visible;
}

.nav-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-links a:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-links a.active {
  background: var(--ink);
  color: #fff;
}

.nav-more {
  position: relative;
}

.nav-more summary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-more summary::-webkit-details-marker {
  display: none;
}

.nav-more summary::after {
  width: 7px;
  height: 7px;
  margin-left: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg) translateY(-2px);
}

.nav-more:hover summary,
.nav-more:focus-within summary {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-more[open] summary,
.nav-more:has(a.active) summary {
  background: var(--ink);
  color: #fff;
}

.nav-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 30;
  min-width: 220px;
  display: grid;
  gap: 4px;
  padding: 10px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nav-more:not([open]) .nav-menu {
  display: none;
}

.nav-more:hover .nav-menu,
.nav-more:focus-within .nav-menu {
  display: grid;
}

.nav-menu a {
  justify-content: flex-start;
  min-height: 38px;
}

.nav-menu a:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-menu a.active:hover {
  background: var(--ink);
  color: #fff;
}

.nav-links a[aria-disabled="true"] {
  opacity: 0.72;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: end;
  padding: 64px 0 34px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(38px, 7vw, 74px);
  line-height: 0.98;
}

h2 {
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.08;
}

.hero-text {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.home-hero {
  min-height: 360px;
}

.home-tools {
  margin: 0 0 56px;
}

.content-page {
  max-width: 840px;
  margin: 64px auto 72px;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.content-page h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(34px, 5vw, 56px);
}

.content-page h2 {
  margin: 30px 0 10px;
  font-size: 22px;
}

.content-page p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.contact-box {
  display: grid;
  gap: 8px;
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.contact-box span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.contact-box a {
  color: var(--accent-dark);
  font-size: 20px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.not-found-page {
  max-width: 760px;
  min-height: calc(100vh - 250px);
  display: grid;
  align-content: center;
  justify-items: start;
  margin: 0 auto;
  padding: clamp(54px, 10vw, 96px) 0;
}

.not-found-page h1 {
  color: var(--accent);
  font-size: clamp(96px, 24vw, 190px);
  line-height: 0.85;
}

.not-found-page p {
  max-width: 620px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: clamp(17px, 2.3vw, 20px);
  line-height: 1.7;
}

.link-action {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  text-decoration: none;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  min-height: 178px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(23, 33, 28, 0.06);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 121, 92, 0.45);
  box-shadow: 0 18px 42px rgba(23, 33, 28, 0.1);
}

.tool-card strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.tool-card span:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.tool-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 800;
}

.tool-card:nth-child(3n + 2) .tool-icon {
  background: #f7ebd2;
  color: #8a5b12;
}

.tool-card:nth-child(3n) .tool-icon {
  background: #e7edf7;
  color: #31527d;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.72fr);
  gap: 18px;
  align-items: stretch;
  margin: 0 0 56px;
}

.calculator-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calculator-panel {
  padding: clamp(22px, 4vw, 36px);
}

.section-heading {
  margin-bottom: 28px;
}

.calculator {
  display: grid;
  gap: 22px;
}

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

.currency-grid {
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  align-items: end;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.field > span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.mode-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mode-group legend {
  grid-column: 1 / -1;
}

.mode-card {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.mode-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mode-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.input-wrap {
  min-height: 58px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(20, 121, 92, 0.13);
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 16px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
}

.input-wrap span {
  min-width: 58px;
  align-self: stretch;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}

.field textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 16px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.5;
}

.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(20, 121, 92, 0.13);
}

.select-wrap {
  min-height: 58px;
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.select-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(20, 121, 92, 0.13);
}

.select-wrap::after {
  content: "";
  width: 10px;
  height: 10px;
  position: absolute;
  right: 18px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px);
  pointer-events: none;
}

.select-wrap select {
  width: 100%;
  min-height: 58px;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: var(--ink);
  padding: 0 44px 0 16px;
  font-weight: 800;
}

.rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rate-option {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.rate-option.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary-action {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.primary-action:hover {
  background: var(--accent-dark);
}

.secondary-action {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.secondary-action:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.swap-button {
  width: 52px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.swap-button:focus-visible,
.rate-option:focus-visible {
  outline: 4px solid rgba(20, 121, 92, 0.2);
  outline-offset: 2px;
}

.status-line {
  min-height: 22px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.result-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 4vw, 34px);
  background: var(--ink);
  color: #fff;
}

.result-panel .eyebrow {
  color: #9de1c9;
}

.result-total {
  margin: 4px 0 8px;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: clamp(36px, 6vw, 54px);
  font-weight: 800;
  line-height: 1;
}

.result-label {
  margin: 0;
  color: #bcc8c2;
  font-weight: 700;
}

.result-list {
  display: grid;
  gap: 12px;
  margin: 38px 0 0;
}

.result-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.result-list dt {
  color: #bcc8c2;
  font-weight: 700;
}

.result-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-weight: 800;
}

.password-output {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.18;
}

.number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
}

.number-list span {
  min-width: 54px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
}

.qr-preview {
  width: min(100%, 360px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 12px 0 18px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
}

.qr-preview canvas {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer-brand {
  color: var(--ink);
  font-weight: 800;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--accent-dark);
}

@media (max-width: 820px) {
  .nav {
    width: min(100% - 24px, 1120px);
    min-height: 66px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
  }

  .nav-more {
    position: static;
  }

  .nav-menu {
    right: auto;
    left: 0;
    width: 100%;
  }

  main {
    width: min(100% - 24px, 1120px);
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 42px 0 26px;
  }

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

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

@media (max-width: 560px) {
  .brand {
    font-size: 15px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .brand-word {
    font-size: 19px;
  }

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

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

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

  .swap-button {
    width: 100%;
  }

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

  .result-list div {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .result-list dd {
    text-align: left;
  }

  .site-footer {
    width: min(100% - 24px, 1120px);
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 18px 0;
  }

  .footer-links {
    justify-content: flex-start;
    gap: 10px 14px;
  }
}
