:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-subtle: #f9fafb;
    --text: #17212b;
    --muted: #667085;
    --line: #d7dde5;
    --line-strong: #c7d0dc;
    --brand: #145f57;
    --brand-dark: #0f4741;
    --accent: #7a4a12;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 12px 0;
}

.site-header {
    min-height: 58px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 7px;
}

.brand span {
    letter-spacing: 0;
}

.nav,
.site-footer nav,
.actions,
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.nav a,
.site-footer a,
.chips a {
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
}

.nav a[aria-current="page"] {
    background: #e8f2f1;
    color: var(--brand-dark);
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero,
.workspace-header,
.workspace-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
    gap: 24px;
    align-items: center;
    padding: 54px 0 36px;
}

.hero h1,
.workspace-header h1,
.workspace-panel h1,
.page-title h1 {
    margin: 0;
    max-width: 850px;
    font-size: clamp(34px, 6vw, 62px);
    line-height: 1.05;
}

.workspace-header {
    align-items: end;
    padding: 30px 0 18px;
}

.workspace-panel {
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    margin: 18px 0 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.workspace-header h1,
.workspace-panel h1 {
    font-size: 28px;
    line-height: 1.2;
}

.workspace-title span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.tool-search {
    display: grid;
    gap: 8px;
}

.tool-search label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.tool-search div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.tool-search input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 11px;
    font: inherit;
    background: #fff;
    color: var(--text);
}

.lead {
    max-width: 760px;
    color: var(--muted);
    font-size: 18px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    font-weight: 700;
}

.button.primary {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.button.secondary {
    color: var(--brand-dark);
    background: #fff;
}

.file-upload-button {
    cursor: pointer;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    padding: 0;
}

.file-limit-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    position: relative;
}

.file-limit-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: #fff;
    color: var(--brand-dark);
    cursor: help;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    padding: 0;
}

.file-limit-info:focus {
    outline: 2px solid rgba(20, 95, 87, 0.25);
    outline-offset: 2px;
}

.file-limit-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 5;
    display: none;
    width: min(320px, calc(100vw - 48px));
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    padding: 8px 10px;
}

.file-limit-note:hover .file-limit-tooltip,
.file-limit-info:focus + .file-limit-tooltip {
    display: block;
}

.button.compact {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

.hero-panel,
.card,
.tool-row,
.empty-state,
.content-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.summary-strip div {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px 16px;
}

.summary-strip span {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
}

.summary-strip p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.hero-panel {
    padding: 22px;
}

.section,
.page-title {
    padding: 34px 0 18px;
}

.content-section {
    padding-bottom: 36px;
}

.content-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}

.content-heading h2 {
    margin: 0;
    font-size: 18px;
}

.content-heading a {
    font-size: 14px;
    font-weight: 700;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
}

.section-heading h2,
.card h2,
.card h3,
.tool-row h2 {
    margin: 0 0 8px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 12px 0 36px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 0;
}

.card {
    padding: 20px;
}

.dashboard-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px;
    box-shadow: var(--shadow);
}

.card-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.card-topline h3 {
    margin: 4px 0 0;
    font-size: 16px;
    line-height: 1.25;
}

.category-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 22px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.count-badge {
    min-width: 28px;
    border-radius: 5px;
    background: #edf4f3;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 700;
    line-height: 28px;
    text-align: center;
}

.tool-links {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.tool-links a {
    display: block;
    color: var(--text);
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid #edf0f3;
}

.tool-links li:last-child a {
    border-bottom: 0;
}

.card p,
.tool-row p,
.empty-state p,
.content-panel p {
    color: var(--muted);
}

.inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.inline-list li,
.badge {
    border-radius: 999px;
    background: #f0f3f7;
    padding: 5px 9px;
    color: var(--muted);
    font-size: 13px;
}

.tool-list {
    display: grid;
    gap: 12px;
    padding: 12px 0 36px;
}

.tool-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px;
}

.empty-state,
.content-panel,
.error-page {
    padding: 24px;
    margin: 18px 0 40px;
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    margin-top: 20px;
}

.tool-shell {
    padding: 18px 0 8px;
}

.tool-header,
.tool-workspace {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 18px;
    margin-bottom: 12px;
}

.tool-header h1 {
    margin: 4px 0 6px;
    font-size: 28px;
    line-height: 1.2;
}

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

