[hidden] {
  display: none !important;
}

input[type="checkbox"] {
  width: auto;
}

:root {
  color-scheme: light;
  --ink: #14262e;
  --muted: #4d6470;
  --line: #d5e1e6;
  --paper: #eef3f4;
  --card: #ffffff;
  --header: #12323a;
  --accent: #0f766e;
  --accent-ink: #084843;
  --source: #fff6ea;
  --source-ink: #9a3412;
  --si: #0f766e;
  --iec: #9a3412;
  --focus: #0f766e;
  --header-h: 48px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 180px),
    var(--paper);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.skip {
  position: absolute;
  left: 8px;
  top: -40px;
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
  z-index: 80;
}

.skip:focus {
  top: 8px;
}

.wrap {
  width: min(1360px, calc(100% - 20px));
  margin-inline: auto;
}

.site-header {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header);
  color: #f3fbfa;
}

.bar {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand {
  color: inherit;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-size: 16px;
  flex: 0 0 auto;
}

.header-nav {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.header-nav a {
  color: #d5ebe8;
  text-decoration: none;
  font-size: 13px;
}

.header-nav a:hover {
  color: #fff;
}

.lang-menu {
  margin-left: auto;
  position: relative;
  flex: 0 0 auto;
}

.lang-menu summary {
  list-style: none;
  cursor: pointer;
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 13px;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  min-width: 148px;
  box-shadow: 0 10px 28px rgba(18, 50, 58, 0.18);
}

.lang-menu a {
  display: block;
  padding: 6px 8px;
  border-radius: 7px;
  color: inherit;
  text-decoration: none;
}

.lang-menu a:hover,
.lang-menu a[aria-current="page"] {
  background: #e7f4f2;
}

.first-screen {
  display: grid;
  align-content: start;
  gap: 6px;
  padding-top: 8px;
  padding-bottom: 6px;
}

.first-screen > * {
  grid-column: 1 / -1;
  min-width: 0;
}

.notice,
.status-bar,
.banner {
  grid-column: 1 / -1;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.035em;
  font-weight: 740;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
}

.tab {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.toolbar-main,
.css-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}

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

select,
.toolbar button,
.copy-btn,
.css-context input,
input.value {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

select {
  width: auto;
  padding: 0 6px;
}

.toolbar button,
.copy-btn {
  padding: 0 8px;
  cursor: pointer;
  font-size: 12px;
}

.toolbar button:hover,
.copy-btn:hover {
  border-color: var(--accent);
}

.css-context input {
  width: 4.4rem;
  padding: 0 6px;
}

.unit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  min-width: 0;
}

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

.unit-grid.split {
  align-items: start;
}

.unit-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.col-label {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 750;
}

.col-label.si {
  color: var(--si);
}

.col-label.iec {
  color: var(--iec);
}

.unit-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(72px, 0.9fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
  min-height: 32px;
  padding: 2px 6px 2px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.unit-row.is-source {
  background: var(--source);
  border-color: #f0c48a;
  box-shadow: inset 3px 0 0 var(--source-ink);
}

.unit-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.symbol {
  flex: 0 0 auto;
  font-weight: 750;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.uname {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.source-badge {
  flex: 0 0 auto;
  color: var(--source-ink);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input.value {
  width: 100%;
  min-width: 0;
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}

.formula {
  margin: 0;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

.formula-lead,
.formula-note,
.formula-math {
  margin: 0;
}

.formula-lead {
  font-size: 12px;
  font-weight: 700;
}

.formula-math {
  margin-top: 2px;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.35;
  white-space: pre-line;
}

.formula-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.below {
  display: grid;
  gap: 14px;
  padding: 8px 0 20px;
}

.panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 0;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.panel p {
  margin: 0 0 8px;
}

.panel p:last-child {
  margin-bottom: 0;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding: 6px 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 680;
}

.faq-item p {
  margin: 6px 0 2px;
  color: var(--ink);
}

.disclosure {
  background: #fff6e4;
  border: 1px solid #efd3a4;
  border-radius: 8px;
  padding: 8px 10px;
  color: #3f2a12;
}

.partner-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.partner-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.partner-card:hover {
  border-color: var(--accent);
}

.partner-card strong {
  color: var(--accent-ink);
}

.partner-card span {
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 6px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer p {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-bar {
  min-height: 0;
  font-size: 12px;
  color: var(--accent-ink);
  font-weight: 700;
}

.copy-sink {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (min-width: 1100px) {
  h1 {
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .header-nav {
    display: none;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .tab {
    flex: 1 1 auto;
  }

  .unit-grid,
  .unit-grid.n-3,
  .unit-grid.split,
  .partner-row {
    grid-template-columns: 1fr;
  }

  h1 {
    white-space: normal;
  }

  .site-footer p {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .unit-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label copy"
      "value value";
  }

  .unit-label {
    grid-area: label;
  }

  input.value {
    grid-area: value;
  }

  .copy-btn {
    grid-area: copy;
  }
}
