.cm-to-feet-inches-tool {
      --space-xs: 4px;
      --space-sm: 8px;
      --space-md: 12px;
      --space-lg: 16px;
      --space-xl: 24px;
      --gray-50: #fbfbfb;
      --gray-100: #f7f7f7;
      --gray-200: #eeeeee;
      --gray-300: #dddddd;
      --gray-400: #bbbbbb;
      --gray-500: #999999;
      --gray-600: #555555;
      --gray-700: #444444;
      --gray-800: #222222;
      --gray-900: #111111;
      --bg-canvas: #ffffff;
      --bg-module: var(--gray-100);
      --bg-hover: var(--gray-200);
      --bg-active: var(--gray-800);
      --text-primary: var(--gray-900);
      --text-secondary: var(--gray-700);
      --text-tertiary: var(--gray-600);
      --text-placeholder: var(--gray-500);
      --text-on-dark: #ffffff;
      --border: var(--gray-300);
      --border-strong: var(--gray-800);
      --success: #276749;
      --danger: #a12424;
      --focus-ring: rgba(17, 17, 17, 0.16);
      --radius: 6px;
      --radius-round: 999px;
      --transition: 0.16s ease;
      --shell-sticky-offset: 0px;
      --font-sans: "Noto Sans SC", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
      --font-mono: "Noto Sans Mono", "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, Monaco, monospace;
    }

    .cm-to-feet-inches-tool, .cm-to-feet-inches-tool * { box-sizing: border-box; }
    .cm-to-feet-inches-tool { scroll-behavior: smooth; }
    .cm-to-feet-inches-tool {
      margin: 0;
      background: var(--bg-canvas);
      color: var(--text-primary);
      font-family: var(--font-sans);
      font-size: 15px;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }
    .cm-to-feet-inches-tool button, .cm-to-feet-inches-tool input, .cm-to-feet-inches-tool select { font: inherit; }
    .cm-to-feet-inches-tool button, .cm-to-feet-inches-tool select { -webkit-tap-highlight-color: transparent; }
    .cm-to-feet-inches-tool button:focus-visible, .cm-to-feet-inches-tool input:focus-visible, .cm-to-feet-inches-tool select:focus-visible, .cm-to-feet-inches-tool a:focus-visible {
      outline: 2px solid var(--border-strong);
      outline-offset: 2px;
    }

    .app-layout {
      width: 100%;
      margin: 0;
      padding: 0 30px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 292px;
      grid-template-areas: "main toc";
      align-items: start;
      column-gap: var(--space-xl);
    }
    .app-header { grid-area: header; padding: var(--space-xl) 0 var(--space-lg); }
    .app-title { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -0.5px; }
    .app-subtitle { margin: var(--space-xs) 0 0; color: var(--text-tertiary); line-height: 1.5; }
    .header-divider { grid-area: divider; width: 100%; height: 1px; background: var(--border); }
    .page { grid-area: main; width: 100%; min-width: 0; padding: var(--space-xl) 0 calc(var(--space-xl) * 2); }

    .toc-panel {
      grid-area: toc;
      position: sticky;
      top: calc(var(--shell-sticky-offset) + var(--space-xl));
      z-index: 5;
      width: 292px;
      max-height: calc(100vh - var(--shell-sticky-offset) - 48px);
      overflow: hidden;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--bg-module);
    }
    .toc-header {
      width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: space-between;
      padding: var(--space-sm) var(--space-md); border: 0; border-bottom: 1px solid var(--border);
      background: transparent; color: var(--text-primary); cursor: pointer; text-align: left;
    }
    .toc-header:hover { background: var(--bg-hover); }
    .toc-title { font-weight: 700; }
    .toc-arrow { color: var(--text-tertiary); transition: transform var(--transition); }
    .toc-body { padding: var(--space-sm); overflow-y: auto; }
    .toc-link { display: block; padding: 9px var(--space-sm); border-radius: var(--radius); color: var(--text-secondary); text-decoration: none; font-weight: 500; line-height: 1.4; }
    .toc-link:hover { background: var(--bg-hover); color: var(--text-primary); }
    .toc-link.active { background: var(--bg-active); color: var(--text-on-dark); font-weight: 700; }
    .toc-panel.collapsed { max-height: 46px; background: var(--bg-canvas); }
    .toc-panel.collapsed .toc-body { display: none; }
    .toc-panel.collapsed .toc-header { border-bottom-color: transparent; }
    .toc-panel.collapsed .toc-arrow { transform: rotate(180deg); }

    .converter-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-module); overflow: hidden; margin-bottom: var(--space-lg); }
    .panel-head { padding: var(--space-lg); border-bottom: 1px solid var(--border); }
    .panel-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.4px; }
    .panel-head p { margin: var(--space-xs) 0 0; color: var(--text-tertiary); line-height: 1.6; }
    .converter-body { padding: var(--space-lg); }

    .conversion-stack { display: grid; gap: var(--space-md); }
    .conversion-row {
      display: grid;
      grid-template-columns: 190px minmax(0, 1fr);
      gap: var(--space-md);
      align-items: center;
      padding: var(--space-md);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--bg-canvas);
    }
    .conversion-label strong { display: block; font-size: 16px; }
    .conversion-label span { display: block; margin-top: 2px; color: var(--text-placeholder); font-size: 13px; line-height: 1.45; }
    .field-group { display: grid; gap: var(--space-xs); }
    .field-group label { color: var(--text-secondary); font-size: 13px; font-weight: 700; }
    .input-shell {
      display: flex; align-items: stretch; min-height: 52px; border: 1px solid var(--border); border-radius: var(--radius);
      background: var(--bg-canvas); overflow: hidden; transition: border-color var(--transition), box-shadow var(--transition);
    }
    .input-shell:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--focus-ring); }
    .input-shell input {
      width: 100%; min-width: 0; border: 0; outline: none; padding: 10px 14px; background: transparent;
      color: var(--text-primary); font-family: var(--font-mono); font-size: 22px; font-variant-numeric: tabular-nums;
    }
    .input-shell input::placeholder { color: var(--text-placeholder); }
    .unit-label { display: flex; align-items: center; padding: 0 14px; border-left: 1px solid var(--border); background: var(--gray-50); color: var(--text-tertiary); font-weight: 700; white-space: nowrap; }
    .feet-inch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
    .settings-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: var(--space-md); align-items: end; margin-top: var(--space-md); }
    .cm-to-feet-inches-tool select {
      width: 100%; min-height: 44px; padding: 9px 38px 9px 12px; border: 1px solid var(--border); border-radius: var(--radius);
      background-color: var(--bg-canvas); color: var(--text-primary); appearance: none;
      background-image: linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%), linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%);
      background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; cursor: pointer;
    }
    .cm-to-feet-inches-tool input:hover, .cm-to-feet-inches-tool select:hover { border-color: var(--gray-400); }
    .cm-to-feet-inches-tool select:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--focus-ring); outline: none; }
    .logic-note { color: var(--text-tertiary); font-size: 13px; line-height: 1.6; }
    .normalization-preview {
      grid-column: 2;
      margin: -2px 0 0;
      padding: 8px 10px;
      border-left: 3px solid var(--gray-700);
      background: var(--gray-50);
      color: var(--text-secondary);
      font-size: 13px;
      line-height: 1.55;
    }
    .normalization-preview[hidden] { display: none; }

    .result-box { margin-top: var(--space-lg); padding: 22px; border: 1px solid var(--gray-800); border-radius: var(--radius); background: var(--gray-900); color: var(--text-on-dark); }
    .result-kicker { color: var(--gray-400); font-size: 13px; font-weight: 700; }
    .result-main { margin-top: var(--space-xs); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
    .result-main strong { font-size: clamp(31px, 6vw, 52px); line-height: 1.15; letter-spacing: -1.5px; }
    .result-main span { color: var(--gray-300); font-size: 17px; }
    .result-secondary { margin-top: var(--space-sm); color: var(--gray-300); line-height: 1.7; overflow-wrap: anywhere; }
    .result-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); margin-top: var(--space-md); }
    .result-stat { padding: 12px; border: 1px solid var(--gray-700); border-radius: var(--radius); background: var(--gray-800); }
    .result-stat small { display: block; color: var(--gray-400); margin-bottom: 3px; }
    .result-stat b { font-family: var(--font-mono); font-size: 19px; overflow-wrap: anywhere; }

    .actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-md); }
    .btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: var(--space-sm) var(--space-md); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-canvas); color: var(--text-primary); cursor: pointer; font-weight: 600; transition: background var(--transition), border-color var(--transition), transform var(--transition); }
    .btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
    .btn:active { transform: translateY(1px); }
    .btn-primary { background: var(--bg-active); border-color: var(--bg-active); color: var(--text-on-dark); }
    .btn-primary:hover { background: var(--bg-active); filter: brightness(1.12); }
    .status { min-height: 22px; color: var(--success); font-size: 13px; font-weight: 700; }
    .status.error { color: var(--danger); }

    .preset-wrap { margin-top: var(--space-lg); }
    .preset-title { margin-bottom: var(--space-sm); color: var(--text-secondary); font-size: 13px; font-weight: 700; }
    .preset-list { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
    .preset { padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-canvas); color: var(--text-secondary); cursor: pointer; }
    .preset:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--gray-400); }

    .card-block { margin: 16px 0; padding: 18px 22px; background: var(--bg-module); border: 1px solid var(--border); border-radius: var(--radius); transition: background var(--transition); scroll-margin-top: var(--space-xl); }
    #converter, .card-block[id] { scroll-margin-top: var(--space-xl); }
    .card-block:hover { background: #f2f2f2; }
    .card-block h2 { margin: 0 0 8px; padding-left: 12px; border-left: 3px solid #111; color: var(--text-primary); font-size: 24px; line-height: 1.3; letter-spacing: -0.4px; }
    .card-block h3 { margin: 16px 0 4px; font-size: 20px; line-height: 1.4; }
    .card-block p, .card-block li { color: var(--text-secondary); font-size: 16px; line-height: 1.7; }
    .card-block p { margin: 8px 0; }
    .card-block ul { list-style: none; padding: 0; margin: 8px 0; }
    .card-block li { position: relative; padding-left: 18px; margin-bottom: 6px; }
    .card-block li::before { content: ''; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: #111; }
    .formula { margin: 12px 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-canvas); font-family: var(--font-mono); color: var(--text-primary); overflow-wrap: anywhere; }
    .table-wrap { overflow-x: auto; margin-top: 12px; }
    .cm-to-feet-inches-tool table { width: 100%; border-collapse: collapse; background: var(--bg-canvas); }
    .cm-to-feet-inches-tool th, .cm-to-feet-inches-tool td { padding: 11px 12px; border: 1px solid var(--border); text-align: left; white-space: nowrap; }
    .cm-to-feet-inches-tool th { background: var(--gray-100); font-size: 13px; }
    .cm-to-feet-inches-tool td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
    .qa-item { margin: 8px 0; padding: 12px 14px; background: var(--bg-canvas); border: 1px solid var(--border); border-radius: var(--radius); }
    .qa-item strong { display: block; margin-bottom: 3px; }
    .qa-item span { color: var(--text-secondary); font-size: 16px; line-height: 1.6; }

    .accordion-list {
      display: grid;
      gap: var(--space-sm);
      margin-top: var(--space-md);
    }
    details.accordion {
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--bg-canvas);
      overflow: hidden;
    }
    details.accordion summary {
      min-height: 48px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--space-md);
      padding: 12px 14px;
      color: var(--text-primary);
      cursor: pointer;
      font-size: 16px;
      font-weight: 700;
      line-height: 1.45;
      list-style: none;
      user-select: none;
      transition: background var(--transition);
    }
    details.accordion summary::-webkit-details-marker { display: none; }
    details.accordion summary:hover { background: var(--bg-hover); }
    details.accordion summary::after {
      content: '+';
      flex: 0 0 24px;
      width: 24px;
      height: 24px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--border);
      border-radius: var(--radius-round);
      color: var(--text-tertiary);
      font-family: var(--font-mono);
      font-size: 17px;
      line-height: 1;
    }
    details.accordion[open] summary::after { content: '−'; }
    .accordion-content {
      padding: 12px 14px 14px;
      border-top: 1px solid var(--border);
    }
    .accordion-content > :first-child { margin-top: 0; }
    .accordion-content > :last-child { margin-bottom: 0; }
    .accordion-content h3 {
      margin: 14px 0 4px;
      font-size: 17px;
    }
    .example-line {
      margin: 10px 0;
      padding: 10px 12px;
      border-left: 3px solid var(--gray-800);
      background: var(--gray-100);
      color: var(--text-primary);
      font-family: var(--font-mono);
      line-height: 1.6;
      overflow-wrap: anywhere;
    }
    .note-box {
      margin-top: 12px;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--bg-canvas);
      color: var(--text-secondary);
      font-size: 15px;
      line-height: 1.65;
    }
    .section-intro {
      margin: 0 0 10px;
      color: var(--text-secondary);
      font-size: 16px;
      line-height: 1.7;
    }
    .tag-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin: 8px 0;
    }
    .tag {
      padding: 4px 8px;
      border: 1px solid var(--border);
      border-radius: var(--radius-round);
      background: var(--gray-50);
      color: var(--text-tertiary);
      font-size: 13px;
      font-weight: 700;
    }
    .subtle {
      color: var(--text-placeholder) !important;
      font-size: 13px !important;
    }

    .related-tools-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--space-sm);
      margin-top: var(--space-md);
    }
    .related-tool-link {
      display: grid;
      gap: 4px;
      min-height: 74px;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--bg-canvas);
      color: var(--text-primary);
      text-decoration: none;
      transition: background var(--transition), border-color var(--transition);
    }
    .related-tool-link:hover {
      background: var(--bg-hover);
      border-color: var(--border-strong);
    }
    .related-tool-name { font-weight: 700; line-height: 1.4; }
    .related-tool-description {
      color: var(--text-tertiary);
      font-size: 14px;
      line-height: 1.5;
    }
    .empty-state {
      grid-column: 1 / -1;
      padding: 20px;
      border: 1px dashed var(--border);
      border-radius: var(--radius);
      background: var(--gray-50);
      color: var(--text-placeholder);
      text-align: center;
      line-height: 1.65;
    }

    .embed-form { display: grid; gap: var(--space-md); }
    .embed-grid {
      display: grid;
      grid-template-columns: minmax(0, 2fr) minmax(120px, .7fr) minmax(120px, .7fr);
      gap: var(--space-sm);
    }
    .embed-field { display: grid; gap: 5px; min-width: 0; }
    .embed-field label {
      color: var(--text-secondary);
      font-size: 13px;
      font-weight: 700;
    }
    .embed-field input,
    .embed-field textarea {
      width: 100%;
      min-height: 40px;
      padding: 9px 11px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--bg-canvas);
      color: var(--text-primary);
      font-family: var(--font-mono);
      font-size: 14px;
      line-height: 1.55;
    }
    .embed-field textarea {
      min-height: 132px;
      resize: vertical;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }
    .embed-field input:focus,
    .embed-field textarea:focus {
      border-color: var(--border-strong);
      box-shadow: 0 0 0 3px var(--focus-ring);
      outline: none;
    }
    .embed-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
    .source-preview {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--gray-50);
      color: var(--text-secondary);
      font-size: 14px;
      line-height: 1.65;
      overflow-wrap: anywhere;
    }
    .source-preview strong { color: var(--text-primary); white-space: nowrap; }
    .embed-warning {
      margin: 0;
      color: var(--text-placeholder);
      font-size: 13px;
      line-height: 1.65;
    }

    #toast-container { position: fixed; left: 50%; bottom: max(var(--space-xl), env(safe-area-inset-bottom)); z-index: 200; transform: translateX(-50%); pointer-events: none; }
    .toast { padding: var(--space-sm) var(--space-lg); border: 1px solid var(--gray-700); border-radius: var(--radius); background: var(--gray-900); color: var(--gray-50); font-weight: 600; animation: toast-in .2s ease both; }
    @keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

    @media (max-width: 900px) {
      .cm-to-feet-inches-tool { scroll-padding-top: 70px; }
      .app-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "toc" "main"; padding: 0 var(--space-sm); }
      .toc-panel, .toc-panel.collapsed { position: sticky; top: calc(var(--shell-sticky-offset) + env(safe-area-inset-top, 0px) + var(--space-sm)); width: 100%; max-height: min(62vh, calc(100vh - var(--shell-sticky-offset) - 24px), 520px); margin-top: var(--space-sm); }
      .toc-panel.collapsed { max-height: 46px; }
      .page { padding-top: var(--space-lg); }
      .card-block, #converter { scroll-margin-top: 72px; }
    }
    @media (max-width: 700px) {
      .conversion-row { grid-template-columns: 1fr; align-items: start; }
      .normalization-preview { grid-column: 1; }
      .related-tools-grid, .embed-grid { grid-template-columns: 1fr; }
      .settings-row { grid-template-columns: 1fr; }
      .result-split { grid-template-columns: 1fr; }
      .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .actions .btn { width: 100%; }
      .converter-body, .panel-head, .card-block { padding-left: 14px; padding-right: 14px; }
    }
    @media (max-width: 430px) {
      .feet-inch-grid { grid-template-columns: 1fr; }
      .actions { grid-template-columns: 1fr; }
    }
    @media (prefers-reduced-motion: reduce) {
      .cm-to-feet-inches-tool, .cm-to-feet-inches-tool *, .cm-to-feet-inches-tool *::before, .cm-to-feet-inches-tool *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
      }
    }