.back-link {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.tool-workspace {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.tool-workspace label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.tool-textarea,
.form-grid input,
.form-grid select,
.prepayment-row input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 11px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

.tool-textarea::placeholder,
.form-grid input::placeholder,
.prepayment-row input::placeholder,
.tool-search input::placeholder {
    color: #9aa4b2;
    opacity: 0.55;
}

.tool-textarea {
    resize: vertical;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.5;
}

.code-editor {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.code-editor.json-editor-ready {
    display: block;
}

.code-editor:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(20, 95, 87, 0.12);
}

.code-editor.has-error {
    border-color: #d92d20;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.line-numbers {
    height: 100%;
    max-height: 420px;
    padding: 10px 8px;
    border-right: 1px solid var(--line);
    background: var(--surface-subtle);
    color: var(--muted);
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow: hidden;
    text-align: right;
    user-select: none;
}

.line-numbers span {
    display: block;
    min-height: 21px;
}

.line-numbers .line-error {
    color: #b42318;
    font-weight: 700;
}

.line-numbers .line-brace-start,
.fold-line-number.line-brace-start {
    background: #fff4cc;
    color: #7a4a12;
    font-weight: 700;
}

.line-numbers .line-brace-end,
.fold-line-number.line-brace-end {
    background: #dff7ea;
    color: #087443;
    font-weight: 700;
}

.code-textarea {
    min-height: 294px;
    border: 0;
    border-radius: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-textarea:focus {
    outline: 0;
}

.json-synced-textarea {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.brace-hint {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    background: #fbfcfd;
    color: var(--muted);
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    padding: 6px 10px;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tool-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
}

.tool-output-header label {
    margin: 0;
}

.tool-output-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 190px;
}

.copy-status {
    display: inline-flex;
    align-items: center;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    min-width: 56px;
    white-space: nowrap;
}

.copy-status.error {
    color: #b42318;
}

.tool-message {
    min-height: 22px;
    margin: 0;
    color: var(--muted);
}

.tool-message.inline {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding-left: 4px;
}

.tool-message.success {
    color: var(--brand-dark);
}

.tool-message.error {
    color: #b42318;
}

.privacy-note {
    border: 1px solid #b7e4cf;
    border-radius: 8px;
    background: #effaf4;
    color: #075e3a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
    padding: 10px 12px;
}

.text-transform-workspace {
    gap: 14px;
}

.text-transform-input,
.text-transform-output {
    min-height: 260px;
}

.converter-workspace,
.keyword-density-workspace {
    gap: 14px;
}

.converter-textarea,
.keyword-density-input {
    min-height: 300px;
}

.keyword-density-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.keyword-density-summary {
    margin-top: 2px;
}

.keyword-density-table {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}

.keyword-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px 86px;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #edf0f3;
    font-size: 13px;
}

.keyword-row span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.keyword-heading {
    color: var(--muted);
    font-weight: 700;
}

.loan-workspace {
    gap: 14px;
}

.loan-prepayment-panel,
.loan-table-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-subtle);
    padding: 12px;
}

.prepayment-list {
    display: grid;
    gap: 8px;
}

.prepayment-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.9fr) minmax(150px, 0.9fr) minmax(180px, 1.2fr) auto;
    gap: 8px;
    align-items: end;
}

.loan-summary-grid .result-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.finance-workspace {
    gap: 14px;
}

.finance-summary-grid .result-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.loan-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.loan-chart-card {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.finance-chart-card {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.loan-chart-wide {
    grid-column: 1 / -1;
}

.loan-donut {
    display: grid;
    place-items: center;
    width: min(220px, 70vw);
    aspect-ratio: 1;
    margin: 4px auto;
    border-radius: 50%;
    background: conic-gradient(var(--line) 0 100%);
    position: relative;
}

.loan-donut::after {
    content: "";
    position: absolute;
    width: 58%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--surface);
}

.loan-donut span {
    position: relative;
    z-index: 1;
    display: grid;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
}

.loan-donut small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.loan-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
}

.loan-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.loan-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-principal {
    background: var(--brand);
}

.legend-interest {
    background: #b42318;
}

.loan-bars {
    display: grid;
    gap: 12px;
}

.loan-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
}

.loan-bar-row strong {
    color: var(--text);
}

.loan-bar-row div {
    grid-column: 1 / -1;
    height: 12px;
    border-radius: 999px;
    background: #eef2f6;
    overflow: hidden;
}

.loan-bar-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.bar-original {
    background: #b42318;
}

.bar-prepaid {
    background: #175cd3;
}

.bar-saved {
    background: var(--brand);
}

