/* 自動車鍵検索 — iOS-style screens. Everything is scoped under .kc so the shared style.css and
   customer-styles.css (loaded on every public page) cannot reach in, and nothing here leaks out. */

.kc {
    --kc-bg: #f2f2f7;
    --kc-card: #fff;
    --kc-label: #1c1c1e;
    --kc-secondary: rgba(60, 60, 67, .62);
    --kc-tertiary: rgba(60, 60, 67, .36);
    --kc-sep: rgba(60, 60, 67, .18);
    --kc-fill: rgba(118, 118, 128, .12);
    --kc-tint: #f57c00;          /* the site's orange, darkened enough for text on white */
    --kc-tint-bg: #fff3e6;
    --kc-green: #248a3d;
    --kc-green-bg: #e3f6e8;
    --kc-red: #d70015;
    --kc-red-bg: #ffe5e7;
    --kc-amber: #b25000;
    --kc-amber-bg: #fff1d6;
    --kc-radius: 12px;
    --kc-nav-top: 0px;

    background: var(--kc-bg);
    color: var(--kc-label);
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
    font-size: 17px;
    line-height: 1.45;
    padding-bottom: 48px;
    min-height: 60vh;
}

/* The site's body is #f8f9fa; match the page grey so short screens do not show a band above the footer */
body:has(> main .kc) { background: #f2f2f7; }

.kc *, .kc *::before, .kc *::after { box-sizing: border-box; }
.kc button { font: inherit; color: inherit; }
.kc [hidden] { display: none !important; }
html.kc-locked, html.kc-locked body { overflow: hidden; }

/* ---------- nav bar ---------- */

.kc-nav {
    position: sticky;
    top: var(--kc-nav-top);
    z-index: 900;
    background: rgba(249, 249, 249, .86);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: .5px solid var(--kc-sep);
}

.kc-nav.is-root { display: none; }     /* the first screen has its own large title */

.kc-nav-bar {
    position: relative;
    max-width: 1040px;
    margin: 0 auto;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}

.kc-nav-title {
    font-size: 17px;
    font-weight: 600;
    max-width: calc(100% - 210px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kc-nav-back {
    position: absolute;
    left: 8px;
    top: 0;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 100px;
    padding: 0 8px;
    border: 0;
    background: none;
    color: var(--kc-tint) !important;
    font-size: 17px;
    cursor: pointer;
}
.kc-nav-back svg { width: 12px; height: 20px; flex: none; }
.kc-nav-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-nav-back:active { opacity: .45; }

.kc-trail {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px 8px;
    list-style: none;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: 13px;
    color: var(--kc-secondary);
    white-space: nowrap;
}
.kc-trail::-webkit-scrollbar { display: none; }
.kc-trail li { display: flex; align-items: center; }
.kc-trail li + li::before { content: "›"; margin: 0 6px; color: var(--kc-tertiary); }
.kc-trail button {
    border: 0;
    background: none;
    padding: 2px 0;
    color: var(--kc-tint) !important;
    cursor: pointer;
}
.kc-trail [aria-current] { color: var(--kc-label); font-weight: 600; }

/* ---------- screens ---------- */

.kc-views {
    max-width: 1040px;
    margin: 0 auto;
    padding: 8px 16px 0;
}

.kc-view { animation: kc-in .22s ease-out; }
@keyframes kc-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kc-view { animation: none; } }

.kc-hero { padding: 16px 4px 12px; }
.kc-hero h1 {
    margin: 0 0 6px;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--kc-label);
}
.kc-hero p { margin: 0; color: var(--kc-secondary); font-size: 15px; }

/* ---------- search ---------- */

.kc-search { display: flex; gap: 8px; margin: 8px 0 6px; }
.kc-search-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 12px;
    background: var(--kc-card);
    border: 1px solid var(--kc-sep);
    border-radius: 10px;
    color: var(--kc-secondary);
}
.kc-search-field:focus-within { border-color: var(--kc-tint); box-shadow: 0 0 0 3px rgba(245, 124, 0, .18); }
.kc-search-field svg { width: 18px; height: 18px; flex: none; }
.kc-search-field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: none;
    font: inherit;
    font-size: 17px;          /* 16px+ keeps iOS Safari from zooming on focus */
    color: var(--kc-label);
}
.kc-search-hint { margin: 0 4px 20px; font-size: 13px; color: var(--kc-secondary); }

