:root {
    color-scheme: light;
    --kunchi-paper: #f7f8f5;
    --kunchi-surface: #ffffff;
    --kunchi-ink: #202823;
    --kunchi-muted: #536057;
    --kunchi-red: #ab3028;
    --kunchi-red-hover: #8d261f;
    --kunchi-green: #244c3c;
    --kunchi-gold: #b38b43;
    --kunchi-border: #d9dfd8;
    --kunchi-error: #7e261f;
    --kunchi-error-surface: #fff2ef;
    --kunchi-success-surface: #eef5ef;
    --kunchi-radius: 10px;
    --kunchi-font: system-ui, -apple-system, BlinkMacSystemFont,
        "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--kunchi-paper);
    color: var(--kunchi-ink);
    font-family: var(--kunchi-font);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 24px;
}

body {
    min-width: 0;
    margin: 0;
    background: var(--kunchi-paper);
    color: var(--kunchi-ink);
    font-family: var(--kunchi-font);
    line-height: 1.8;
}

main,
section,
article,
nav,
form,
fieldset {
    min-width: 0;
}

img,
svg,
video {
    max-width: 100%;
}

img {
    vertical-align: middle;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
input,
textarea,
select,
a {
    -webkit-tap-highlight-color: transparent;
}

button,
input[type="submit"],
input[type="button"] {
    touch-action: manipulation;
}

button {
    color: inherit;
}

textarea {
    resize: vertical;
}

input,
textarea,
select {
    accent-color: var(--kunchi-green);
}

input::placeholder,
textarea::placeholder {
    color: #647167;
    opacity: 1;
}

input:disabled,
textarea:disabled,
select:disabled {
    background: #edf0eb;
    color: var(--kunchi-muted);
    cursor: not-allowed;
    -webkit-text-fill-color: var(--kunchi-muted);
}

a {
    color: var(--kunchi-green);
    text-underline-offset: 0.25em;
    text-decoration-thickness: 1px;
}

a,
p,
li,
dd,
h1,
h2,
h3,
h4 {
    overflow-wrap: anywhere;
}

:focus-visible {
    outline: 3px solid var(--kunchi-green);
    outline-offset: 4px;
}

[hidden] {
    display: none !important;
}

.kc-visually-hidden,
.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.kc-header,
.ku-header,
.ka-header,
.kunchi-header {
    position: relative;
    isolation: isolate;
}

.kc-brand,
.ku-brand,
.kunchi-header__brand {
    min-width: 0;
}

.kc-brand > span:last-child,
.ku-brand > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.kc-nav a,
.ku-nav a,
.ka-nav a,
.kc-footer nav a,
.ku-footer nav a,
.kunchi-footer__nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.kc-nav a[aria-current="page"],
.ku-nav a[aria-current="page"],
.ka-nav a[aria-current="page"] {
    font-weight: 750;
    text-decoration: underline;
    text-decoration-color: var(--kunchi-red);
    text-decoration-thickness: 2px;
    text-underline-offset: 7px;
}

.kc-mark,
.ku-mark,
.kunchi-header__mark {
    box-shadow: inset 0 0 0 4px var(--kunchi-surface);
}

.kc-main,
.ku-main,
.ka-main {
    width: 100%;
}

.kc-layout > *,
.ku-layout > *,
.ka-grid > *,
.kc-topic-grid > * {
    min-width: 0;
}

.kc-intro h1,
.ku-heading h1 {
    font-feature-settings: "palt";
    line-break: strict;
}

.kc-chat {
    position: relative;
    border-top: 3px solid var(--kunchi-red);
}

.kc-chat-head {
    background: var(--kunchi-surface);
    color: var(--kunchi-ink);
}

.kc-badge::before {
    content: "";
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--kunchi-green);
}

.kc-chat[data-enabled="false"] .kc-badge::before {
    background: var(--kunchi-muted);
}

.kc-chat-body,
.kc-messages {
    min-width: 0;
}

.kc-messages {
    scrollbar-width: thin;
    scrollbar-color: #98a79b #f1f4ee;
}

.kc-messages::-webkit-scrollbar {
    width: 7px;
}

.kc-messages::-webkit-scrollbar-track {
    background: #f1f4ee;
}

.kc-messages::-webkit-scrollbar-thumb {
    background: #98a79b;
    border: 2px solid #f1f4ee;
    border-radius: 8px;
}

.kc-messages:focus-visible {
    outline-offset: -3px;
    border-radius: 5px;
}

.kc-message {
    contain: style;
}

.kc-message-content {
    color: var(--kunchi-ink);
    word-break: normal;
    overflow-wrap: anywhere;
    tab-size: 4;
}

.kc-message--assistant .kc-message-label {
    color: var(--kunchi-green);
}

.kc-message--user .kc-message-label {
    color: var(--kunchi-red-hover);
}

.kc-message-content a {
    overflow-wrap: anywhere;
}