.loan-line-chart {
    width: 100%;
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.loan-axis {
    stroke: var(--line-strong);
    stroke-width: 1;
}

.loan-line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.loan-line.original {
    stroke: #b42318;
}

.loan-line.prepaid {
    stroke: var(--brand);
}

.loan-chart-label {
    fill: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.prepaid-label {
    fill: var(--brand-dark);
}

.loan-table {
    display: grid;
    max-height: 520px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.loan-table-row {
    display: grid;
    grid-template-columns: 64px 104px repeat(5, minmax(120px, 1fr));
    gap: 0;
    min-width: 920px;
    border-bottom: 1px solid #edf0f3;
    font-size: 13px;
}

.loan-table-row span {
    padding: 8px 10px;
    border-right: 1px solid #edf0f3;
    white-space: nowrap;
}

.loan-table-row span:last-child {
    border-right: 0;
}

.loan-table-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-subtle);
    color: var(--muted);
    font-weight: 700;
}

.flat-table-row,
.flat-table-heading {
    grid-template-columns: 64px repeat(5, minmax(130px, 1fr));
    min-width: 780px;
}

.deposit-table-row,
.deposit-table-heading {
    grid-template-columns: 64px 104px repeat(5, minmax(120px, 1fr));
    min-width: 900px;
}

.investment-table-row,
.investment-table-heading {
    grid-template-columns: 78px repeat(6, minmax(120px, 1fr));
    min-width: 880px;
}

.tax-table-row,
.tax-table-heading {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr);
    min-width: 520px;
}

.flat-table-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-subtle);
    color: var(--muted);
    font-weight: 700;
}

.deposit-table-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-subtle);
    color: var(--muted);
    font-weight: 700;
}

.investment-table-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-subtle);
    color: var(--muted);
    font-weight: 700;
}

.tax-table-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-subtle);
    color: var(--muted);
    font-weight: 700;
}

.finance-meter {
    display: grid;
    gap: 10px;
    align-content: center;
    min-height: 130px;
    color: var(--muted);
    font-size: 13px;
}

.finance-meter strong {
    color: var(--text);
    font-size: 20px;
}

.finance-meter-track {
    height: 14px;
    border-radius: 999px;
    background: #eef2f6;
    overflow: hidden;
}

.finance-meter-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
}

.qr-preview-panel {
    align-content: start;
}

.qr-code-preview {
    display: grid;
    place-items: center;
    min-height: 280px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    padding: 16px;
}

.qr-code-preview img,
.qr-code-preview canvas {
    width: min(260px, 75vw);
    height: auto;
    image-rendering: pixelated;
}

.time-display-panel {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.time-display-panel strong {
    font-size: clamp(32px, 7vw, 58px);
    line-height: 1;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.time-display-panel span {
    color: var(--muted);
    font-weight: 700;
}

.segmented-control {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.segmented-control .active-option {
    border-color: var(--brand);
    background: #e8f2f1;
    color: var(--brand-dark);
}

.diff-workspace {
    gap: 14px;
}

.diff-input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.diff-input-panel {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.diff-textarea {
    min-height: 300px;
}

.diff-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.diff-summary span {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-subtle);
    color: var(--muted);
    padding: 7px 10px;
    font-size: 13px;
}

.diff-summary strong {
    color: var(--text);
}

.diff-output {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    min-height: 180px;
    max-height: 560px;
    overflow: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.5;
}

.diff-line {
    display: grid;
    grid-template-columns: 54px 54px 28px minmax(0, 1fr);
    min-height: 22px;
    border-bottom: 1px solid #edf0f3;
}

.diff-line-no,
.diff-symbol {
    background: var(--surface-subtle);
    border-right: 1px solid var(--line);
    color: var(--muted);
    padding: 2px 8px;
    text-align: right;
    user-select: none;
}

.diff-symbol {
    text-align: center;
    font-weight: 700;
}

.diff-line code {
    display: block;
    min-width: 0;
    padding: 2px 10px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    word-break: break-word;
}

.diff-added {
    background: #effaf4;
}

.diff-added .diff-symbol {
    color: #087443;
}

.diff-removed {
    background: #fff1f0;
}

.diff-removed .diff-symbol {
    color: #b42318;
}

.text-counter-workspace {
    gap: 14px;
}

.text-counter-input {
    min-height: 320px;
}

.text-counter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.keyword-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
}

.keyword-list span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-subtle);
    color: var(--muted);
    padding: 6px 10px;
    font-size: 13px;
}

.keyword-list strong {
    color: var(--brand-dark);
}

.empty-inline {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.seo-content {
    display: grid;
    gap: 12px;
}

.seo-content p {
    max-width: 860px;
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.feature-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
    color: var(--text);
}

.faq-list {
    display: grid;
    gap: 8px;
}

.faq-list details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 700;
}

.faq-list p {
    margin-top: 8px;
}

.json-tree-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.json-tree-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
    padding: 10px 12px;
}

.json-tree-toolbar strong {
    font-size: 14px;
}

.json-tree-toolbar div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.json-tree {
    max-height: 460px;
    overflow: auto;
    padding: 12px;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.5;
}

.json-tree details {
    margin: 2px 0;
}

.json-tree summary {
    cursor: pointer;
    overflow-wrap: anywhere;
}

.json-children {
    margin-left: 18px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}

.json-leaf {
    overflow-wrap: anywhere;
}

.json-key {
    color: #7a4a12;
    font-weight: 700;
}

