:root {
  --ink: #10233d;
  --muted: #5d6d82;
  --line: #dce5ef;
  --soft: #f3f8fc;
  --surface: #ffffff;
  --brand: #0576b9;
  --brand-dark: #075d91;
  --brand-soft: #e7f5ff;
  --accent: #12a389;
  --warning: #b96a05;
  --shadow: 0 18px 45px rgba(27, 58, 87, .1);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #fbfdff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; }
button, textarea, input { font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.section { padding: 72px 0; }
.soft-section { background: var(--soft); border-block: 1px solid #e8f0f6; }
.muted { color: var(--muted); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(220, 229, 239, .9);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}
.header-row { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
.brand img { width: 146px; height: 32px; object-fit: contain; object-position: left center; }
.brand span { display: none; }
.main-nav { display: flex; align-items: center; gap: 24px; font-size: .94rem; font-weight: 650; }
.main-nav > a { color: #334c68; }
.language-menu { position: relative; }
.language-menu summary { color: #334c68; cursor: pointer; list-style: none; }
.language-menu summary::-webkit-details-marker { display: none; }
.language-panel {
  position: absolute;
  right: 0;
  top: 34px;
  width: 220px;
  max-height: 380px;
  overflow: auto;
  display: grid;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow);
}
.language-panel a { padding: 8px 10px; border-radius: 8px; color: #334c68; }
.language-panel a:hover { background: var(--brand-soft); }

.hero {
  padding: 78px 0 64px;
  background:
    radial-gradient(circle at 12% 18%, rgba(18,163,137,.13), transparent 28%),
    radial-gradient(circle at 88% 24%, rgba(5,118,185,.18), transparent 32%),
    linear-gradient(155deg, #f8fcff 0%, #eaf7ff 100%);
  border-bottom: 1px solid #dbeaf4;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 54px; align-items: center; }
.hero h1, .page-header h1, .article-header h1 {
  margin: 8px 0 18px;
  font-size: clamp(2.5rem, 6vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -.055em;
  color: #092b48;
}
.tool-hero h1, .narrow-header h1 { font-size: clamp(2.35rem, 5vw, 4.15rem); }
.hero-lead { max-width: 780px; margin: 0 0 22px; font-size: clamp(1.12rem, 2.3vw, 1.42rem); line-height: 1.55; color: #38536d; }
.hero-copy > p:not(.hero-lead), .narrow-header > p:not(.hero-lead) { color: var(--muted); }
.eyebrow { color: var(--brand-dark); font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .13em; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; color: #285670; font-weight: 650; font-size: .92rem; }
.hero-note { padding: 26px; border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius); background: rgba(255,255,255,.72); box-shadow: 0 15px 45px rgba(19, 72, 105, .11); }
.hero-note strong { font-size: 1.15rem; }
.hero-note p { margin-bottom: 0; color: var(--muted); }
.narrow-header { max-width: 920px; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; padding-top: 20px; color: var(--muted); font-size: .87rem; }
.breadcrumbs a { color: var(--muted); }

.workspace-section { position: relative; z-index: 2; margin-top: -30px; padding-bottom: 58px; }
.tool-workspace { padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.option-panel { margin-bottom: 22px; padding: 20px; border: 1px solid #cde5f3; border-radius: var(--radius); background: #f3fbff; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.section-heading h2 { margin: 4px 0 0; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.15; letter-spacing: -.035em; }
.compact-heading { align-items: center; margin-bottom: 16px; }
.compact-heading h2 { font-size: 1.35rem; }
.option-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.option-card { display: flex; align-items: flex-start; gap: 10px; min-height: 86px; padding: 13px; border: 1px solid #d5e5ef; border-radius: 13px; background: white; cursor: pointer; transition: .18s ease; }
.option-card:hover { border-color: #70b6db; transform: translateY(-1px); }
.option-card input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); }
.option-card span { display: grid; gap: 3px; }
.option-card strong { font-size: .89rem; line-height: 1.35; }
.option-card small { color: var(--muted); font-size: .76rem; line-height: 1.35; }

.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.editor-pane { min-width: 0; }
.editor-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; font-size: .86rem; color: var(--muted); }
.editor-label label { color: var(--ink); font-weight: 750; }
.editor-pane textarea {
  width: 100%;
  min-height: 330px;
  resize: vertical;
  padding: 17px;
  border: 1px solid #cfdbe7;
  border-radius: 14px;
  outline: none;
  background: white;
  color: #152c45;
  line-height: 1.65;
  transition: border .18s ease, box-shadow .18s ease;
}
.editor-pane textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(5,118,185,.11); }
#output-text { background: #f8fbfd; }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 11px; }
.left-actions { justify-content: flex-start; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 750; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--brand); border-color: var(--brand); }
.button.primary:hover { background: var(--brand-dark); color: white; }
.button.secondary { color: #29445e; background: white; border-color: #cbd8e4; }
.button.secondary:hover { border-color: #82b8d5; color: var(--brand-dark); }
.button.small { min-height: 36px; padding: 7px 12px; font-size: .82rem; }
#file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-button { cursor: pointer; }

.batch-panel { margin-top: 18px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #bce2d9; border-radius: 14px; background: #effcf8; }
.batch-panel[hidden] { display: none; }
.batch-panel p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.result-dashboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.metric-card { display: grid; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdff; }
.metric-card span { color: var(--muted); font-size: .77rem; }
.metric-card strong { font-size: 1.35rem; color: #113a59; }
.report-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.report-panel > summary { padding: 15px 18px; cursor: pointer; background: #f7fafc; font-weight: 800; }
.report-content { display: grid; gap: 22px; padding: 18px; }
.change-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.change-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: #3b536b; font-size: .85rem; }
.change-item strong { color: var(--ink); }
.annotated-preview { min-height: 110px; max-height: 340px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 14px; border: 1px solid #d5e0e9; border-radius: 12px; background: #fbfcfd; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .87rem; line-height: 1.8; }
.char-marker { display: inline-flex; margin: 0 1px; padding: 0 5px; border: 1px solid #edbd61; border-radius: 5px; background: #fff0bd; color: #704006; font-size: .68rem; font-weight: 800; vertical-align: middle; }
.unicode-report, .style-report { overflow-x: auto; }
.unicode-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.unicode-table th, .unicode-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.unicode-table th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.style-findings { display: grid; gap: 10px; }
.style-finding { padding: 13px 14px; border-left: 4px solid var(--warning); border-radius: 8px; background: #fff9ee; }
.style-finding strong { display: block; }
.style-finding p { margin: 4px 0 0; color: #655540; }

.page-header { max-width: 860px; margin-bottom: 42px; }
.page-header h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
.page-header p, .article-header p { color: var(--muted); font-size: 1.13rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.content-card { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 8px 24px rgba(30,68,99,.05); }
.content-card h3 { margin: 8px 0 9px; font-size: 1.25rem; line-height: 1.3; }
.content-card h3 a { color: var(--ink); }
.content-card p { margin: 0 0 16px; color: var(--muted); }
.card-kicker { color: var(--brand-dark); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.text-link { font-weight: 800; }
.text-link span { transition: margin .18s ease; }
.text-link:hover span { margin-left: 3px; }
.guide-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.split-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr); gap: 70px; align-items: center; }
.split-section h2, .faq-summary h2 { margin: 8px 0 18px; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.12; letter-spacing: -.04em; }
.split-section p { color: var(--muted); }
.feature-stack { display: grid; gap: 12px; }
.feature-stack article { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.feature-stack p { margin: 4px 0 0; }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 60px; align-items: start; }
.prose { color: #334b63; font-size: 1.04rem; }
.prose h2 { margin: 38px 0 12px; color: var(--ink); font-size: 1.85rem; line-height: 1.2; letter-spacing: -.025em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 28px; color: var(--ink); }
.prose p { margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }
.method-card, .article-aside { position: sticky; top: 94px; padding: 22px; border: 1px solid #cfe2ef; border-radius: 16px; background: #f2faff; }
.method-card strong { display: block; margin: 7px 0; font-size: 1.1rem; }
.method-card p, .article-aside p { color: var(--muted); }
.example-grid { display: grid; gap: 18px; }
.example-card { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.example-card h3 { margin: 0 0 8px; font-size: .83rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.example-card pre { min-height: 100px; margin: 0; padding: 13px; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 10px; background: #f5f8fa; color: #203a52; }
.example-card > p { grid-column: 1 / -1; margin: 0; color: var(--muted); }

.faq-summary { max-width: 900px; }
.faq-summary details { border-bottom: 1px solid var(--line); }
.faq-summary summary { padding: 18px 0; cursor: pointer; font-weight: 800; }
.faq-summary details p { margin: -4px 0 18px; color: var(--muted); }
.article-layout { display: grid; grid-template-columns: minmax(0, 760px) 280px; justify-content: space-between; gap: 60px; align-items: start; }
.article-header { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.article-header h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
.article-header time { color: var(--muted); font-size: .85rem; }
.article-prose { padding-top: 34px; }
.article-aside strong { font-size: 1.12rem; }
.article-aside .button { width: 100%; }
.narrow-page { max-width: 860px; }
.empty-state { min-height: 55vh; display: grid; align-content: center; justify-items: start; }
.empty-state h1 { margin: 5px 0; font-size: 3rem; }

.step-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.step-grid article { padding: 20px; border-radius: 15px; background: white; border: 1px solid var(--line); }
.step-grid article > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: white; font-weight: 800; }
.step-grid h3 { margin-bottom: 6px; }
.step-grid p { color: var(--muted); }

.site-footer { padding: 58px 0 22px; border-top: 1px solid #d9e4ec; background: #0f2b42; color: #b9c9d6; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 54px; }
.footer-grid > div { display: grid; align-content: start; justify-items: start; gap: 8px; }
.footer-grid h2 { margin: 0 0 8px; color: white; font-size: .93rem; }
.footer-grid a { color: #cad7e1; }
.footer-grid p { max-width: 430px; }
.footer-brand { color: white; }
.footer-bottom { margin-top: 38px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; }

@media (max-width: 980px) {
  .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid, .guide-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-layout, .article-layout { grid-template-columns: 1fr; }
  .method-card, .article-aside { position: static; }
  .step-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .header-row { min-height: 62px; }
  .brand img { width: 118px; }
  .main-nav { gap: 13px; font-size: .84rem; }
  .main-nav > a:nth-child(3) { display: none; }
  .hero { padding: 58px 0 48px; }
  .hero-grid, .split-section { grid-template-columns: 1fr; gap: 28px; }
  .workspace-section { margin-top: -18px; }
  .tool-workspace { padding: 14px; border-radius: 18px; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-pane textarea { min-height: 260px; }
  .result-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .change-list { grid-template-columns: 1fr; }
  .section { padding: 54px 0; }
  .section-heading { align-items: flex-start; }
  .card-grid, .guide-card-grid, .example-card { grid-template-columns: 1fr; }
  .example-card > p { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .container { width: min(100% - 22px, 1180px); }
  .main-nav > a:nth-child(2) { display: none; }
  .option-grid, .step-grid { grid-template-columns: 1fr; }
  .editor-actions { flex-wrap: wrap; }
  .button { flex: 1; }
  .batch-panel { align-items: stretch; flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div:first-child { grid-column: auto; }
}
