:root {
  --bg: #f4f1ea;
  --ink: #141816;
  --muted: #5a635c;
  --line: #d8d2c6;
  --card: #fffdf9;
  --accent: #0b6e4f;
  --accent-soft: #e7f2ec;
  --accent-ink: #063d2c;
  --accent-glow: rgba(11, 110, 79, 0.12);
  --success: #059669;
  --shadow: 0 10px 30px rgba(20, 24, 22, 0.06);
  --shadow-sm: 0 2px 8px rgba(20, 24, 22, 0.05);
  --max: 52rem;
  --sans: "IBM Plex Sans", "Noto Sans SC", "Noto Sans JP", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 0.85rem;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(900px 420px at 8% -5%, #dceee4 0%, transparent 58%),
    radial-gradient(700px 360px at 95% 0%, #efe8dc 0%, transparent 55%),
    linear-gradient(180deg, #ece7de 0%, var(--bg) 42%);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent);
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-header {
  padding: 1.35rem 0 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-primary {
  color: var(--accent);
  letter-spacing: -0.04em;
  margin-right: 0.12em;
}

.brand-secondary {
  font-weight: 600;
  color: var(--ink);
  opacity: 0.88;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  font-size: 0.76rem;
  max-width: min(100%, 36rem);
  justify-content: flex-end;
}

.lang-switch a {
  text-decoration: none;
  padding: 0.22rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lang-switch a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.lang-switch a[aria-current="page"] {
  border-color: #b9cfc4;
  background: var(--card);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 0 0 0.85rem;
}

h2 {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  letter-spacing: -0.02em;
  margin: 2rem 0 0.85rem;
}

.lead {
  color: var(--muted);
  margin: 0 0 1.75rem;
  max-width: 42rem;
  font-size: 1.05rem;
}

.meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.35rem;
}

.sheet-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  gap: 0.8rem;
}

.sheet-list a {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sheet-list a:hover {
  border-color: #b9cfc4;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.sheet-list strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.02rem;
}

.sheet-list span {
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  margin: 1.25rem 0 1.75rem;
  box-shadow: var(--shadow-sm);
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: #f8f5ef;
}

.md-copy-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.md-copy-btn:hover {
  background: var(--accent-soft);
  border-color: #b9cfc4;
}

.md-copy-done {
  background: #ecfdf5;
  border-color: #86efac;
  color: var(--success, #059669);
}

.direct-answer {
  margin: 0.35rem 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: rgba(231, 242, 236, 0.55);
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.45;
}

.direct-answer strong {
  font-weight: 700;
}

.faq .direct-answer {
  margin: 0.15rem 0 0.5rem 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.72rem 0.95rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f3efe8;
}

tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background: rgba(231, 242, 236, 0.35);
}

td:first-child,
th:first-child {
  font-family: var(--mono);
  white-space: nowrap;
}

.notes {
  margin: 0 0 2rem;
  padding-left: 1.15rem;
  color: var(--muted);
}

.notes li {
  margin-bottom: 0.4rem;
}

.related {
  margin: 2.25rem 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.related ul {
  padding-left: 1.15rem;
}

.site-footer {
  margin: 3.5rem 0 2rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.faq {
  margin: 2.25rem 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.faq dt {
  font-weight: 600;
  margin-top: 1rem;
}

.faq dd {
  margin: 0.3rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.cat-link {
  color: inherit;
  text-decoration: none;
}

.cat-link:hover {
  color: var(--accent);
}

.more-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.guide {
  margin: 1.75rem 0;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.45);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.guide h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.guide p {
  margin: 0;
  color: var(--muted);
}

.ad-slot {
  margin: 1.25rem 0;
  padding: 0.35rem;
  min-height: 90px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- converter card ---------- */

.converter-card {
  margin: 1.75rem 0 2rem;
  padding: 1.25rem 1.35rem 1.15rem;
  border: 1px solid #c5ddd2;
  border-radius: calc(var(--radius) + 0.1rem);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(231, 242, 236, 0.55) 100%);
  box-shadow: var(--shadow);
}

.converter-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1.1rem;
}

.converter-badge {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  background: var(--accent);
  color: #ecfdf5;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 6px 16px var(--accent-glow);
}

.converter-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.converter-lead {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.converter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: end;
}

.cv-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cv-field select,
.cv-field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  font-size: 1rem;
  font-family: var(--mono);
  background: var(--card);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cv-field select:focus,
.cv-field input:focus {
  outline: none;
  border-color: #8ecdb3;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.cv-field-out input {
  background: #f7fbf9;
  font-weight: 600;
  color: var(--accent-ink);
}

.cv-swap {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.cv-swap:hover {
  background: var(--accent-soft);
  border-color: #b9cfc4;
  transform: rotate(180deg);
}

.converter-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.cv-btn {
  padding: 0.55rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #ecfdf5;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.cv-btn:hover {
  background: var(--accent-ink);
}

.cv-btn-done {
  background: #15803d;
  border-color: #15803d;
}

@media (max-width: 640px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }

  .cv-swap {
    justify-self: center;
    margin: 0.15rem 0;
  }

  .converter-foot {
    justify-content: stretch;
  }

  .cv-btn {
    width: 100%;
  }
}
