/* IMGBOX 共通スタイル（白基調・グレー系・カード型。グラデーション・アニメーションは使わない） */
:root { --brand: #1F3A5F; }
html.fs-s { font-size: 14px; }
html.fs-m { font-size: 16px; }
html.fs-l { font-size: 18px; }
body { font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, system-ui, sans-serif; }

.brand-mark { display: inline-block; width: .9rem; height: .9rem; border-radius: 2px; background: var(--brand); }

.card { background: #fff; border: 1px solid #E3E6EA; border-radius: 8px; }
.label { display: block; font-size: .875rem; font-weight: 600; color: #334155; margin-bottom: .375rem; }
.help { font-size: .75rem; color: #64748b; margin-top: .375rem; }
.input { display: block; width: 100%; border: 1px solid #CBD2D9; border-radius: 6px; padding: .55rem .75rem; background: #fff; color: #1F2933; }
.input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .375rem; border-radius: 6px; padding: .55rem 1rem; font-size: .875rem; font-weight: 600; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.12); }
.btn-secondary { background: #fff; color: #1F2933; border-color: #CBD2D9; }
.btn-secondary:hover:not(:disabled) { background: #F7F8FA; }
.btn-ghost { background: transparent; color: #475569; padding: .4rem .6rem; }
.btn-ghost:hover { background: #F1F5F9; }
.btn-danger { background: #B42318; color: #fff; }

.nav-link { padding: .45rem .75rem; border-radius: 6px; color: #475569; text-decoration: none; }
.nav-link:hover { background: #F1F5F9; color: #0f172a; }
.nav-link.is-active { color: var(--brand); font-weight: 600; background: #F1F5F9; }

.fs-btn { min-width: 1.9rem; padding: .2rem .4rem; border: 1px solid #CBD2D9; border-radius: 4px; background: #fff; color: #475569; font-size: .8rem; cursor: pointer; }
.fs-btn.is-active { border-color: var(--brand); color: var(--brand); font-weight: 600; }

.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid #E3E6EA; }
.tab { padding: .6rem 1rem; color: #475569; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .9rem; }
.tab:hover { color: #0f172a; }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.alert { border: 1px solid; border-radius: 6px; padding: .75rem 1rem; font-size: .875rem; line-height: 1.6; }
.alert-info { background: #F1F5F9; border-color: #CBD5E1; color: #1e293b; }
.alert-success { background: #F0FDF4; border-color: #BBF7D0; color: #14532d; }
.alert-warning { background: #FFFBEB; border-color: #FDE68A; color: #78350f; }
.alert-error { background: #FEF2F2; border-color: #FECACA; color: #7f1d1d; }

.badge { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.badge-ok { background: #F0FDF4; border-color: #BBF7D0; color: #166534; }
.badge-warning { background: #FFFBEB; border-color: #FDE68A; color: #92400e; }
.badge-error { background: #FEF2F2; border-color: #FECACA; color: #991b1b; }
.badge-info { background: #F8FAFC; border-color: #E2E8F0; color: #475569; }

.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { white-space: nowrap; text-align: left; font-weight: 600; color: #475569; background: #F7F8FA; padding: .6rem 1rem; border-bottom: 1px solid #E3E6EA; }
.table td { padding: .6rem 1rem; border-bottom: 1px solid #EEF0F3; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }

.stat-label { font-size: .75rem; color: #64748b; }
.stat-value { font-size: 1.25rem; font-weight: 600; color: #0f172a; margin-top: .25rem; }


.thumb-box { position: relative; aspect-ratio: 1 / 1; background: #F1F3F5; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb-box img { width: 100%; height: 100%; object-fit: cover; }
.thumb-tag { position: absolute; right: .375rem; bottom: .375rem; background: rgba(15, 23, 42, .75); color: #fff; font-size: .7rem; padding: .05rem .4rem; border-radius: 3px; }
.progress { height: 4px; background: #EEF0F3; border-radius: 2px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--brand); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* 撮影スロット */
.slot-photo { aspect-ratio: 4 / 3; background: #F1F3F5; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.slot-photo a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.slot-photo img { width: 100%; height: 100%; object-fit: contain; }

/* メディア選択ダイアログ */
.picker { margin: auto; width: min(760px, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); padding: 0; border: 1px solid #CBD2D9; border-radius: 8px; }
.picker::backdrop { background: rgba(15, 23, 42, .45); }
.picker-item { text-align: left; border: 1px solid #E3E6EA; border-radius: 6px; padding: .25rem; background: #fff; cursor: pointer; min-width: 0; }
.picker-item:hover { border-color: var(--brand); }

/* 表示切替（セグメント） */
.segmented { display: inline-flex; border: 1px solid #CBD2D9; border-radius: 6px; overflow: hidden; }
.segmented button { padding: .45rem .9rem; font-size: .875rem; color: #475569; background: #fff; border-left: 1px solid #CBD2D9; cursor: pointer; }
.segmented button:first-child { border-left: 0; }
.segmented button.is-active { background: var(--brand); color: #fff; font-weight: 600; }

/* 前後比較 */
.compare-view.mode-side { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 640px) { .compare-view.mode-side { grid-template-columns: 1fr; } }
.stage { position: relative; width: 100%; margin: 0 auto; overflow: hidden; background: #F1F3F5; border-radius: 6px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.stage[hidden] { display: none; }
.stage .layer { position: absolute; inset: 0; transform-origin: center center; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: center center; pointer-events: none; }
.stage .tag { position: absolute; left: .5rem; top: .5rem; background: rgba(15, 23, 42, .72); color: #fff; font-size: .75rem; padding: .1rem .5rem; border-radius: 3px; pointer-events: none; }
.stage .tag-right { left: auto; right: .5rem; }
.stage .divider { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .35); cursor: ew-resize; pointer-events: none; }
.stage .divider span { position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }

input[type="range"], input[type="checkbox"] { accent-color: var(--brand); }

/* 代表フレームの候補 */
.frame-cand.is-adopted { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
#frame-dialog { width: min(920px, calc(100vw - 2rem)); }
