/* Compare guide for the Tatami Visualizer (2026-11-15) */
.cg-open {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 6px 0 8px;
    padding: 6px 14px;
    border: 1px solid #1f6f4a;
    border-radius: 999px;
    background: #fff;
    color: #1f6f4a;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}
.cg-open::before { content: "⇆"; }
.cg-open:hover, .cg-open:focus-visible { background: #1f6f4a; color: #fff; }

html.cg-open, html.cg-open body { overflow: hidden; }

.cg-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(20, 28, 24, 0.55);
}
.cg-overlay[hidden] { display: none; }
.cg-dialog {
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    max-height: 92vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: #222;
    font-size: 0.9rem;
    line-height: 1.6;
}
.cg-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #e3e7e2;
}
.cg-title { margin: 0; font-size: 1.15rem; color: #1f4f36; line-height: 1.4; }
.cg-close {
    flex: none;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f1f3f0;
    color: #333;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.cg-body { overflow: auto; padding: 14px 18px; }
.cg-foot { padding: 10px 18px; border-top: 1px solid #e3e7e2; text-align: right; }
.cg-close-text {
    padding: 8px 18px;
    border: 1px solid #c8d2cc;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    cursor: pointer;
}
.cg-banner {
    margin: 0 0 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #b5652b;
    color: #fff;
    font-weight: 700;
}
.cg-legend { margin: 0 0 8px; color: #555; font-size: 0.82rem; }
.cg-scroll-hint { display: none; margin: 0 0 4px; color: #777; font-size: 0.78rem; }
.cg-table-wrap { overflow-x: auto; border: 1px solid #d9ddd7; border-radius: 8px; }
.cg-table { width: 100%; border-collapse: collapse; }
.cg-table-core { min-width: 1000px; }
.cg-table-surface { min-width: 560px; }
.cg-table th, .cg-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e3e7e2;
    border-left: 1px solid #e3e7e2;
    vertical-align: top;
    text-align: left;
    white-space: pre-line;
}
.cg-table thead th { background: #4a5d3a; color: #fff; vertical-align: top; }
.cg-corner, .cg-row-head {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 92px;
    background: #f3f3f3;
    color: #333;
    font-weight: 700;
}
.cg-table thead .cg-corner { background: #4a5d3a; color: #fff; z-index: 2; }
.cg-col-head { min-width: 170px; }
.cg-col-name { display: block; font-size: 0.95rem; }
.cg-col-sub { display: block; font-size: 0.78rem; font-weight: 400; opacity: 0.9; }
.cg-photo {
    display: block;
    width: 100%;
    max-width: 260px;
    height: 120px;
    margin: 8px 0 4px;
    object-fit: cover;
    border-radius: 6px;
    background: #fff;
}
.cg-table-core .cg-photo { object-fit: contain; }
.cg-caption { display: block; font-size: 0.75rem; font-weight: 400; opacity: 0.9; }
.cg-choose {
    display: inline-block;
    margin-top: 6px;
    padding: 5px 10px;
    border: 0;
    border-radius: 5px;
    background: #fff;
    color: #1f6f4a;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.cg-table tbody td { font-weight: 400; }
.cg-table tbody td:nth-child(even) { background: #f6f9f2; }
.cg-mark { display: inline-block; margin-right: 6px; font-size: 1.05rem; font-weight: 700; }
.cg-mark-excellent { color: #c0504d; }
.cg-mark-good { color: #2f6eba; }
.cg-mark-care { color: #7f7f7f; }
.cg-summary { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: #f3f6ef; }
.cg-summary h3 { margin: 0 0 6px; font-size: 1rem; color: #1f4f36; }
.cg-summary p { margin: 3px 0; }
.cg-note { margin: 8px 0 0; color: #777; font-size: 0.78rem; }

@media (max-width: 720px) {
    .cg-overlay { padding: 0; align-items: stretch; }
    .cg-dialog { max-height: 100vh; height: 100%; border-radius: 0; }
    .cg-scroll-hint { display: block; }
    .cg-corner, .cg-row-head { min-width: 76px; max-width: 90px; }
}