.json-type {
    color: var(--brand-dark);
    font-weight: 700;
}

.json-value-string {
    color: #175cd3;
}

.json-value-number,
.json-value-boolean {
    color: #6941c6;
}

.json-value-null {
    color: var(--muted);
}

.json-code-surface {
    background: #fff;
}

.fold-code {
    max-height: 460px;
    min-height: 294px;
    overflow: auto;
    background: #fff;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.5;
    user-select: text;
}

.fold-line {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 22px;
}

.fold-line[hidden] {
    display: none;
}

.fold-line:hover {
    background: #fbfcfd;
}

.fold-gutter {
    display: inline-flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 6px;
    border-right: 1px solid var(--line);
    background: var(--surface-subtle);
    color: var(--muted);
    padding: 2px 8px;
    user-select: none;
}

.fold-line-number {
    min-width: 28px;
    text-align: right;
}

.fold-line-number.line-error {
    color: #b42318;
    font-weight: 700;
}

.fold-toggle,
.fold-spacer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.fold-toggle {
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: #fff;
    color: var(--brand-dark);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    line-height: 1;
}

.fold-toggle:hover {
    background: #e8f2f1;
}

.fold-code-line {
    display: block;
    min-width: 0;
    min-height: 22px;
    padding: 2px 10px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: text;
}

.fold-code-line:focus {
    outline: 0;
    background: #f8fbfb;
}

.fold-code-line[contenteditable="false"] {
    color: var(--text);
}

.json-brace {
    border-radius: 3px;
    cursor: pointer;
    user-select: text;
}

.brace-match-char {
    background: #ffdf8a;
    color: #7a4a12;
    font-weight: 700;
    outline: 1px solid #e5a000;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

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

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.result-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-subtle);
    padding: 14px;
}

.result-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.result-card strong {
    font-size: 18px;
}

.catalog-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    gap: 24px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    margin: 18px 0 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.catalog-header span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.catalog-header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.catalog-summary {
    margin-bottom: 14px;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.catalog-sidebar {
    position: sticky;
    top: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px;
    box-shadow: var(--shadow);
}

.catalog-sidebar h2 {
    margin: 0 0 10px;
    font-size: 15px;
}

.catalog-sidebar nav {
    display: grid;
    gap: 4px;
}

.catalog-sidebar a,
.catalog-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.catalog-sidebar a {
    border-radius: 6px;
    padding: 9px 10px;
    color: var(--text);
    font-size: 14px;
}

.catalog-sidebar a:hover {
    background: var(--surface-subtle);
    text-decoration: none;
}

.catalog-sidebar a[aria-current] {
    background: #e8f2f1;
    color: var(--brand-dark);
}

.catalog-sidebar strong {
    color: var(--muted);
    font-size: 13px;
}

.catalog-main {
    display: grid;
    gap: 14px;
    padding-bottom: 36px;
}

.catalog-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
    scroll-margin-top: 16px;
}

.catalog-section-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
}

.catalog-section-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.catalog-section-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.catalog-section-header > span {
    min-width: 34px;
    border-radius: 6px;
    background: #e8f2f1;
    color: var(--brand-dark);
    font-size: 14px;
    font-weight: 700;
    line-height: 32px;
    text-align: center;
}

.catalog-table {
    display: grid;
}

.catalog-row {
    min-height: 42px;
    padding: 10px 16px;
    border-bottom: 1px solid #edf0f3;
    color: var(--text);
    font-size: 14px;
}

.catalog-row:last-child {
    border-bottom: 0;
}

.catalog-row:hover {
    background: #fbfcfd;
    text-decoration: none;
}

.catalog-row strong {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
}

.status-active {
    background: #e8f2f1;
    color: var(--brand-dark);
}

.status-planned {
    background: #f0f3f7;
    color: var(--muted);
}

@media (max-width: 820px) {
    .site-header,
    .site-footer,
    .section-heading,
    .tool-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero,
    .workspace-header,
    .workspace-panel,
    .grid,
    .dashboard-grid,
    .summary-strip {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 30px;
    }

    .hero h1,
    .workspace-header h1,
    .workspace-panel h1,
    .page-title h1 {
        font-size: 28px;
    }

    .tool-search div {
        grid-template-columns: 1fr;
    }

    .tool-header {
        flex-direction: column;
    }

    .json-tree-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .tool-output-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .tool-output-actions {
        justify-content: flex-start;
        min-width: 0;
        width: 100%;
    }

    .fold-integrated-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid,
    .form-grid.three,
    .result-grid,
    .text-counter-grid,
    .keyword-density-layout,
    .loan-chart-grid,
    .catalog-header,
    .catalog-layout,
    .diff-input-grid {
        grid-template-columns: 1fr;
    }

    .prepayment-row {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        position: static;
    }

    .catalog-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}
