html {
    height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: #efece6;
    color: #1a1814;
    font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

a {
    color: #9a3d12;
}

a:hover {
    color: #c4511a;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.wrapper > .container {
    flex: 1 0 auto;
    width: 100% !important;
    max-width: none !important;
    padding-left: 64px !important;
    padding-right: 64px !important;
}

.body-content.container {
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.body-content {
    width: 100%;
    padding-top: 20px;
    padding-bottom: 64px;
}

.finder {
    max-width: none;
    width: 100%;
    margin: 12px 0 0;
}

.brand {
    margin: 0 0 10px;
    color: #c4511a;
    font-family: "Segoe UI", "Yu Gothic UI", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-align: left;
}

.finder h1,
.page-narrow h1,
.body-content h1 {
    margin: 0 0 12px;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", serif;
    font-size: 42px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.03em;
}

.lead {
    max-width: 38em;
    margin: 0 0 22px;
    color: #5c574e;
    text-align: left;
}

.lead strong {
    color: #1a1814;
}

/* 解説ページの計算式 */
.formula {
    padding: 10px 12px;
    border-left: 3px solid #ff6600;
    border-radius: 4px;
    background: #fff1e6;
    font-weight: bold;
}

/* 運営者情報の表 */
.info-table {
    width: 100%;
    margin: 0 0 16px;
    border-collapse: collapse;
}

.info-table th,
.info-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e4ddd0;
    text-align: left;
    vertical-align: top;
}

.info-table th {
    width: 7em;
    color: #5c574e;
    font-weight: normal;
    white-space: nowrap;
}

/* ---- AI分析をサイトの特徴として見せる ---- */
/* 「AI分析」の印。見出しやロゴの横に付ける */
.brand-ai {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff6600, #c4511a);
    color: #fff;
    font-family: "Segoe UI", "Yu Gothic UI", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    vertical-align: middle;
}

/* スマホのときだけ改行する */
.sp-br {
    display: none;
}

/* リード文の下の「AIでわかること」 */
.ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin: -10px 0 20px;
    padding: 0;
    list-style: none;
}

.ai-chips li {
    padding: 3px 10px;
    border: 1px solid #f0c9a8;
    border-radius: 999px;
    background: #fff7ef;
    color: #9a3d12;
    font-size: 13px;
}

.ai-chips li::before {
    content: "✓ ";
    color: #ff6600;
}

/* 結果の下の AI分析の紹介 */
.ai-intro {
    margin-top: 40px;
    padding: 22px 20px 12px;
    border: 1px solid #f0c9a8;
    border-radius: 16px;
    background: #fff7ef;
}

.ai-intro h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.ai-intro-lead {
    margin: 0 0 14px;
    color: #5c574e;
}

/* トップの「AI分析の表示例」 */
.ai-sample {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 2px solid #ff6600;
    border-radius: 12px;
    background: #fffcf7;
}

.ai-sample-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 8px;
}

.ai-sample-title {
    color: #9a3d12;
    font-weight: bold;
}

.ai-sample-try {
    margin-left: auto;
    padding: 4px 12px;
    border: 0;
    border-radius: 999px;
    background: #ff6600;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.ai-sample-body {
    max-width: 40em;
}

.ai-sample-note {
    margin: 8px 0 0;
}

.ai-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.ai-feature-grid article {
    padding: 14px 14px 6px;
    border: 1px solid #f0d9c4;
    border-radius: 12px;
    background: #fffcf7;
}

.ai-feature-grid h3 {
    margin: 0 0 6px;
    color: #9a3d12;
    font-size: 15px;
}

.ai-feature-grid p {
    margin: 0 0 8px;
    font-size: 13px;
}

@media (max-width: 800px) {
    .sp-br {
        display: inline;
    }
}

.panel {
    background: #fffcf7;
    border: 1px solid #e4ddd0;
    border-top: 3px solid #c4511a;
    border-radius: 16px;
    padding: 20px 20px 14px;
}

.markets {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.markets input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    max-width: none;
}

