.ck-header .wrap, .ck-main.wrap {
  width: min(var(--ck-content), calc(100% - 64px));
  max-width: none;
  padding-inline: 0;
}
.ck-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: relative;
  z-index: 2;
}
.ck-header-row { display: flex; align-items: center; gap: var(--space-3); min-height: 76px; }
.ck-brand {
  display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto;
  min-height: 44px; color: var(--fg); text-decoration: none; font-size: 24px; font-weight: 750; letter-spacing: -.045em;
}
.ck-brand span {
  display: grid; place-items: center; width: 35px; height: 35px; border-radius: var(--ck-small-radius);
  color: var(--ck-on-brand); background: var(--ck-action); font-size: 25px; line-height: 1; letter-spacing: 0;
}
.ck-header nav, .ck-crumbs, .ck-detail-jumps { margin: 0; }
.ck-header nav a, .ck-crumbs a, .ck-detail-jumps a { color: var(--fg); }
.ck-header nav a:hover, .ck-crumbs a:hover, .ck-detail-jumps a:hover { color: var(--brand); text-decoration: underline; }
.ck-header nav a, .ck-header summary { font-size: 14px; font-weight: 650; }
.ck-header .ck-desktop-nav { flex: 1; }
.ck-header details, .ck-all-topics { border: 0; }
.ck-header details { position: relative; flex: 0 0 auto; }
.ck-header summary {
  display: flex; align-items: center; gap: 6px; list-style: none; min-height: 44px;
  padding: 6px 8px; color: var(--fg);
}
.ck-header summary::-webkit-details-marker, .ck-all-topics summary::-webkit-details-marker { display: none; }
.ck-header details nav {
  position: absolute; inset: 100% 0 auto auto; display: grid; min-width: 158px; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--ck-small-radius); background: var(--surface);
}
.ck-header details:not([open]) nav, .ck-header .ck-mobile-menu { display: none; }
.ck-header details nav a { padding-inline: 12px; border-radius: 6px; }
.ck-store, .ck-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: var(--ck-small-radius); color: var(--fg);
  font-size: 14px; font-weight: 650; text-decoration: none; line-height: 1.4;
}
.ck-store:hover, .ck-button:hover { border-color: var(--brand); color: var(--brand); }
.ck-main { padding-block: var(--space-4) var(--space-6); }
.ck-main h1, .ck-main h2, .ck-main h3 { line-height: 1.13; }
.ck-main p { overflow-wrap: anywhere; }
.ck-home-hero, .ck-category-hero {
  display: grid; grid-template-columns: 1.15fr minmax(0, .86fr); align-items: center;
  gap: clamp(24px, 6vw, 80px); padding-block: 12px var(--space-5);
}
.ck-home-hero h1 { font: 400 clamp(40px, 5.5vw, 72px)/1.04 var(--ck-serif); letter-spacing: -.047em; max-width: none; }
.ck-home-hero h1 em { color: var(--brand); display: block; font-style: normal; }
.ck-home-hero .lead, .ck-category-hero .lead { font-size: 17px; max-width: 56ch; margin-block: 0 var(--space-3); }
.ck-search-line {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--brand);
  border-radius: var(--ck-small-radius); background: var(--surface); padding: 6px 6px 6px 16px;
}
.ck-search-line:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.ck-search-line svg { flex-shrink: 0; }
.ck-search-line input {
  border: 0; background: transparent; color: var(--fg); width: 100%; min-height: 40px;
  min-width: 0; padding-inline: 2px; font: inherit; font-size: 16px; outline: 0;
}
.ck-search-line input::placeholder { color: var(--muted); opacity: 1; }
.ck-search-line button {
  flex: 0 0 44px; padding: 0; border: 0; border-radius: 8px; min-height: 44px;
  background: var(--ck-action); color: var(--ck-on-brand); font-size: 20px; cursor: pointer;
}
.ck-search-line button:hover { background: var(--ck-action-hover); }
.ck-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.ck-suggestions button, #clear-search, #category-filter select {
  color: var(--fg); font: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 10px; min-height: 38px; cursor: pointer;
}
.ck-suggestions button:hover, #clear-search:hover { border-color: var(--brand); color: var(--brand); }
.ck-hero-example {
  min-width: 0; padding: clamp(18px, 3vw, 32px); background: var(--brand-soft);
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
}
.ck-hero-example h2 { font-size: clamp(20px, 2.2vw, 26px); margin-bottom: 10px; }
.ck-hero-example p { font-size: 15px; color: var(--muted); }
.ck-hero-example a { display: inline-block; min-height: 44px; padding-block: 10px; color: var(--fg); font-size: 14px; font-weight: 650; }
.ck-example-results {
  display: grid; grid-template-columns: 1fr 1fr; margin: var(--space-3) 0 8px; border-radius: var(--ck-small-radius);
  background: var(--ck-action); color: var(--ck-on-brand); padding: var(--space-2) var(--space-3);
}
.ck-example-results div + div { border-left: 1px solid currentColor; padding-left: var(--space-3); }
.ck-example-results dt { font-size: 13px; }
.ck-example-results dd { margin: 0; font-size: clamp(24px, 3.5vw, 36px); line-height: 1.3; font-weight: 750; }
.ck-example-results small { font-size: 14px; font-weight: 500; }
.ck-section { margin-bottom: var(--space-5); }
.ck-section + .ck-section { border-top: 1px solid var(--border); padding-top: var(--space-4); }
.ck-topics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.ck-topics a {
  display: flex; flex-direction: column; align-items: start; gap: 6px; padding: 13px 12px;
  border: 1px solid var(--border); border-radius: var(--ck-small-radius); color: var(--fg); text-decoration: none; line-height: 1.35;
}
.ck-topics a:hover, .ck-card:hover { border-color: var(--brand); }
.ck-topics strong { font-size: 14px; }
.ck-topics svg { color: var(--brand); }
.ck-topics small, .ck-section-heading > span, .ck-card-meta, .ck-legacy-list { color: var(--muted); font-size: 13px; }
.ck-all-topics:last-child { border: 0; margin-top: 8px; }
.ck-all-topics summary { color: var(--brand); font-size: 14px; padding: 10px 0; min-height: 44px; }
.ck-all-topics nav { margin: 0; }
.ck-all-topics nav a { border: 1px solid var(--border); border-radius: 7px; }
.ck-section-heading { display: flex; gap: 10px 20px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-2); }
.ck-section-heading h2 { margin-bottom: 0; }
#category-filter { display: flex; align-items: center; gap: 8px; font-size: 14px; }
#category-filter select { max-width: min(52vw, 220px); }
.ck-tool-group { margin-block: var(--space-3); }
.ck-tool-group > h3 { margin-bottom: var(--space-2); color: var(--muted); font-size: 16px; }
.ck-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ck-card {
  display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--ck-card-radius); background: var(--surface); padding: var(--space-2);
}
.ck-card-name { font-size: 18px; line-height: 1.22; margin: 6px 0; }
.ck-card p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.ck-card-topic { font-size: 12px; color: var(--brand); }
.ck-card-meta { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; }
.ck-card-meta span { overflow-wrap: anywhere; }
.ck-card-meta span + span { color: var(--brand); }
.ck-legacy-list { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.ck-legacy-link { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 7px; }
#legacy-tools, #catalog-empty { margin-top: var(--space-4); }
#legacy-tools h3 small { color: var(--muted); font-size: 12px; font-weight: 500; margin-left: 4px; }
.ck-steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; }
.ck-steps li { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--ck-card-radius); padding: var(--space-2); }
.ck-steps h3 { margin-bottom: 8px; }
.ck-steps p { color: var(--muted); font-size: 15px; }
.ck-app {
  display: grid; grid-template-columns: 1fr auto; gap: 12px var(--space-3); align-items: center;
  border: 1px solid var(--border); border-radius: var(--ck-card-radius); background: var(--surface); padding: var(--space-3); margin-top: var(--space-5);
}
.ck-app h2 { font-size: 23px; margin: 0 0 8px; }
.ck-app p { font-size: 15px; color: var(--muted); }
.ck-app details { grid-column: 1 / -1; }
.ck-app summary { min-height: 44px; padding: 10px 0; }
.ck-share-note { margin-top: 10px; font-size: 14px; color: var(--muted); }
.ck-crumbs { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: var(--space-2); }
.ck-crumbs a { padding: 0; min-height: 32px; font-size: inherit; }
.ck-crumbs > :not(:first-child)::before { content: "/"; margin-right: 8px; color: var(--muted); }
.ck-category-hero { padding-top: 0; }
.ck-category-hero h1 { max-width: none; }
.ck-category-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.ck-category-sidebar {
  display: grid; margin: 0; gap: 3px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--ck-card-radius); background: var(--surface);
}
.ck-category-sidebar a { justify-content: space-between; border-radius: 8px; padding-inline: 10px; }
.ck-category-layout #choose { margin-block: var(--space-4); }
.ck-detail-intro { max-width: var(--ck-reading); }
.ck-detail-intro h1 { font-size: clamp(32px, 4.4vw, 54px); max-width: none; margin-bottom: 12px; }
.ck-detail-intro .lead { font-size: 17px; margin-bottom: 10px; }
.ck-fit { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin-block: 8px; }
.ck-fit li {
  color: var(--brand); background: var(--brand-soft); border-radius: 5px;
  padding: 3px 7px; margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4;
}
.ck-detail-jumps { gap: 4px 16px; margin-bottom: 8px; }
.ck-detail-jumps a { min-height: 44px; padding: 0; font-size: 14px; text-decoration: underline; text-decoration-color: var(--border); }
.ck-pilot .tool, .ck-pilot .calculator {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch;
}
.ck-pilot .tool, .ck-pilot .calculator, .ck-guide .ck-answer { border-radius: var(--ck-card-radius); }
.ck-pilot .calculator > form { min-width: 0; }
.ck-pilot .panel-heading h2, .ck-pilot .result-panel h2 { font-size: 22px; }
.ck-pilot .input-wrap:has([aria-invalid="true"]) { border-color: var(--ck-error); background: var(--ck-error-bg); }
.ck-pilot .field-error { color: var(--ck-error); }
.ck-pilot .action-status:empty { display: none; }
.ck-pilot .calculator .panel-intro { margin-bottom: 12px; }
.ck-pilot #input-context { margin: 16px 0 0; }
.ck-pilot .calculator .input-footnote { margin-top: 18px; }
.ck-pilot .weight output { font-size: clamp(28px, 4vw, 49px); }
.ck-guide { max-width: var(--ck-reading); margin-block: var(--space-4); }
.ck-guide section, .ck-guide aside { margin-bottom: var(--space-4); }
.ck-guide h2 { font-size: clamp(22px, 3.2vw, 30px); margin-bottom: var(--space-2); }
.ck-guide h3 { font-size: 18px; margin-top: var(--space-3); }
.ck-guide li p, .ck-guide time, .ck-input-format { color: var(--muted); font-size: 15px; }
.ck-guide li p { margin-top: 4px; }
.ck-answer, .ck-guide pre {
  padding: clamp(14px, 3vw, 24px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--ck-small-radius);
}
.ck-answer { border-inline-start: 4px solid var(--brand); }
.ck-answer p { font-size: 18px; }
.ck-guide pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.ck-guide pre code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.ck-table { margin-block: var(--space-2); }
.ck-table table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.ck-table td, .ck-table th { text-align: start; vertical-align: top; padding: 9px 7px; border-block-end: 1px solid var(--border); overflow-wrap: anywhere; }
.ck-table th { background: var(--brand-soft); }
.ck-table th:first-child:nth-last-child(3) { width: 31%; }
.ck-table th:nth-child(2):nth-last-child(2) { width: 21%; }
.ck-collection [hidden], .ck-pilot [hidden] { display: none !important; }
@media (max-width: 930px) {
  .ck-header .ck-desktop-nav, .ck-header-row > .ck-store { display: none; }
  .ck-header .ck-mobile-menu { display: block; }
  .ck-language { margin-left: auto; }
  .ck-category-layout { grid-template-columns: minmax(0, 1fr); }
  .ck-category-sidebar { display: flex; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .ck-header .wrap, .ck-main.wrap { width: calc(100% - 32px); }
  .ck-header-row { gap: 8px; min-height: 62px; }
  .ck-brand { font-size: 22px; gap: 7px; }
  .ck-brand span { width: 30px; height: 30px; }
  .ck-main { padding-block: var(--space-2) var(--space-5); }
  .ck-home-hero, .ck-category-hero { grid-template-columns: 1fr; gap: 10px; padding-block: 12px var(--space-4); }
  .ck-home-hero .ck-hero-example, .ck-category-sidebar { display: none; }
  .ck-home-hero h1 { font-size: clamp(36px, 9.5vw, 52px); }
  .ck-home-hero .lead { font-size: 16px; margin-bottom: var(--space-2); }
  .ck-topics, .ck-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ck-topics a { padding: 10px; }
  .ck-steps, .ck-app { grid-template-columns: 1fr; }
  .ck-app .ck-button { justify-self: start; }
  .ck-crumbs { margin-bottom: 8px; }
  .ck-detail-intro h1 { font-size: clamp(29px, 8vw, 43px); }
  .ck-detail-intro .lead { font-size: 16px; line-height: 1.45; }
  .ck-fit li { font-size: 12px; }
  .ck-pilot .tool, .ck-pilot .calculator { grid-template-columns: minmax(0, 1fr); }
  .ck-pilot .tool form, .ck-pilot .calculator form, .ck-pilot .result-panel { padding: 18px; }
  .ck-pilot .result-panel { border-inline-start: 0; border-block-start: 1px solid var(--border); }
  .ck-pilot .field { margin-top: 14px; }
  .ck-pilot .input-wrap { min-height: 50px; }
  .ck-pilot .input-wrap input { padding-block: 9px; }
}
@media (max-width: 460px) {
  .ck-cards { grid-template-columns: 1fr; }
  .ck-section-heading { gap: 8px; }
}
@media print {
  .ck-header, .ck-search, .ck-detail-jumps, .ck-app { display: none; }
}
