/* カバンの重さ計算：白黒の線画と大きなグラム表示。色は使わず、線の太さと文字の大きさで分ける */
:root { --ink: #111; --paper: #fff; --soft: #f4f4f4; }
@media (prefers-color-scheme: dark) { :root { --ink: #f2f2f2; --paper: #111; --soft: #1c1c1c; } }
/* 文字：読み間違えにくい UD ゴシック（無ければ游ゴシック・ヒラギノ角ゴ）。数字は幅をそろえる */
body { background: var(--paper); color: var(--ink); font-family: "BIZ UDPGothic", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif; }
a { color: var(--ink); text-underline-offset: 3px; }
.site-header { border-bottom: 2px solid var(--ink); }
h2 { border-left: 0; padding-left: 0; border-bottom: 2px solid var(--ink); padding-bottom: 2px; }
th, td { border-color: var(--ink); }
th { background: var(--soft); }
button { background: var(--ink); border-color: var(--ink); color: var(--paper); border-radius: 0; }
button.secondary { background: transparent; color: var(--ink); }
select, input[type="text"] { border: 1.5px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); }

/* 線画のアイコン（currentColor の線だけ） */
.icon { display: inline-block; width: 28px; height: 28px; flex: none; background: currentColor; vertical-align: middle;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.icon-laptop { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Crect x='6' y='7' width='20' height='13'/%3E%3Cpath d='M3 24h26l-2-4H5z'/%3E%3C/svg%3E"); }
.icon-tablet { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Crect x='7' y='4' width='18' height='24' rx='2'/%3E%3Ccircle cx='16' cy='24.5' r='1'/%3E%3C/svg%3E"); }
.icon-charger { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Crect x='8' y='10' width='16' height='16' rx='2'/%3E%3Cpath d='M12 10V4M20 10V4M14 18h4M16 15v6'/%3E%3C/svg%3E"); }
.icon-battery { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Crect x='9' y='5' width='14' height='23' rx='2'/%3E%3Cpath d='M17 10l-4 7h5l-3 6'/%3E%3C/svg%3E"); }
.icon-earbud { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Crect x='5' y='16' width='22' height='12' rx='5'/%3E%3Cpath d='M5 21h22'/%3E%3Ccircle cx='11' cy='9' r='3.5'/%3E%3Cpath d='M11 12.5V16M21 12.5V16'/%3E%3Ccircle cx='21' cy='9' r='3.5'/%3E%3C/svg%3E"); }
.icon-custom { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M6 12h20l-2 16H8z'/%3E%3Cpath d='M12 12V9a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E"); }

/* カバン：取っ手のついた線の箱 */
.bag { position: relative; border: 2.5px solid var(--ink); border-radius: 4px 4px 18px 18px; padding: 18px 14px 14px; margin: 44px 0 16px; }
.bag::before { content: ""; position: absolute; left: 50%; top: -34px; width: 96px; height: 34px; margin-left: -48px;
  border: 2.5px solid var(--ink); border-bottom: 0; border-radius: 40px 40px 0 0; }
.bag-title { margin: 0 0 4px; border: 0; padding: 0; text-align: center; font-size: 1rem; }
.total { text-align: center; margin: 0 0 8px; }
.total .label { display: block; font-size: 0.85rem; letter-spacing: 0.08em; }
.total .num { display: block; font-size: 3.4rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.total .sub { font-size: 0.9rem; }
.lighter { font-size: 0.9rem; text-align: center; margin: 4px 0 10px; min-height: 1.2em; }
.bag-list { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--ink); }
.bag-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--ink); }
.bag-info { flex: 1; min-width: 0; }
.bag-name { display: block; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.bag-meta, .bag-best { display: block; font-size: 0.78rem; line-height: 1.5; }
.bag-swap { display: block; font-size: 0.82rem; line-height: 1.5; margin-top: 4px; padding: 4px 6px; border: 1px solid var(--ink); }
.bag-swap .swap { min-height: 32px; padding: 2px 10px; margin-top: 4px; font-size: 0.82rem; }
.bag-g { font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.remove { min-height: 36px; min-width: 36px; padding: 0; background: transparent; color: var(--ink); font-size: 1.2rem; line-height: 1; }
.bag-empty { text-align: center; font-size: 0.9rem; margin: 10px 0; }
.bag-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share-msg { font-size: 0.8rem; overflow-wrap: anywhere; margin: 6px 0 0; }

/* 入れる物を選ぶ */
.pick label { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; }
.pick-row { display: flex; gap: 6px; }
.pick-row select { flex: 1; min-width: 0; }
.pick-row .add { flex: none; }
.custom { border: 1.5px dashed var(--ink); padding: 4px 12px 12px; margin-top: 18px; }
.custom .row { display: grid; grid-template-columns: 1fr 9em; gap: 0 8px; }
.err { font-size: 0.8rem; min-height: 1.1em; margin: 2px 0 0; font-weight: 700; }
input[aria-invalid="true"] { border-width: 3px; }

/* ランキングの表 */
.rank td, .rank th { vertical-align: top; }
.rank td:first-child { white-space: nowrap; }
.rank .g { font-weight: 800; font-size: 1.1rem; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.rank .g .u { font-size: 0.75em; font-weight: 700; margin-left: 1px; }
.table-wrap .rank td:nth-child(2) { white-space: normal; }
.pname { display: block; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.rank td:nth-child(2) { min-width: 8em; }
.add-msg { font-size: 0.85rem; font-weight: 700; min-height: 1.3em; margin: 8px 0 0; }

/* 画面の下に固定した合計（カバンの枠が画面の外でも、入れた結果が見える） */
.mini { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); background: var(--paper); color: var(--ink); border-top: 2.5px solid var(--ink); text-decoration: none; }
.mini-msg { font-size: 0.78rem; line-height: 1.35; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-total { white-space: nowrap; font-size: 0.85rem; }
.mini-total strong { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
body:has(.mini) .site-footer { padding-bottom: 72px; }
.pmeta { display: inline-block; font-size: 0.75rem; line-height: 1.4; }
.rank .src { font-size: 0.75rem; white-space: nowrap; }
.rank .date { font-size: 0.7rem; }
.rank tbody tr:first-child td { border-top-width: 2px; }
.summary { border: 1.5px solid var(--ink); padding: 8px 10px; }
.sources { padding-left: 1.2em; font-size: 0.85rem; }
.sources li { margin-bottom: 10px; overflow-wrap: anywhere; }
.note { font-size: 0.85rem; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; list-style: none; }
.cats a { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--ink); padding: 8px 10px; text-decoration: none; font-weight: 700; min-height: 44px; }