.markets label {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid #d9d2c5;
    border-radius: 999px;
    background: #fff;
    color: #1a1814;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
}

.markets input:checked + label {
    background: #ff6600;
    border-color: #ff6600;
    color: #fff;
}

.markets input:focus-visible + label {
    outline: 2px solid #c4511a;
    outline-offset: 2px;
}

.search-row {
    display: flex;
    gap: 8px;
    /* 入力欄が横いっぱいに伸びすぎないよう、検索ボタンを含めた幅を抑える(スマホではそのまま全幅) */
    max-width: 640px;
    margin-top: 16px;
}

.search-input,
.captcha-input {
    max-width: none;
    border: 1px solid #d9d2c5;
    border-radius: 10px;
    background: #fff;
    color: #1a1814;
    font-size: 16px;
    box-shadow: none;
}

.search-input {
    flex: 1 1 auto;
    width: 1%;
    height: 52px;
    padding: 0 16px 0 44px;
}

/* 検索欄を目立たせる: オレンジの太い枠、左に虫めがね、うっすら光る影。入力中はさらに強く */
.search-row .search-input {
    border: 2px solid #ff8a3d;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ff6600' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E") no-repeat 15px center;
    box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.10);
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-row .search-input::placeholder {
    color: #a39b8f;
    font-weight: normal;
}

.search-row .search-input:hover {
    border-color: #ff6600;
}

.search-row .search-input:focus {
    border-color: #ff6600;
    outline: none;
    box-shadow: 0 0 0 5px rgba(255, 102, 0, 0.25);
}

/* 検索欄の上の見出し */
.search-label {
    display: block;
    margin: 16px 0 0;
    color: #1a1814;
    font-size: 15px;
    font-weight: bold;
}

.search-label-sub {
    color: #c4511a;
    font-size: 13px;
    font-weight: normal;
}

.search-label + .search-row {
    margin-top: 6px;
}

.search-btn {
    height: 52px;
    max-width: none;
    padding: 0 26px;
    border: 0;
    border-radius: 10px;
    background: #ff6600;
    color: #fff;
    font-size: 15px;
    letter-spacing: 0.12em;
    cursor: pointer;
}

.search-btn:hover,
.search-btn:focus {
    background: #e05500;
    color: #fff;
}

.captcha-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.captcha-input {
    width: 140px;
    height: 40px;
    padding: 0 12px;
}

.captcha-img {
    /* 画像は 170x50。縮めると傾けた文字が読みにくくなるので等倍で出す */
    height: 50px;
    width: auto;
    border: 1px solid #d9d2c5;
    border-radius: 8px;
    background: #fff;
}

.captcha-refresh {
    font-size: 13px;
    text-decoration: none;
}

.captcha-msg {
    color: #9a3d12;
    font-size: 13px;
}

.hint {
    margin: 12px 0 0;
    color: #6f6a61;
    font-size: 13px;
    text-align: left;
}

.result-wrap {
    margin-top: 22px;
    max-width: 100%;
    overflow-x: auto;
}

.result-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px 18px;
    margin-bottom: 10px;
}

.csv-link {
    font-size: 14px;
}

.result-count {
    color: #5c574e;
    font-size: 13px;
}

/* Yahoo!・楽天の商品名列: 1行目に価格と件数、2行目に商品名。表は table-layout: fixed なので幅は見出し側で決まる */
.result-grid th.item-name,
.result-grid td.item-name {
    width: 22em !important;
    white-space: normal !important;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.5;
}

.hit-count {
    display: inline-block;
    padding: 0 5px;
    border-radius: 3px;
    background: #efe7da;
    color: #5c574e;
    font-size: 11px;
}

.item-price {
    color: #b12704;
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
}