.kc-references {
    color: var(--kunchi-ink);
}

.kc-reference strong {
    display: block;
    color: var(--kunchi-green);
}

.kc-reference p {
    color: var(--kunchi-muted);
}

.kc-reference-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.kc-question,
.suggested-question {
    min-height: 44px;
    max-width: 100%;
    overflow-wrap: anywhere;
    touch-action: manipulation;
}

.kc-topic button {
    min-height: 44px;
}

.kc-question:active:not(:disabled),
.kc-topic button:active:not(:disabled) {
    color: var(--kunchi-red-hover);
}

.kc-input {
    scroll-margin-bottom: 100px;
    caret-color: var(--kunchi-red);
}

.kc-input:focus {
    border-color: var(--kunchi-green);
    box-shadow: 0 0 0 1px var(--kunchi-green);
}

.kc-input[aria-invalid="true"],
.ka-field input[aria-invalid="true"],
.ka-field textarea[aria-invalid="true"],
.ka-field select[aria-invalid="true"] {
    border-color: var(--kunchi-error);
    background: #fffaf8;
}

.kc-input[aria-invalid="true"]:focus-visible {
    outline-color: var(--kunchi-error);
}

.kc-submit {
    flex-shrink: 0;
    transition: background-color 140ms ease, box-shadow 140ms ease;
}

.kc-submit:focus-visible,
.ka-button:focus-visible,
.ku-button:focus-visible {
    outline: 3px solid var(--kunchi-green);
    outline-offset: 4px;
    box-shadow: 0 0 0 2px var(--kunchi-surface);
}

.kc-submit:active:not(:disabled) {
    background: #74211b;
}

.kc-form[aria-busy="true"] .kc-submit,
.kc-chat[aria-busy="true"] .kc-submit,
.kc-submit[aria-busy="true"],
.ka-page form[aria-busy="true"] button[type="submit"] {
    cursor: progress;
}

.kc-form[aria-busy="true"] .kc-submit,
.kc-submit[aria-busy="true"] {
    background: var(--kunchi-red-hover);
}

.kc-status {
    min-width: 0;
}

.kc-status[data-state="error"],
.kc-status.is-error,
#chat-error:not([hidden]) {
    padding: 10px 12px;
    border: 1px solid #c68b84;
    border-radius: 6px;
    background: var(--kunchi-error-surface);
    color: var(--kunchi-error);
}

.kc-status[data-state="success"],
.kc-status.is-success {
    padding: 10px 12px;
    border-left: 3px solid var(--kunchi-green);
    background: var(--kunchi-success-surface);
    color: var(--kunchi-green);
}

.kc-status[data-state="loading"],
.kc-status.is-loading {
    color: var(--kunchi-green);
    font-weight: 650;
}

.kc-caution {
    text-wrap: pretty;
}

.kc-section-heading h2,
.ku-contents h2 {
    position: relative;
    padding-left: 15px;
}

.kc-section-heading h2::before,
.ku-contents h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 7px;
    height: 7px;
    border: 1px solid var(--kunchi-gold);
    border-radius: 50%;
}

.kc-topic {
    transition: border-color 140ms ease;
}

.kc-topic:focus-within {
    border-color: var(--kunchi-green);
}

.kc-topic img,
.kc-hero img {
    background: #eee9df;
    color: var(--kunchi-ink);
}

.kc-information > div {
    min-width: 0;
}

.kc-floating-chat {
    max-width: calc(100% - 40px);
    transition: background-color 140ms ease, box-shadow 140ms ease;
}

.kc-floating-chat:hover {
    background: #183b2c;
    box-shadow: 0 6px 20px #20282330;
}

.kc-footer,
.ku-footer,
.ka-footer,
.kunchi-footer {
    overflow-wrap: anywhere;
}

.ku-section,
.ka-section {
    min-width: 0;
}

.ku-facts dd,
.ku-facts dt {
    min-width: 0;
}

.ku-note,
.ka-cost {
    overflow-wrap: anywhere;
}

.ka-table-wrap {
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: #98a79b #f1f4ee;
}

.ka-table-wrap:focus-visible {
    outline-offset: 3px;
}

.ka-table caption {
    padding: 12px;
    text-align: left;
    font-weight: 700;
    background: var(--kunchi-surface);
    color: var(--kunchi-green);
}

.ka-table tbody tr:focus-within {
    background: #f4f7f1;
}

.ka-table summary {
    min-height: 44px;
    padding: 8px 0;
}

.ka-table details[open] {
    padding-bottom: 8px;
}

.ka-field input:focus,
.ka-field textarea:focus,
.ka-field select:focus {
    border-color: var(--kunchi-green);
}

.ka-field input[type="checkbox"] {
    min-width: 19px;
}

.ka-check {
    min-height: 44px;
}

.ka-alert,
.kc-error,
.ku-alert {
    scroll-margin-top: 20px;
}

.ka-metrics dd {
    font-variant-numeric: tabular-nums;
}

