:root {
	--accent: #ff6b35;
	--accent-dark: #e05828;
	--bg: #f4f5f7;
	--card: #fff;
	--text: #222;
	--muted: #666;
	--line: #ddd;
	--err: #c62828;
	--ok: #2e7d32;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", sans-serif; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
a { color: var(--accent-dark); }

.top { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 17px; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-left: auto; font-size: 14px; align-items: center; }
.nav a { text-decoration: none; }
.who { color: var(--muted); }

.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: 12px; padding: 20px 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card.narrow { max-width: 420px; margin: 40px auto; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
h3 { font-size: 16px; margin: 20px 0 8px; }
.sec { margin-bottom: 24px; }
.note { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.note.small { font-size: 13px; text-align: center; }
.req { font-size: 12px; color: #fff; background: var(--err); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; font-weight: normal; }
.err { color: var(--err); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }

.form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 15px; }
.form input[type=text], .form input:not([type]), .form input[type=number], .form input[type=password], .form select, .form textarea {
	display: block; width: 100%; margin-top: 4px; padding: 12px; font-size: 16px; border: 1px solid #bbb; border-radius: 8px; background: #fff; font-weight: normal;
}
.form textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.ranks .rank { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-weight: normal; cursor: pointer; }
.ranks .rank:has(input:checked) { border-color: var(--accent); background: #fff5f0; }
.rank-k { font-weight: 700; font-size: 20px; color: var(--accent-dark); width: 24px; text-align: center; }
.rank-d { font-size: 14px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; margin: 0 16px 6px 0; font-weight: normal; }
.checks input, .ranks input { width: 20px; height: 20px; }

.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; border: 1px solid #bbb; background: #fff; color: var(--text); font-size: 15px; text-decoration: none; cursor: pointer; font-family: inherit; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.big { width: 100%; padding: 16px; font-size: 18px; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.bulk { margin: 0 0 12px; }

.slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .slots { grid-template-columns: repeat(5, 1fr); } }
.slot { position: relative; }
.tile { position: relative; display: block; width: 100%; aspect-ratio: 1; border: 2px dashed #bbb; border-radius: 10px; background: #fafafa; padding: 0; cursor: pointer; overflow: hidden; font-family: inherit; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-num { position: absolute; top: 4px; left: 6px; font-size: 12px; color: #fff; background: rgba(0,0,0,.55); border-radius: 10px; padding: 0 7px; z-index: 2; }
.tile-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 4px; font-size: 13px; font-weight: 600; color: var(--text); background: rgba(255,255,255,.85); z-index: 2; line-height: 1.2; }
.tile-label small { display: block; font-weight: normal; color: var(--muted); font-size: 11px; }
.slot.filled .tile { border-style: solid; border-color: var(--ok); }
.slot.busy .tile { opacity: .6; }
.tile-clear { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--err); color: #fff; font-size: 16px; line-height: 26px; padding: 0; cursor: pointer; z-index: 3; }
#extra-slots .tile-label { font-size: 11px; }

.progress { position: relative; height: 32px; background: #eee; border-radius: 8px; overflow: hidden; margin: 12px 0; }
.progress .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); transition: width .2s; }
.progress .ptext { position: relative; display: block; text-align: center; line-height: 32px; font-size: 14px; font-weight: 600; }

.tablewrap { overflow-x: auto; }
.table { border-collapse: collapse; width: 100%; font-size: 14px; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; white-space: nowrap; }
.table td.num { text-align: right; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; color: #fff; background: #888; }
.tag.draft { background: #888; }
.tag.live { background: var(--ok); }
.tag.sold { background: #1565c0; }
.tag.ng { background: var(--err); }
.ops { white-space: normal !important; }
.inline { display: inline-flex; gap: 4px; align-items: center; margin: 2px 6px 2px 0; }
.inline input.small { padding: 5px 8px; font-size: 13px; width: 130px; border: 1px solid #bbb; border-radius: 6px; }

/* 横長枠（側面・上下面）のタイル */
.slot--wide .tile { aspect-ratio: 12 / 7; }

/* 写真の位置・大きさ調整 */
.editor { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 12px; }
.editor-box { background: #fff; border-radius: 12px; padding: 16px; width: 100%; max-width: 520px; max-height: 100%; overflow: auto; }
.editor-title { margin: 0 0 4px; font-weight: 700; font-size: 16px; }
.editor-help { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
/* stage = 写真全体が見える領域（暗い）。frame = HPに載る範囲（明るい枠） */
.editor-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: #111; border-radius: 8px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.editor-stage.wide { aspect-ratio: 4 / 3; }
.editor-stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; pointer-events: none; }
.editor-frame { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 80%; aspect-ratio: 1; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0,0,0,.6); outline: 3px solid var(--accent); border-radius: 4px; }
.editor-stage.wide .editor-frame { width: 86%; aspect-ratio: 12 / 7; }
.editor-frame-tag { position: absolute; left: 0; top: 0; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 0 0 6px 0; white-space: nowrap; }
.editor-zoom { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.editor-zoom input[type=range] { flex: 1; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.editor-actions .primary { min-width: 100px; }

/* 商品ページでの見え方（合成後のプレビュー） */
.preview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .preview { grid-template-columns: repeat(5, 1fr); } }
.pv { text-align: center; font-size: 13px; font-weight: 600; }
.pv-box { display: grid; gap: 3px; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 1; margin-bottom: 4px; }
.pv-box.pv-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pv-box.pv-2 { grid-template-rows: 1fr 1fr; }
.pv-box .pv-cell { position: relative; background: #f0f0f0; overflow: hidden; cursor: pointer; }
.pv-box .pv-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-box .pv-cell.empty::after { content: "未"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 14px; }
.pv-extras { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.pv-extras .pv-box { aspect-ratio: 1; }

/* 買取ブログ */
.rank-k--wide { width: auto; min-width: 5.5em; font-size: 15px; text-align: left; }
.kphoto { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.kphoto-title { font-weight: 700; margin: 0 0 6px; }
.note-inline { font-size: 13px; color: var(--muted); font-weight: normal; margin-left: 6px; }
.kthumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 10px; }
.kthumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 2px solid var(--ok); }
.kthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kthumb .tile-clear { top: 4px; right: 4px; }