/* モール列の商品画像(楽天・Yahoo!・eBay の公式APIの画像)。左に画像、右に価格と商品名 */
.item-card {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.item-text {
    min-width: 0;
}

/* .result-grid img の 112px 指定(旧Amazon画像用)より優先させる */
.result-grid img.item-thumb {
    flex: 0 0 56px;
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    object-fit: contain;
    border: 1px solid #e7e1d6;
    border-radius: 6px;
    background: #fff;
}

/* 新品・中古の切り替え(国の選択と同じ見た目で、すぐ下に置く) */
.markets.conditions {
    margin-top: 10px;
}

/* 精度が低い結果(楽天の中古)に付ける印 */
.ref-badge {
    display: inline-block;
    padding: 0 5px;
    border: 1px solid #c4511a;
    border-radius: 3px;
    color: #c4511a;
    font-size: 11px;
    line-height: 1.5;
}

.item-price-org {
    color: #6f6a61;
    font-size: 12px;
    white-space: nowrap;
}

.item-src {
    color: #6f6a61;
    font-size: 11px;
}

.api-credit a {
    margin-left: 8px;
}

.result-grid {
    width: 100% !important;
    max-width: none;
    /* 商品名列が3本あるので、狭い画面では潰さず .result-wrap の中で横スクロールさせる */
    min-width: 1950px;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fffcf7;
    border: 1px solid #e4ddd0;
    border-radius: 12px;
}

.result-grid th,
.result-grid td {
    width: auto !important;
    padding: 8px 6px;
    border-bottom: 1px solid #e7e1d6;
    vertical-align: top !important;
    text-align: left;
    white-space: nowrap !important;
    word-break: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 列の見出しは中央寄せ(中身は左寄せのまま) */
.result-grid th {
    text-align: center;
    vertical-align: middle !important;
}

.result-grid th:nth-child(1),
.result-grid td:nth-child(1),
.result-grid td.m-no {
    width: 3.2em !important;
    padding-left: 4px;
    padding-right: 4px;
}

/* ASIN・JAN・価格推移(Keepa へのリンク)をまとめた列。位置ではなくクラスで幅を決める */
.result-grid th.id-col,
.result-grid td.id-col {
    width: 13em !important;
    white-space: normal !important;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.7;
}

.id-label {
    display: inline-block;
    min-width: 3.2em;
    color: #6f6a61;
    font-size: 11px;
}

/* AI分析の列(商品名の整理・お得のひとこと・輸出の見込み・eBayタイトル案とカテゴリ) */
.result-grid th.ai-col,
.result-grid td.ai-col {
    width: 24em !important;
    white-space: normal !important;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.5;
}

/* 結果の表の AI分析の列を目立たせる(見出しと背景) */
.result-grid th.ai-col {
    background: linear-gradient(90deg, #c4511a, #ff6600) !important;
}

.result-grid th.ai-col::after {
    content: " ✦";
}

.result-grid td.ai-col {
    background: #fff7ef !important;
    border-left: 2px solid #f0c9a8;
    border-right: 2px solid #f0c9a8;
}

/* 分析を待っている間の表示(文字の上を光が流れる) */
.ai-loading {
    display: inline-block;
    color: #9a3d12;
    font-size: 12px;
    background: linear-gradient(90deg, #9a3d12 0%, #ffb27a 50%, #9a3d12 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: ai-shine 1.6s linear infinite;
}

@keyframes ai-shine {
    from { background-position: 200% 0; }
    to { background-position: 0 0; }
}

/* 分析が届いたらふわっと出す */
.ai-cell.ai-done {
    animation: ai-in 0.4s ease-out;
}

@keyframes ai-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ai-loading,
    .ai-cell.ai-done {
        animation: none;
    }
}

.ai-cell > div + div {
    margin-top: 4px;
}

.ai-name {
    font-weight: bold;
}

/* AI分析の項目ごとの枠。左の線と背景の色で項目を見分けられるようにする
     商品名の案=オレンジ / 輸出の注意=赤 / eBayタイトル案=青 / eBayカテゴリ=緑 */
.ai-block {
    padding: 5px 8px;
    border-left: 3px solid transparent;
    border-radius: 4px;
}

.ai-block .ai-label {
    margin-right: 4px;
    color: #fff;
    font-weight: bold;
}

.ai-block-name {
    border-left-color: #ff6600;
    background: #fff1e6;
}

.ai-block-name .ai-label {
    background: #ff6600;
    cursor: help;  /* Amazon の商品名ではないことをマウスを乗せると説明する */
}

.ai-block-warn {
    border-left-color: #d93025;
    background: #fdecea;
    color: #7a1b14;
    font-size: 12px;
}

.ai-block-warn .ai-label {
    background: #d93025;
}

.ai-block-title {
    border-left-color: #1a73e8;
    background: #e8f0fe;
}

.ai-block-title .ai-label {
    background: #1a73e8;
}

.ai-block-cate {
    border-left-color: #188038;
    background: #e6f4ea;
}

.ai-block-cate .ai-label {
    background: #188038;
}

.ai-summary {
    color: #1a1814;
}

.ai-muted,
.ai-foot {
    color: #6f6a61;
    font-size: 11px;
}

.ai-label,
.ai-tag {
    display: inline-block;
    padding: 0 5px;
    border-radius: 3px;
    background: #efe7da;
    color: #5c574e;
    font-size: 11px;
}

.ai-tag {
    background: #e6eef7;
    color: #2f5a8a;
}

.ai-profit-plus {
    color: #1d7a3a;
}

.ai-profit-minus {
    color: #b12704;
}

.ai-copy {
    padding: 0 6px;
    border: 1px solid #d9d2c5;
    border-radius: 4px;
    background: #fff;
    font-size: 11px;
    cursor: pointer;
}

/* AI分析の上限に達したときの案内(結果の表の上) */
.ai-notice {
    margin: 0 0 10px;
    padding: 8px 12px;
    border: 1px solid #e8c9a8;
    border-radius: 8px;
    background: #fdf3e7;
    color: #6b3a10;
    font-size: 13px;
}

/* 各モールの列に出す「別商品の可能性」 */
.ai-mismatch {
    margin-top: 4px;
    color: #b12704;
    font-size: 12px;
}

/* ASIN / JAN 列の中のフリマ・オークション(メルカリ・ヤフオク・Yahoo!フリマへの検索リンク) */
.id-flea {
    margin-top: 2px;
    padding-top: 4px;
    border-top: 1px dashed #e4ddd0;
    font-size: 12px;
}

/* 「Yahoo!フリマ」などのリンク名を途中で折り返さない */
.id-flea a {
    white-space: nowrap;
}

.result-grid img {
    display: block !important;
    width: 112px !important;
    height: auto !important;
    max-width: 112px !important;
    max-height: 160px !important;
    object-fit: contain;
    visibility: visible !important;
    margin: 0 !important;
    vertical-align: top !important;
}

/* 列幅のドラッグ調整(Default.aspx のスクリプト)。見出しの右端をつかんで動かす */
.result-grid th {
    position: relative;
}

.col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
}

.col-resizer:hover,
.col-resizer.dragging {
    background: rgba(255, 255, 255, 0.45);
}

/* ハニーポット: 画面外に出して人には見せない(display:none だと無視するボットがあるため) */
.hp-field {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.col-reset {
    font-size: 13px;
}

.result-grid p {
    margin: 0;
    white-space: nowrap;
}

.result-grid a {
    color: #9a3d12;
    text-decoration: none;
}

.result-grid a:hover {
    text-decoration: underline;
}

.guide {
    margin-top: 48px;
    padding-top: 8px;
}

.guide h2,
.page-narrow h1 {
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

.guide h2 {
    margin: 0 0 16px;
    font-size: 26px;
    font-weight: 600;
}

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

.guide article {
    padding: 16px 16px 8px;
    background: #fffcf7;
    border: 1px solid #e4ddd0;
    border-radius: 14px;
}

.guide h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.guide p,
.page-narrow p {
    margin: 0 0 12px;
    color: #3d3933;
    text-align: left;
}

.guide code {
    padding: 0 4px;
    background: #f3eee6;
    border-radius: 4px;
    font-size: 0.92em;
}

.page-narrow {
    max-width: 640px;
    margin: 12px auto;
}

footer {
    width: 100%;
    margin-top: auto;
    padding: 22px 16px 28px;
    background: #efece6;
    color: #5c574e;
    text-align: center;
    border-top: 1px solid #e4ddd0;
}

.foot-note,
.foot-links,
footer p {
    margin: 0 0 6px;
    text-align: center;
    font-size: 13px;
}

.foot-links a {
    margin: 0 8px;
    color: #5c574e;
    text-decoration: none;
}

.foot-links a:hover {
    color: #c4511a;
}

.guide-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
}

.guide-list li {
    margin: 0 0 10px;
    padding: 14px 16px;
    background: #fffcf7;
    border: 1px solid #e4ddd0;
    border-radius: 12px;
}

.guide-list a {
    font-weight: 700;
    text-decoration: none;
}

.guide-list p {
    margin: 4px 0 0;
}

.crumb,
.article-date {
    margin: 0 0 8px;
    color: #6f6a61;
    font-size: 13px;
    text-align: left;
}

.page-narrow h2 {
    margin: 22px 0 8px;
    font-size: 18px;
}

.galleryIMG_wrap {
    display: inline;
    overflow: hidden;
    float: right;
    width: 100px;
    height: 100px;
    padding: 3px;
    margin: 0;
}

@media (max-width: 800px) {
    .finder h1 {
        font-size: 32px;
    }

    .guide-grid {
        grid-template-columns: 1fr;
    }

    .search-row {
        flex-direction: column;
    }

    .search-input,
    .search-btn {
        width: 100%;
    }
}

/* ---- 週間 価格差レポート(weekly.aspx) ---- */
.page-narrow.wr {
    max-width: 760px;
}

.wr-meta th {
    width: 6em;
}

.wr-item {
    margin: 0 0 18px;
    padding: 14px 16px;
    background: #fffcf7;
    border: 1px solid #e4ddd0;
    border-radius: 12px;
}

.wr-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.wr-img {
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e7e1d6;
    border-radius: 8px;
}

.page-narrow h3.wr-name {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.wr-sub {
    color: #6f6a61;
    font-size: 12px;
}

.wr-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 3px;
    background: #efece6;
    color: #3d3933;
    font-size: 11px;
    line-height: 1.7;
}

.wr-tag-ai {
    background: #fff1e6;
    color: #c4511a;
    cursor: help;
}

.wr-prices {
    width: 100%;
    margin: 4px 0 8px;
    border-collapse: collapse;
    font-size: 14px;
}

.wr-prices th,
.wr-prices td {
    padding: 6px 8px;
    border-bottom: 1px solid #e4ddd0;
    text-align: left;
}

.wr-prices th {
    color: #6f6a61;
    font-size: 12px;
    font-weight: normal;
}

.wr-prices td:nth-child(3) {
    color: #6f6a61;
    white-space: nowrap;
}

.wr-prices tr.wr-min td {
    background: #fff1e6;
    font-weight: bold;
}

.wr-prices tr.wr-none td,
.wr-prices tr.wr-off td {
    color: #8a847a;
    font-size: 12px;
}

.wr-prices tr.wr-off td:nth-child(2) {
    color: #7a1b14;
}

.wr-badge {
    display: inline-block;
    padding: 0 5px;
    border-radius: 3px;
    background: #ff6600;
    color: #fff;
    font-size: 11px;
    line-height: 1.6;
    vertical-align: 1px;
}

.wr-facts {
    margin: 0 0 8px;
    padding-left: 1.2em;
    font-size: 14px;
}

.wr-plus {
    color: #188038;
}

.wr-minus {
    color: #d93025;
}

.wr-item .ai-block {
    margin: 0 0 6px;
    font-size: 13px;
}

.page-narrow p.wr-links {
    margin: 6px 0 0;
    font-size: 13px;
}

.wr-notes {
    padding-left: 1.2em;
    color: #3d3933;
    font-size: 13px;
}

.page-narrow p.wr-nav {
    display: flex;
    justify-content: space-between;
    margin: 20px 0 12px;
}

.page-narrow p.wr-draft {
    padding: 8px 12px;
    border-left: 3px solid #d93025;
    border-radius: 4px;
    background: #fdecea;
    color: #7a1b14;
    font-size: 13px;
}

/* ---- 記事の管理(manage/articles.aspx) ---- */
.page-narrow.mg {
    max-width: 900px;
}

.mg-table {
    width: 100%;
    margin: 8px 0 16px;
    border-collapse: collapse;
    font-size: 13px;
}

.mg-table th,
.mg-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #e4ddd0;
    text-align: left;
    vertical-align: top;
}

.mg-edit {
    padding: 12px 16px;
    background: #fffcf7;
    border: 1px solid #e4ddd0;
    border-radius: 12px;
}

.mg-label {
    display: block;
    margin: 10px 0 4px;
    font-size: 13px;
    font-weight: bold;
}

.mg-input {
    padding: 6px 8px;
    border: 1px solid #cfc6b6;
    border-radius: 6px;
    font-size: 14px;
}

.mg-wide {
    width: 100%;
    max-width: none;
}

.mg-btn {
    margin: 0 6px 6px 0;
    padding: 6px 14px;
    border: 0;
    border-radius: 6px;
    background: #ff6600;
    color: #fff;
    font-weight: bold;
}

.mg-btn-sub {
    background: #8a847a;
}

.mg-btn[disabled] {
    opacity: 0.5;
}

.mg-msg {
    color: #c4511a;
    font-weight: bold;
}

.page-narrow p.mg-help {
    color: #6f6a61;
    font-size: 13px;
}

@media (max-width: 600px) {
    .wr-img {
        width: 60px;
        height: 60px;
    }

    .wr-prices {
        font-size: 13px;
    }
}

.page-narrow.wr h1 {
    font-size: 30px;
}

@media (max-width: 600px) {
    .page-narrow.wr h1 {
        font-size: 24px;
    }
}

/* ---- バーコードの読み取り ---- */
.scan-btn {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 2px solid #ff6600;
    border-radius: 10px;
    background: #fff;
    color: #c4511a;
    font-weight: bold;
    white-space: nowrap;
}

.scan-btn[hidden] {
    display: none;
}

.scan-btn:hover,
.scan-btn:focus-visible {
    background: #fff1e6;
}

.scan-box {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(26, 24, 20, 0.85);
}

.scan-box[hidden] {
    display: none;
}

.scan-inner {
    position: relative;
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.scan-video {
    display: block;
    width: 100%;
    max-height: 60vh;
    object-fit: cover;
    border-radius: 12px;
    background: #000;
}

.scan-frame {
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 0;
    margin-top: min(30vh, 27%);
    border-top: 2px solid #ff6600;
    box-shadow: 0 0 12px #ff6600;
    pointer-events: none;
}

.scan-msg {
    margin: 12px 0;
    color: #fff;
    font-size: 14px;
    text-align: center;
}

.scan-close {
    padding: 8px 28px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #1a1814;
    font-weight: bold;
}

/* ---- お店の価格と比べる(結果の「ASIN / JAN」欄) ---- */
.store-cmp {
    margin-top: 8px;
    padding: 6px 8px;
    border: 1px dashed #e4ddd0;
    border-radius: 6px;
    background: #fff;
    white-space: normal;
}

.store-cmp.store-scanned {
    border: 2px solid #ff6600;
}

.store-label {
    display: block;
    margin: 0 0 4px;
    color: #c4511a;
    font-size: 12px;
    font-weight: bold;
}

.store-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.store-input {
    width: 6.5em;
    min-width: 0;
    padding: 3px 6px;
    border: 1px solid #cfc6b6;
    border-radius: 4px;
}

.store-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 3px 10px;
    border: 0;
    border-radius: 4px;
    background: #ff6600;
    color: #fff;
    font-weight: bold;
}

.store-btn[disabled] {
    opacity: 0.6;
}

.store-res {
    margin-top: 6px;
    font-size: 12px;
}

.store-line {
    margin-bottom: 2px;
    font-size: 13px;
}

.store-net b {
    color: #188038;
}

.store-shop b {
    color: #1a73e8;
}

.store-ai {
    margin-top: 4px;
}

@media (max-width: 800px) {
    .scan-btn {
        width: 100%;
        min-height: 44px;
    }
}

/* ---- 一般の買い物客向け ---- */
/* eBay の列がないときの表の最小幅(商品名列が3本) */
.result-grid.no-ebay {
    min-width: 1600px;
}

/* 各行の「Amazonで見る」ボタン */
.id-amazon {
    margin: 4px 0;
}

.amazon-btn {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid #c4511a;
    border-radius: 999px;
    background: #fff;
    color: #c4511a;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
}

.amazon-btn:hover,
.amazon-btn:focus-visible {
    background: #fff1e6;
    text-decoration: none;
}

.id-note {
    display: block;
    color: #6f6a61;
    font-size: 11px;
    line-height: 1.4;
}

/* 週間レポート: 運営者が確認していることの表示と、運営者のコメント */
.page-narrow p.wr-review {
    color: #6f6a61;
    font-size: 12px;
}

.wr-comment {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-left: 4px solid #188038;
    border-radius: 6px;
    background: #e6f4ea;
}

.page-narrow p.wr-comment-label {
    margin: 0 0 4px;
    color: #188038;
    font-size: 13px;
    font-weight: bold;
}

.wr-comment p:last-child {
    margin-bottom: 0;
}

/* 解説記事の「運営者のひとこと」 */
.op-note {
    margin: 20px 0 16px;
    padding: 10px 14px;
    border-left: 4px solid #188038;
    border-radius: 6px;
    background: #e6f4ea;
}

.page-narrow p.op-note-label {
    margin: 0 0 4px;
    color: #188038;
    font-size: 13px;
    font-weight: bold;
}

.op-note p:last-child {
    margin-bottom: 0;
}

/* AI分析の「事実」の一覧(ポイント込みの最安・価格の幅・中古の相場・定価との比較) */
.ai-facts {
    margin: 6px 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
}

.ai-facts li {
    margin: 0 0 4px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #fffcf7;
    border: 1px solid #efe4d4;
}

.ai-fact-label {
    display: inline-block;
    margin-right: 6px;
    padding: 0 6px;
    border-radius: 3px;
    background: #efe7da;
    color: #5c574e;
    font-size: 11px;
    font-weight: bold;
}

/* ---- スマホの見やすさ ---- */
/* パソコンでは、カード用の欄(画像といちばん安いお店)と短い説明は出さない */
.result-grid td.m-top,
.lead-sp {
    display: none;
}

@media (max-width: 768px) {
    /* 最初の画面に検索欄が入るよう、見出しと説明を小さくする */
    .finder h1 {
        font-size: 26px;
        line-height: 1.35;
    }

    .finder .lead {
        display: none;
    }

    .lead-sp {
        display: block;
        margin: 0 0 10px;
        color: #5c574e;
        font-size: 14px;
    }

    /* 機能の印は小さくして折り返す(横スクロールはしない) */
    .ai-chips {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 12px;
    }

    .ai-chips li {
        padding: 2px 8px;
        font-size: 12px;
    }

    .panel {
        padding: 14px 14px 10px;
    }

    .search-label-sub {
        display: none;
    }

    /* 1段目に入力欄、2段目に「検索」と「バーコードを読み取る」を横に並べる */
    .search-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .search-row .search-input {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        font-size: 17px;
    }

    .search-row .search-btn {
        grid-column: 1;
        width: 100%;
        padding: 0 8px;
    }

    .search-row .scan-btn {
        grid-column: 2;
        width: 100%;
        min-height: 52px;
        padding: 0 6px;
        gap: 4px;
        font-size: 14px;
    }

    /* 結果: 表をやめて、商品ごとのカードを縦に並べる */
    .result-wrap {
        overflow-x: visible;
    }

    .result-grid,
    .result-grid.no-ebay {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        border: 0;
        background: transparent;
    }

    .result-grid tbody {
        display: block;
    }

    .result-grid tr.m-head,
    .result-grid td.m-no {
        display: none !important;
    }

    .result-grid tr {
        display: flex;
        flex-direction: column;
        margin: 0 0 16px;
        overflow: hidden;
        border: 1px solid #e4ddd0;
        border-radius: 14px;
        background: #fffcf7 !important;
    }

    .result-grid td,
    .result-grid th.id-col,
    .result-grid td.id-col,
    .result-grid td.ai-col,
    .result-grid td.item-name {
        display: block;
        width: auto !important;
        padding: 8px 14px;
        border: 0;
        white-space: normal !important;
        overflow: visible;
    }

    /* 並び順: 画像といちばん安いお店 → AI分析 → 各お店の価格 → Amazon・お店の価格と比べる・番号 */
    .result-grid td.m-top {
        display: flex;
        width: auto !important;
        order: 1;
        gap: 12px;
        align-items: center;
        padding-top: 14px;
    }

    .result-grid td.ai-col {
        order: 2;
        border: 0;
        background: #fff7ef !important;
    }

    .result-grid td.mall-yahoo { order: 3; }
    .result-grid td.mall-rakuten { order: 4; }
    .result-grid td.mall-aupay { order: 5; }

    .result-grid td.id-col {
        order: 6;
        border-top: 1px solid #e7e1d6;
        font-size: 13px;
    }

    /* .result-grid img(旧Amazon画像用)の !important より優先させる */
    .result-grid td.m-top img.m-img {
        width: 72px !important;
        height: 72px !important;
        max-width: 72px !important;
        max-height: 72px !important;
    }

    .m-best {
        flex: 1 1 auto;
    }

    .m-img {
        flex: 0 0 auto;
        width: 72px;
        height: 72px;
        object-fit: contain;
        background: #fff;
        border: 1px solid #e7e1d6;
        border-radius: 8px;
    }

    .m-best {
        display: flex;
        flex-direction: column;
    }

    .m-best-label {
        color: #6f6a61;
        font-size: 12px;
    }

    .m-best-price {
        color: #c4511a;
        font-size: 24px;
        line-height: 1.2;
    }

    .m-best-mall {
        font-size: 13px;
    }

    /* 各お店の価格は1行ずつ。左にお店の名前、右に価格と件数。画像と長い商品名は出さない */
    .result-grid td.item-name {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 4px 8px;
        border-top: 1px solid #efe7da;
        line-height: 1.5;
    }

    .result-grid td.mall-yahoo::before { content: "Yahoo!"; }
    .result-grid td.mall-rakuten::before { content: "楽天"; }
    .result-grid td.mall-aupay::before { content: "au PAY"; }

    .result-grid td.item-name::before {
        flex: 0 0 4.5em;
        color: #5c574e;
        font-size: 13px;
        font-weight: bold;
    }

    .result-grid td.item-name > a {
        flex: 1 1 auto;
        text-decoration: none;
    }

    .result-grid td.item-name > a::after {
        content: " ›";
        color: #c4511a;
    }

    .result-grid td.item-name .item-thumb,
    .result-grid td.item-name .item-nm,
    .result-grid td.item-name .item-text br {
        display: none !important;
    }

    .result-grid td.item-name .item-card {
        display: inline;
    }

    .result-grid td.item-name .item-price {
        font-size: 16px;
    }

    .result-grid td.item-name .ai-mismatch {
        flex: 1 1 100%;
    }

    /* AI分析の詳しい内容(価格の幅・中古の相場など)は折りたたむ */
    .ai-more > summary {
        color: #c4511a;
        font-size: 13px;
        font-weight: bold;
        cursor: pointer;
    }

    .col-reset {
        display: none;
    }
}

/* パソコンでは「価格の詳しい分析」の見出しを控えめに */
.ai-more > summary {
    margin: 4px 0;
    color: #9a3d12;
    font-size: 12px;
    cursor: pointer;
}

/* スマホでは左右の余白を 16px にして、画面の幅を広く使う */
@media (max-width: 768px) {
    .wrapper > .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}