.ka-pagination a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

[data-aib-image-surface] {
    position: relative;
    isolation: isolate;
    background: var(--kunchi-green);
    color: var(--kunchi-surface);
}

[data-aib-image-surface]::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: rgb(12 28 20 / 78%);
}

[data-aib-image-surface] > img {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

[data-aib-image-surface] > :not(img) {
    position: relative;
    z-index: 1;
}

[data-aib-image-surface] a {
    color: #ffffff;
}

[data-aib-image-surface] :focus-visible {
    outline-color: #ffffff;
}

@media (hover: hover) {
    .ka-table tbody tr:hover {
        background: #f8faf6;
    }

    .kc-topic:hover {
        border-color: #a6b5a8;
    }
}

@media (min-width: 1100px) {
    .ku-contents {
        position: sticky;
        top: 24px;
    }
}

@media (max-width: 760px) {
    html {
        scroll-padding-top: 16px;
    }

    .kc-chat-head {
        flex-wrap: wrap;
        gap: 10px;
    }

    .kc-chat-head > div {
        flex: 1 1 180px;
        min-width: 0;
    }

    .kc-badge {
        max-width: 100%;
    }

    .kc-message {
        max-width: 98%;
    }

    .kc-reference-links {
        gap: 4px 14px;
    }

    .kc-form-bottom {
        align-items: flex-end;
    }

    .kc-input-note {
        min-width: 0;
    }

    .kc-intro {
        overflow-wrap: anywhere;
    }

    .kc-section-heading,
    .kc-information,
    .kc-footer-inner,
    .ku-footer-inner,
    .ka-footer-inner {
        min-width: 0;
    }

    .ka-field input:not([type="checkbox"]),
    .ka-field textarea,
    .ka-field select {
        font-size: 16px;
    }

    .ka-filter .ka-button {
        width: 100%;
    }

    .ka-actions .ka-button {
        min-height: 48px;
    }

    .kc-footer {
        padding-bottom: calc(90px + env(safe-area-inset-bottom));
    }

    .ku-footer,
    .ka-footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 420px) {
    .kc-intro h1 {
        font-size: 27px;
        letter-spacing: 0;
    }

    .kc-form-bottom {
        flex-wrap: wrap;
    }

    .kc-submit {
        margin-left: auto;
    }

    .kc-badge {
        white-space: normal;
    }

    .kc-topic h3 {
        line-height: 1.6;
    }

    .ka-filter {
        grid-template-columns: minmax(0, 1fr);
    }

    .ka-filter .ka-field:first-child {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    html,
    html:focus-within {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

html[data-motion="paused"] *,
html[data-motion="paused"] *::before,
html[data-motion="paused"] *::after,
body[data-motion="paused"] *,
body[data-motion="paused"] *::before,
body[data-motion="paused"] *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

@media (forced-colors: active) {
    .kc-chat,
    .kc-message-content,
    .kc-references,
    .kc-question,
    .kc-submit,
    .kc-topic,
    .ku-section,
    .ka-section,
    .ka-button,
    .kc-floating-chat {
        border: 1px solid ButtonText;
    }

    .kc-badge::before,
    .kc-eyebrow::before {
        background: CanvasText;
    }

    :focus-visible {
        outline-color: Highlight;
    }
}

@media print {
    html,
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .kc-header,
    .ku-header,
    .ka-header,
    .kunchi-header,
    .kc-footer,
    .ku-footer,
    .ka-footer,
    .kunchi-footer,
    .kc-floating-chat,
    .kc-skip,
    .ku-skip,
    .ka-skip,
    .kc-form,
    .kc-questions,
    .kc-topic button,
    .ku-contents,
    .ka-tools,
    .ka-filter,
    .ka-pagination {
        display: none !important;
    }

    .kc-main,
    .ku-main,
    .ka-main {
        max-width: none;
        padding: 0 !important;
    }

    .kc-layout,
    .ku-layout,
    .kc-information {
        display: block !important;
    }

    .kc-intro {
        padding-right: 0 !important;
        min-height: 0 !important;
    }

    .kc-hero,
    .kc-caption,
    .kc-intro-links {
        display: none !important;
    }

    .kc-chat,
    .ku-section,
    .ka-section {
        box-shadow: none !important;
        border-color: #888888 !important;
        margin: 16px 0;
    }

    .kc-messages {
        max-height: none !important;
        overflow: visible !important;
    }

    .kc-message,
    .kc-reference,
    .ku-facts div {
        break-inside: avoid;
    }

    .kc-message-content {
        background: #ffffff !important;
        border-color: #888888 !important;
    }

    .kc-topic-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .ka-table-wrap {
        overflow: visible !important;
    }

    .ka-table {
        min-width: 0 !important;
    }

    a {
        color: #000000 !important;
        text-decoration: underline !important;
    }

    .kc-reference-links a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 10px;
        overflow-wrap: anywhere;
    }
}