.kc-btn {
    height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    border: 0;
    background: var(--kc-fill);
    color: var(--kc-tint) !important;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.kc-btn-primary { background: var(--kc-tint); color: #fff !important; }
.kc-btn:active { opacity: .7; }

/* ---------- segmented control ---------- */

.kc-segment {
    display: flex;
    padding: 2px;
    margin: 0 0 12px;
    background: var(--kc-fill);
    border-radius: 9px;
}
.kc-segment button {
    flex: 1;
    min-height: 34px;
    border: 0;
    border-radius: 7px;
    background: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--kc-label);
    cursor: pointer;
}
.kc-segment button[aria-selected="true"] {
    background: var(--kc-card);
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 1px rgba(0, 0, 0, .1);
}

/* ---------- inset grouped list ---------- */

.kc-group { margin: 0 0 28px; }
.kc-group-head, .kc-section-title {
    margin: 0 0 8px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .02em;
    color: var(--kc-secondary);
}
.kc-group > .kc-segment { margin-left: 0; margin-right: 0; }
.kc-group-foot { margin: 8px 16px 0; font-size: 13px; color: var(--kc-secondary); }

.kc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--kc-card);
    border-radius: var(--kc-radius);
    overflow: hidden;
}
.kc-list li { position: relative; }
.kc-list li + li::before {          /* hairline inset from the left, like UITableView */
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    right: 0;
    border-top: .5px solid var(--kc-sep);
}

