:root {
  --navy: #061a2f;
  --navy-2: #0b2744;
  --yellow: #fad63a;
  --yellow-strong: #f2c500;
  --ink: #122033;
  --muted: #66758a;
  --line: #dce3eb;
  --surface: #ffffff;
  --background: #f4f7fa;
  --success: #17784b;
  --success-soft: #e9f8f0;
  --danger: #b42318;
  --radius-lg: 28px;
  --shadow: 0 24px 70px rgba(6, 26, 47, 0.12);
  --container: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
a { color: inherit; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 800;
}
.skip-link:focus { transform: none; }

.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: #fff;
  background: rgba(6, 26, 47, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
}
.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -.02em;
}
.brand img { width: 36px; height: 36px; }
.header-tool-name { color: #cad6e1; font-size: .9rem; font-weight: 700; }

.converter-section {
  padding: clamp(58px, 8vw, 94px) 0 88px;
  background:
    radial-gradient(circle at 88% 7%, rgba(250, 214, 58, .18), transparent 24%),
    linear-gradient(180deg, #eef3f7 0, var(--background) 38%);
}
.tool-intro {
  max-width: 850px;
  margin-bottom: 34px;
}
.eyebrow {
  margin: 0 0 11px;
  color: #9c7600;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .14em;
}
.tool-intro h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -.06em;
}
.tool-intro h1 span { color: #d4a900; }
.tool-intro > p:last-child {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
}
.tool-intro code {
  padding: 2px 6px;
  border-radius: 6px;
  color: #5c4800;
  background: #fff3b3;
}

.converter-card {
  padding: clamp(24px, 5vw, 48px);
  background: var(--surface);
  border: 1px solid rgba(220, 227, 235, .9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.converter-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 28px;
}
.converter-heading h2,
.coffee-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}
.converter-heading p:last-child {
  max-width: 720px;
  margin: 13px 0 0;
  color: var(--muted);
}
.local-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: .78rem;
  font-weight: 850;
}
.direction-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  margin-bottom: 28px;
  border-radius: 15px;
  background: #eef2f6;
}
.direction-button {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  color: #536277;
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}
.direction-button.is-active {
  color: var(--navy);
  background: var(--yellow);
  box-shadow: 0 4px 12px rgba(166, 133, 0, .18);
}
.field-group { max-width: 920px; }
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.field-label-row label { font-weight: 850; }
.text-button {
  border: 0;
  padding: 4px;
  color: #185f91;
  background: transparent;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 800;
}
.value-input,
textarea {
  width: 100%;
  border: 1px solid #cbd5df;
  border-radius: 14px;
  color: var(--ink);
  background: #fbfcfd;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.value-input {
  height: 62px;
  margin-top: 9px;
  padding: 0 18px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(.9rem, 2vw, 1.05rem);
}
textarea {
  padding: 15px 16px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
}
.value-input:focus,
textarea:focus {
  border-color: #2f92c9;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 164, 239, .11);
}
.value-input[aria-invalid="true"] {
  border-color: #d92d20;
  box-shadow: 0 0 0 4px rgba(217,45,32,.08);
}
.field-meta { min-height: 26px; margin-top: 8px; }
.field-meta p { margin: 0; font-size: .84rem; }
#source-help { color: var(--muted); }
.field-error { color: var(--danger); font-weight: 750; }
.action-row { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 24px; }
.action-row.compact { margin-top: 15px; }
.primary-button,
.secondary-button,
.copy-button,
.vipps-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border-radius: 13px;
  text-decoration: none;
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}
.primary-button {
  padding: 0 20px;
  border: 1px solid var(--yellow-strong);
  color: var(--navy);
  background: var(--yellow);
  box-shadow: 0 7px 16px rgba(170, 137, 0, .17);
}
.primary-button:hover { transform: translateY(-1px); background: #ffe066; }
.secondary-button {
  padding: 0 18px;
  border: 1px solid #ccd5de;
  color: #344257;
  background: #fff;
}
.secondary-button:hover { background: #f6f8fa; border-color: #aeb9c5; }
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(0, 164, 239, .45);
  outline-offset: 3px;
}
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.result-panel {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid #d9e1e8;
  border-radius: 18px;
  background: #f8fafc;
  transition: border-color .2s ease, background .2s ease;
}
.result-panel[data-state="success"] { border-color: #9dd9ba; background: #f3fbf7; }
.result-panel[data-state="error"] { border-color: #f1b6b0; background: #fff7f6; }
.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.result-kicker { color: #6b7a8d; font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.result-heading h3 { margin: 4px 0 0; font-size: 1.05rem; }
.result-status {
  padding: 6px 10px;
  border-radius: 999px;
  color: #697789;
  background: #e9eef3;
  font-size: .75rem;
  font-weight: 850;
}
.result-panel[data-state="success"] .result-status { color: var(--success); background: #dff4e9; }
.result-panel[data-state="error"] .result-status { color: var(--danger); background: #ffe5e2; }
.result-value-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: stretch;
  margin-top: 15px;
}
.result-output {
  min-height: 56px;
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
  padding: 14px 16px;
  border: 1px solid #d5dde5;
  border-radius: 12px;
  color: #566477;
  background: #fff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .94rem;
}
.result-panel[data-state="success"] .result-output { color: #123e2a; border-color: #b5e3ca; }
.copy-button { padding: 0 18px; border: 1px solid var(--navy); color: #fff; background: var(--navy); }
.copy-button:hover:not(:disabled) { background: var(--navy-2); }
.result-note { margin: 13px 0 0; color: var(--muted); font-size: .83rem; }

.batch-card {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(6,26,47,.05);
}
.batch-card summary {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
}
.batch-card summary::-webkit-details-marker { display: none; }
.batch-card summary span:first-child { display: flex; flex-direction: column; }
.batch-card summary small { color: var(--muted); }
.summary-icon { font-size: 1.8rem; transition: transform .18s ease; }
.batch-card[open] .summary-icon { transform: rotate(45deg); }
.batch-body { padding: 0 24px 25px; }
.batch-body > label { display: block; margin-bottom: 8px; font-weight: 850; }
.batch-message { min-height: 24px; margin: 12px 0 0; color: var(--muted); font-size: .86rem; }
.table-wrap { overflow-x: auto; margin-top: 15px; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; min-width: 780px; font-size: .83rem; }
th,
td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: #536277; background: #f6f8fa; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
td:nth-child(2),
td:nth-child(3) { font-family: "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
.status-ok { color: var(--success); font-weight: 850; }
.status-error { color: var(--danger); font-weight: 850; }

.other-tools-section {
  padding: 0 0 78px;
}
.section-heading {
  max-width: 760px;
  margin-bottom: 26px;
}
.section-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}
.section-heading > p:last-child {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}
.other-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.other-tool-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(6, 26, 47, .055);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.other-tool-card:hover {
  transform: translateY(-3px);
  border-color: #cbd6e1;
  box-shadow: 0 20px 48px rgba(6, 26, 47, .1);
}
.other-tool-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 15px;
  color: var(--navy);
  background: #fff3ad;
  font-size: 1.45rem;
  font-weight: 900;
}
.other-tool-label {
  display: block;
  margin-bottom: 7px;
  color: #8b6800;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .11em;
}
.other-tool-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.other-tool-card p {
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: .94rem;
}
.other-tool-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 0 16px;
  border-radius: 13px;
  color: #fff;
  background: var(--navy);
  text-decoration: none;
  font-weight: 850;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.other-tool-link:hover {
  color: var(--navy);
  background: var(--yellow);
}

.coffee-section { padding: 0 0 84px; }
.coffee-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 34px;
  border: 1px solid #efda77;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff9dd, #fff4b9);
}
.coffee-card .eyebrow { color: #8b6800; }
.coffee-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background: var(--yellow);
  font-size: 2rem;
}
.coffee-copy p:last-child { margin: 9px 0 0; color: #6f6542; }
.coffee-action { display: flex; align-items: center; gap: 15px; }
.coffee-action strong { font-size: 1.35rem; white-space: nowrap; }
.vipps-button { min-height: 51px; padding: 0 20px; color: #fff; background: #ff5b24; }
.vipps-button:hover { transform: translateY(-1px); filter: brightness(.96); }

.site-footer { color: #9fb0c1; background: #03111f; }
.footer-inner {
  min-height: 150px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 35px;
}
.footer-brand img { display: block; width: 84px; height: 84px; }
.footer-inner p { margin: 0; }
.footer-inner > span { white-space: nowrap; }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: min(360px, calc(100% - 40px));
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 15px 40px rgba(0,0,0,.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 950px) {
  .other-tools-grid { grid-template-columns: 1fr; }
  .other-tool-card { min-height: auto; }
  .coffee-card { grid-template-columns: auto 1fr; }
  .coffee-action { grid-column: 1 / -1; }
  .footer-inner { grid-template-columns: auto 1fr; }
  .footer-inner > span { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .container { width: min(100% - 28px, var(--container)); }
  .header-tool-name { display: none; }
  .converter-section { padding: 52px 0 64px; }
  .tool-intro h1 { font-size: clamp(2.5rem, 13vw, 4.3rem); }
  .converter-heading { flex-direction: column; gap: 16px; }
  .direction-switch { width: 100%; }
  .direction-button { padding: 0 10px; font-size: .85rem; }
  .result-value-row { grid-template-columns: 1fr; }
  .copy-button { min-height: 46px; }
  .other-tools-section { padding: 0 0 56px; }
  .other-tool-card { padding: 23px; }
  .coffee-section { padding: 0 0 62px; }
  .coffee-card { grid-template-columns: 1fr; padding: 26px; }
  .coffee-action { grid-column: auto; flex-direction: column; align-items: stretch; }
  .footer-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 30px 0;
  }
  .footer-inner > span { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