.kc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px 10px 16px;
    border: 0;
    background: none;
    text-align: left;
    text-decoration: none !important;
    color: var(--kc-label) !important;
    cursor: pointer;
}
.kc-row:hover { background: rgba(0, 0, 0, .025); }
.kc-row:active { background: rgba(0, 0, 0, .07); }
.kc-row:focus-visible { outline: 2px solid var(--kc-tint); outline-offset: -2px; }
.kc-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kc-row-title { font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.kc-row-sub { margin-top: 1px; font-size: 14px; color: var(--kc-secondary); overflow-wrap: anywhere; }
.kc-row-memo { display: block; margin-top: 2px; font-size: 13px; color: var(--kc-tertiary); }
.kc-row-meta { flex: none; font-size: 15px; color: var(--kc-secondary); }
.kc-chev { flex: none; width: 8px; height: 14px; color: rgba(60, 60, 67, .3); }

.kc-thumb {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #f7f7f9;
    border: .5px solid var(--kc-sep);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.kc-thumb img { width: 100%; height: 100%; object-fit: contain; }
.kc-thumb.is-missing::after, .kc-key-img.is-missing::after { content: "🔑"; font-size: 22px; opacity: .5; }

.kc-row-icon {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.kc-row-icon.is-orange { background: var(--kc-tint); }
.kc-row-icon.is-blue { background: #0a84ff; }

/* Category rows on the compatibility hub (index.php) */
.kc-cat { min-height: 72px; gap: 14px; }
/* White Material Symbols glyph on a solid tile, like iOS Settings */
.kc-cat-icon {
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;           /* if the icon font fails, the ligature word must not spill out */
    color: #fff;
    font-size: 28px;
}
.kc-cat-icon.is-orange { background: #ff9500; }
.kc-cat-icon.is-red { background: #ff3b30; }
.kc-cat-icon.is-green { background: #34c759; }
.kc-cat-icon.is-blue { background: #007aff; }
.kc-row.is-disabled { cursor: default; }
.kc-row.is-disabled:hover, .kc-row.is-disabled:active { background: none; }
.kc-row.is-disabled .kc-cat-icon { background: #c7c7cc; }
.kc-row.is-disabled .kc-row-title { color: var(--kc-secondary); }
.kc-row.is-disabled .kc-badge { flex: none; align-self: center; background: var(--kc-fill); color: var(--kc-secondary); }
.kc-row-icon svg { width: 18px; height: 18px; }
/* .kc prefix: Google's icon stylesheet loads later and sets font-size: 24px on the same class */
.kc .kc-row-icon.material-symbols-rounded { font-size: 20px; overflow: hidden; }
.kc .kc-cat-icon.material-symbols-rounded { font-size: 28px; display: flex; }
.kc .kc-row-icon.material-symbols-rounded { display: flex; }

/* Makers on wide screens: the list becomes a grid of rounded cells */
@media (min-width: 720px) {
    .kc-list-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        background: none;
        border-radius: 0;
        overflow: visible;
    }
    .kc-list-grid li { background: var(--kc-card); border-radius: 10px; overflow: hidden; }
    .kc-list-grid li + li::before { display: none; }
}

/* ---------- list filter ---------- */

.kc-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    margin: 0 0 14px;
    padding: 0 10px;
    border-radius: 10px;
    background: var(--kc-fill);
    color: var(--kc-secondary);
}
.kc-filter svg { width: 16px; height: 16px; flex: none; }
.kc-filter input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    font: inherit;
    font-size: 17px;
    color: var(--kc-label);
}
.kc-filter-none { margin: 0 16px 14px; font-size: 14px; color: var(--kc-secondary); }

/* ---------- states ---------- */

.kc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 0;
    color: var(--kc-secondary);
    font-size: 15px;
}
.kc-spinner {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2.5px solid var(--kc-sep);
    border-top-color: var(--kc-secondary);
    animation: kc-spin .8s linear infinite;
}
@keyframes kc-spin { to { transform: rotate(360deg); } }

.kc-empty {
    margin: 0 0 28px;
    padding: 24px 20px;
    background: var(--kc-card);
    border-radius: var(--kc-radius);
    text-align: center;
    color: var(--kc-label);
}
.kc-empty p { margin: 0 0 6px; }
.kc-empty .kc-btn { margin-top: 10px; }
.kc-empty-title { font-size: 17px; font-weight: 600; text-wrap: balance; }
.kc-muted { color: var(--kc-secondary); font-size: 14px; }
.kc-tips { display: inline-block; margin: 8px 0 0; padding-left: 1.2em; text-align: left; font-size: 14px; color: var(--kc-secondary); }
.kc-result-count { margin: 4px 16px 12px; font-size: 13px; color: var(--kc-secondary); }

/* ---------- subject header (vehicle) ---------- */

.kc-subject { padding: 12px 4px 18px; }
.kc-subject-kicker { font-size: 13px; font-weight: 600; color: var(--kc-tint); letter-spacing: .04em; }
.kc-subject h2 { margin: 2px 0 4px; font-size: 26px; line-height: 1.25; font-weight: 700; color: var(--kc-label); }
.kc-subject p { margin: 0; font-size: 15px; color: var(--kc-secondary); overflow-wrap: anywhere; }
.kc-section-title span { margin-left: 4px; }

/* ---------- key card ---------- */

.kc-keys {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    margin: 0 0 12px;
}
.kc-keys-single { grid-template-columns: minmax(0, 560px); }

.kc-key {
    background: var(--kc-card);
    border-radius: var(--kc-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.kc-key-head { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.kc-key-img {
    flex: none;
    width: 76px;
    height: 76px;
    padding: 0;
    border-radius: 12px;
    border: .5px solid var(--kc-sep);
    background: #f7f7f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}
.kc-key-img img { width: 100%; height: 100%; object-fit: contain; }
.kc-key-img.is-missing { cursor: default; }
.kc-key-id { min-width: 0; }
.kc-key-pn { font-size: 19px; font-weight: 700; letter-spacing: .01em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.kc-key-sub { margin-top: 3px; font-size: 14px; color: var(--kc-secondary); }

.kc-caps { list-style: none; margin: 0; padding: 0; border-top: .5px solid var(--kc-sep); }
.kc-caps li {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 6px 16px;
}
.kc-caps li + li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    right: 0;
    border-top: .5px solid var(--kc-sep);
}
.kc-cap-label { font-size: 15px; }

.kc-cap {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 4px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.kc-cap b {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
}
.kc-cap.is-yes { background: var(--kc-green-bg); color: var(--kc-green); }
.kc-cap.is-yes b { background: var(--kc-green); }
.kc-cap.is-no { background: var(--kc-red-bg); color: var(--kc-red); }
.kc-cap.is-no b { background: var(--kc-red); }
.kc-cap.is-ask { background: var(--kc-amber-bg); color: var(--kc-amber); }
.kc-cap.is-ask b { background: #e07800; }
.kc-cap.is-na { background: var(--kc-fill); color: var(--kc-secondary); font-weight: 500; }
.kc-cap.is-na b { background: rgba(60, 60, 67, .3); }

.kc-key-memo {
    margin-top: auto;
    padding: 10px 16px 14px;
    border-top: .5px solid var(--kc-sep);
    background: #fafafc;
    font-size: 14px;
}
.kc-key-memo span { display: block; font-size: 12px; font-weight: 600; color: var(--kc-secondary); }
.kc-key-memo p { margin: 2px 0 0; color: var(--kc-label); overflow-wrap: anywhere; }

/* ---------- legend ---------- */

.kc-legend {
    margin: 0 0 28px;
    background: var(--kc-card);
    border-radius: var(--kc-radius);
    font-size: 14px;
}
.kc-legend summary {
    padding: 12px 16px;
    color: var(--kc-tint);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.kc-legend summary::-webkit-details-marker { display: none; }
.kc-legend summary::after { content: "＋"; float: right; color: var(--kc-tertiary); }
.kc-legend[open] summary::after { content: "－"; }
.kc-legend dl { margin: 0; padding: 0 16px 8px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.kc-legend dt { font-weight: 600; }
.kc-legend dd { margin: 0; color: var(--kc-secondary); }
.kc-legend-states { list-style: none; margin: 0; padding: 4px 16px 14px; display: grid; gap: 8px; color: var(--kc-secondary); }
.kc-legend-states .kc-cap { min-width: 92px; margin-right: 10px; }

/* ---------- case studies ---------- */

.kc-cases:not(:empty) { margin: 0 0 28px; }
.kc-case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kc-case {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 0;
    border-radius: var(--kc-radius);
    background: var(--kc-card);
    text-align: left;
    overflow: hidden;
    cursor: pointer;
}
.kc-case:active { opacity: .8; }
.kc-case-img { display: block; height: 150px; background: #f7f7f9; }
.kc-case-img img { width: 100%; height: 100%; object-fit: cover; }
.kc-case-text { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.kc-case-title { font-size: 16px; font-weight: 600; line-height: 1.35; }
.kc-case-meta { font-size: 14px; color: var(--kc-secondary); }
.kc-case-meta b { color: var(--kc-label); }
.kc-badge {
    align-self: flex-start;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--kc-tint-bg);
    color: var(--kc-tint);
    font-size: 12px;
    font-weight: 600;
}

/* ---------- sheet ---------- */

.kc-sheet {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background .2s;
}
.kc-sheet.is-open { background: rgba(0, 0, 0, .4); }
.kc-sheet-panel {
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: var(--kc-bg);
    border-radius: 14px 14px 0 0;
    transform: translateY(100%);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.kc-sheet.is-open .kc-sheet-panel { transform: none; }
@media (min-width: 720px) {
    .kc-sheet { align-items: center; }
    .kc-sheet-panel { border-radius: 14px; max-height: 86vh; transform: translateY(24px); opacity: 0; transition: transform .2s, opacity .2s; }
    .kc-sheet.is-open .kc-sheet-panel { opacity: 1; }
}
.kc-sheet-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px 10px 20px;
    border-bottom: .5px solid var(--kc-sep);
}
.kc-sheet-title { flex: 1; margin: 0; font-size: 17px; font-weight: 600; color: var(--kc-label); }
.kc-sheet-close {
    flex: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--kc-fill);
    color: var(--kc-secondary) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.kc-sheet-close svg { width: 14px; height: 14px; }
.kc-sheet-body { overflow-y: auto; padding: 16px 20px calc(24px + env(safe-area-inset-bottom)); }
.kc-sheet-zoom { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #fff; border-radius: 12px; }
.kc-sheet-images { display: grid; gap: 10px; margin-bottom: 14px; }
.kc-sheet-images img { width: 100%; border-radius: 12px; background: #fff; }
.kc-sheet-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.kc-sheet-facts div { flex: 1; min-width: 140px; padding: 10px 14px; background: var(--kc-card); border-radius: 10px; }
.kc-sheet-facts span { display: block; font-size: 12px; color: var(--kc-secondary); }
.kc-sheet-text { margin: 0; padding: 14px 16px; background: var(--kc-card); border-radius: 12px; font-size: 15px; line-height: 1.7; }

/* ---------- small phones ---------- */

@media (max-width: 380px) {
    .kc-views { padding-left: 12px; padding-right: 12px; }
    .kc-hero h1 { font-size: 28px; }
    .kc-keys { grid-template-columns: minmax(0, 1fr); }
    .kc-cap-label { font-size: 14px; }
}
@media (max-width: 719px) {
    .kc-keys { grid-template-columns: minmax(0, 1fr); }
}
