/*
 * 管理画面の共通スタイル。
 *
 * CDN や外部フォントは読み込まない。管理画面は業務が止まると困る画面なので、
 * 外部サービスの障害やネットワーク制限で表示が崩れる要因を持ち込まない。
 *
 * 形・大きさ・部品は在庫の管理画面 (tcg_core の apps/admin) に揃え、色だけ変える
 * (どちらの画面か一目で分かるように。在庫は青、オリパは紫):
 * - 地は少し紫がかった灰、面は白。罫線も紫みのあるグレー
 * - 本文は白地で 12:1 前後。純黒ほど強くせず、補足の文字も 4.5:1 を下回らせない
 * - 主色は紫。主ボタンだけ薄紫 → 紫のグラデーションにする (一番押してほしいもの)
 *
 * 状態色は主色と色相を離す。注意 (黄・橙)・削除 (赤)・成功 (緑)・お知らせ (青)。
 * 色を変える時はここだけ直す (部品は必ずトークン経由で色を取る)。
 * ブロックの編集 (--bk-*)・アプリの画面を模したプレビュー・グラフの色は、それぞれの所に持つ。
 */

:root {
	/* 入力欄1つ分の高さ (行の高さ + 上下の余白 + 罫線)。
	   隣に並べる要素を揃えるのに使う。文字の大きさが違う要素でも
	   同じ値になるよう、em ではなく本文の 14px から出す */
	--input-height: calc(1.6 * 14px + 20px);

	/* 面 */
	/* 地は紫をごく薄く混ぜた灰色。長く見ても目が疲れないよう、彩度を落としてある */
	--bg: #f3f2f6;
	--surface: #ffffff;
	--surface-muted: #f8f7fa;
	--border: #e1dfe8;
	--border-strong: #cbc7d6;

	/* 文字。紫みをほぼ抜いた墨。白地で 本文 13.5:1 / 補足 8.4:1 / 薄い補足 5.8:1 (地の上でも 5.2:1) */
	--text: #2f2d38;
	--text-muted: #4f4b5e;
	--text-subtle: #66627a;
	--text-on-accent: #ffffff;

	/* 主色。蛍光寄りの紫 (#6f4cff) をやめ、落ち着いた紫にする (白い文字で 5.8:1) */
	--accent: #6d50c8;
	--accent-hover: #5a3fb0;
	/* 文字に使う主色 (白地で 8.0:1、薄い地の上でも 6.9:1) */
	--accent-text: #563ab0;
	--accent-soft: #f0edf8;
	--accent-border: #d6cdef;
	/* 白い文字が読めるよう、明るい側も濃いめにする (明るい端で 4.3:1) */
	--accent-gradient: linear-gradient(90deg, #8466d6, #6d50c8);
	--accent-gradient-hover: linear-gradient(90deg, #7356c6, #5a3fb0);

	/* 状態 */
	--warning: #8a6300;
	--warning-soft: #fff8d6;
	--warning-border: #f2e29a;
	--caution: #b45309;
	--caution-soft: #fff4e5;
	--caution-border: #fbd38d;
	--danger: #c93652;
	--danger-soft: #fdeef1;
	--danger-border: #f3c3cd;
	--success: #1f7f55;
	--success-soft: #e9f8f0;
	--success-border: #bfe8d3;
	--info: #1f63d1;
	--info-soft: #e5f2ff;
	--info-border: #b8d6ff;

	/* 形。ボタンは丸 */
	--radius: 10px;
	--radius-lg: 14px;
	--radius-pill: 100px;
	--shadow-sm: 0 1px 2px rgba(47, 45, 56, 0.05);
	--shadow-md: 0 4px 14px rgba(47, 45, 56, 0.08);

	/*
	 * 文字の大きさの段。ここに無い大きさは使わない。
	 * 11px 未満は読みにくいので作らない。見出しは段を飛ばして、本文との差をはっきりさせる
	 * (アプリの画面を模したプレビューだけは、アプリと同じ大きさを直に書く)
	 */
	--fs-2xs: 11px; /* 札・必須の印など、ごく短い語だけ */
	--fs-xs: 12px; /* 補足・表の見出し */
	--fs-sm: 13px; /* 小さめの本文・入力の補足 */
	--fs-base: 14px; /* 本文 */
	--fs-md: 16px; /* 箱の見出し */
	--fs-lg: 18px; /* 区切りの見出し・強調する数字 */
	--fs-xl: 22px; /* 大きな数字・狭い画面のページの見出し */
	--fs-2xl: 26px; /* ページの見出し */

	--font-sans:
		"Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
		Meiryo, system-ui, sans-serif;
	--font-mono:
		ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: var(--fs-base);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
	margin: 0;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

p {
	margin: 0;
}

a {
	color: var(--accent-text);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* キーボード操作時だけリングを出す。マウス操作では出さない */
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ===== レイアウト ===== */

/* ===== サイドバー (左) と本文 ===== */

.app-layout {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	min-height: 100vh;
}

.app-sidebar {
	position: sticky;
	top: 0;
	display: flex;
	flex-direction: column;
	height: 100vh;
	padding: 16px 12px;
	overflow-y: auto;
	background: var(--surface);
	border-right: 1px solid var(--border);
}

.app-sidebar__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 2px 4px 20px 8px;
}

.app-sidebar__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: none;
	color: var(--text-muted);
	font: inherit;
	cursor: pointer;
	transition:
		background-color 0.12s ease,
		color 0.12s ease;
}

.app-sidebar__toggle:hover {
	background: var(--surface-muted);
	border-color: var(--border);
	color: var(--text);
}

.app-sidebar__toggle .nav-icon--expand,
.app-sidebar__toggle .nav-icon--menu,
.app-sidebar__toggle .nav-icon--close {
	display: none;
}

.app-sidebar__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: space-between;
	gap: 16px;
}

.app-brand {
	font-size: var(--fs-xl);
	font-weight: 700;
	color: var(--accent-text);
	letter-spacing: -0.02em;
	line-height: 1.2;
	white-space: nowrap;
}

.app-brand:hover {
	text-decoration: none;
}

.app-nav__group + .app-nav__group {
	margin-top: 18px;
}

.app-nav__heading {
	padding: 0 12px 6px;
	color: var(--text-subtle);
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
}

.app-nav__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.app-nav__list--footer {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--border);
}

.app-nav__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 12px;
	border-radius: var(--radius);
	color: var(--text-muted);
	font-weight: 500;
	white-space: nowrap;
	transition:
		background-color 0.12s ease,
		color 0.12s ease;
}

.app-nav__link .nav-icon {
	flex-shrink: 0;
	color: var(--text-subtle);
}

.app-nav__link:hover {
	background: var(--surface-muted);
	color: var(--text);
	text-decoration: none;
}

.app-nav__link:hover .nav-icon {
	color: var(--text-muted);
}

.app-nav__link[aria-current="page"] {
	background: var(--accent-soft);
	color: var(--accent-text);
}

.app-nav__link[aria-current="page"] .nav-icon {
	color: var(--accent-text);
}

.app-main {
	/* 格子の項目は既定で中身より狭くならない。表の幅に引っぱられないよう 0 まで縮める */
	min-width: 0;
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	padding: 32px 24px 64px;
}

/* 本番でない環境 (在庫を本物に繋いでいない) の帯。画面のいちばん上に横いっぱい。在庫は見るだけ */
.release-banner {
	position: sticky;
	top: 0;
	z-index: 50;
	box-sizing: border-box;
	height: var(--release-banner-h);
	line-height: calc(var(--release-banner-h) - 1px);
	padding: 0 16px;
	border-bottom: 1px solid var(--warning-border);
	background: var(--warning-soft);
	color: var(--warning);
	font-size: var(--fs-sm);
	font-weight: 600;
	text-align: center;
}

/* 帯がある時は、横のメニュー (上に貼り付く) を帯の下から始める */
:root {
	--release-banner-h: 32px;
}
body:has(.release-banner) .app-sidebar {
	top: var(--release-banner-h);
	height: calc(100vh - var(--release-banner-h));
}

/* フラッシュが無い時は FlashBanner が何も描かないので、余白も出ない */
.app-main__flash {
	margin-bottom: 24px;
}

.page-header {
	margin-bottom: 28px;
}

.page-header__title {
	font-size: var(--fs-2xl);
	font-weight: 700;
	letter-spacing: -0.02em;
}

.page-header__description {
	margin-top: 6px;
	color: var(--text-muted);
	line-height: 1.7;
}

/* 見出しの右にボタンを置く (「オリパを作る」「素材を追加」) */
.page-header--actions {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

/* ===== アカウントメニュー ===== */

.account-menu {
	position: relative;
	flex-shrink: 0;
}

.account-menu__trigger {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 8px;
	border-radius: var(--radius);
	color: var(--text-muted);
	cursor: pointer;
	list-style: none;
	transition: background-color 0.12s ease;
}

/* Safari 用。list-style だけでは三角マーカーが消えない */
.account-menu__trigger::-webkit-details-marker {
	display: none;
}

.account-menu__trigger:hover {
	background: var(--surface-muted);
}

.account-menu__avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--accent-soft);
	color: var(--accent-text);
	font-size: var(--fs-2xs);
	font-weight: 600;
}

.account-menu__name {
	max-width: 160px;
	overflow: hidden;
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* サイドバーの下に置くので、上に開く。サイドバーは縦に流す (overflow) ので、
   はみ出すと切れる。広げた時はサイドバーの幅に収める */
.account-menu__panel {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 50;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
}

.account-menu__identity {
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
}

.account-menu__email {
	overflow: hidden;
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.account-menu__role {
	margin-top: 2px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.account-menu__action {
	display: block;
	width: 100%;
	padding: 10px 14px;
	border: 0;
	background: none;
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.account-menu__action:hover {
	background: var(--surface-muted);
	text-decoration: none;
}

/* ===== サイドバーの開け閉め (アカウントメニューの後に置く。畳んだ時の指定を後から効かせる) ===== */

/* 狭い画面: サイドバーを上の帯にして、項目は「メニュー」で開く */
@media (max-width: 800px) {
	/* 1fr だと、中の表の最小の幅に引っぱられて画面ごと横に広がる */
	.app-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.app-sidebar {
		position: static;
		height: auto;
		padding: 12px 16px;
		overflow: visible;
		border-right: 0;
		border-bottom: 1px solid var(--border);
	}

	.app-sidebar__top {
		padding: 0;
	}

	.app-brand {
		font-size: var(--fs-lg);
	}

	/* 狭い画面は三本線のボタン。開いている間は × にする */
	.app-sidebar__toggle {
		width: 40px;
		height: 40px;
	}

	.app-sidebar__toggle .nav-icon {
		width: 22px;
		height: 22px;
	}

	.app-sidebar__toggle .nav-icon--collapse {
		display: none;
	}

	.app-sidebar:not(.is-open) .app-sidebar__toggle .nav-icon--menu,
	.app-sidebar.is-open .app-sidebar__toggle .nav-icon--close {
		display: block;
	}

	.app-sidebar__body {
		display: none;
		padding-top: 12px;
	}

	.app-sidebar.is-open .app-sidebar__body {
		display: flex;
	}
}

/* 広い画面で畳んだ時: 印だけの細い帯にする (名前は title で出る) */
@media (min-width: 801px) {
	.sidebar-collapsed .app-layout {
		grid-template-columns: 64px minmax(0, 1fr);
	}

	.sidebar-collapsed .app-sidebar {
		padding-inline: 10px;
	}

	.sidebar-collapsed .app-sidebar__top {
		justify-content: center;
		padding: 2px 0 20px;
	}

	.sidebar-collapsed .app-brand,
	.sidebar-collapsed .app-nav__heading,
	.sidebar-collapsed .app-nav__label,
	.sidebar-collapsed .account-menu__name {
		display: none;
	}

	.sidebar-collapsed .app-sidebar__toggle .nav-icon--collapse {
		display: none;
	}

	.sidebar-collapsed .app-sidebar__toggle .nav-icon--expand {
		display: block;
	}

	.sidebar-collapsed .app-nav__group + .app-nav__group {
		margin-top: 10px;
		padding-top: 10px;
		border-top: 1px solid var(--border);
	}

	.sidebar-collapsed .app-nav__link {
		justify-content: center;
		padding: 9px 0;
	}

	.sidebar-collapsed .account-menu__trigger {
		justify-content: center;
	}

	/* 細い帯の時は、メニューを帯の外まで出す (項目は印だけで短いので、縦に流さなくてよい) */
	.sidebar-collapsed .app-sidebar {
		overflow: visible;
	}

	.sidebar-collapsed .account-menu__panel {
		right: auto;
		width: 240px;
	}
}

/* ===== パネル ===== */

/*
 * overflow: hidden が要る。これが無いと、テーブルの thead が持つ背景色が
 * パネルの角丸を無視して塗られ、左上と右上の角が欠けて見える。
 */
.panel {
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
}

/* 開いたカレンダーはパネルの外まで出す (パネルの下の方の欄で切れないように) */
.panel:has(.calendar:not([hidden])),
.panel:has(.multi-select[open]) {
	overflow: visible;
}

.panel__header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--border);
}

.panel__title {
	font-size: var(--fs-md);
	font-weight: 600;
}

.panel__body {
	padding: 20px;
}

.panel__body--flush {
	padding: 0;
}

/* ===== 定義リスト (詳細表示) ===== */

.detail-list {
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: 12px 20px;
	margin: 0;
}

.detail-list dt {
	color: var(--text-muted);
}

.detail-list dd {
	margin: 0;
}

@media (max-width: 600px) {
	.detail-list {
		grid-template-columns: 1fr;
		gap: 2px 0;
	}

	.detail-list dd {
		margin-bottom: 12px;
	}
}

/* ===== テーブル ===== */

/* position は、中の読み上げ用の文字 (visually-hidden) を枠の中に留めるため */
.data-table__scroll {
	position: relative;
	overflow-x: auto;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
	white-space: nowrap;
}

.data-table th,
.data-table td {
	padding: 10px 16px;
	text-align: left;
}

.data-table thead th {
	background: var(--surface-muted);
	border-bottom: 1px solid var(--border);
	color: var(--text-muted);
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.02em;
}

.data-table tbody tr + tr td {
	border-top: 1px solid var(--border);
}

.data-table tbody tr:hover td {
	background: var(--surface-muted);
}

.data-table__strong {
	font-weight: 500;
}

/* 名前の後ろに付ける印。名前とくっつくと 1 つの語に見える */
.cell-name__tag {
	margin-left: 8px;
}

.data-table__muted {
	color: var(--text-muted);
}

/* .data-table td より詳細度を上げる。クラス単独だと要素セレクタ付きの
   左寄せ指定に負けて、ボタン以外 (「—」など) が左に残る */
.data-table td.data-table__actions {
	text-align: right;
}

.data-table__actions form {
	display: flex;
	justify-content: flex-end;
}

/* 行を押すと詳細へ移る表 (components/row-link.tsx の script が tr[data-href] を見る) */
.data-table tr[data-href] {
	cursor: pointer;
}

.data-table__empty {
	padding: 40px 16px;
	color: var(--text-muted);
	text-align: center;
}

/* ===== フォーム ===== */

.form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.field__label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
}

.field__required {
	margin-left: 8px;
	color: var(--danger);
	font-size: var(--fs-xs);
}

/* 見出しに付ける必須。見出しの大きさに引きずられないよう小さく戻す */
.panel__title .field__required {
	font-size: var(--fs-2xs);
	font-weight: 500;
}

/* 任意の欄の印 (必須の印と並ぶ位置・大きさ) */
.field__optional {
	margin-left: 8px;
	color: var(--text-subtle);
	font-size: var(--fs-xs);
}

.field__input {
	display: block;
	width: 100%;
	padding: 9px 12px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	color: var(--text);
	font: inherit;
	transition:
		border-color 0.12s ease,
		box-shadow 0.12s ease;
}

/*
 * プルダウンは行の高さを継がないので、入力欄より 6px ほど低くなる。
 * 隣に並べた時に段差に見えるので、入力欄 1 つ分の高さに揃える
 */
select.field__input {
	height: var(--input-height);
	line-height: 1.6;
}

.field__input::placeholder {
	color: var(--text-subtle);
}

.field__input:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
	outline: none;
}

.field__input--invalid {
	border-color: var(--danger);
}

.field__input--invalid:focus {
	border-color: var(--danger);
	box-shadow: 0 0 0 3px var(--danger-soft);
}

.field__hint {
	margin-top: 6px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.field__error {
	margin-top: 6px;
	color: var(--danger);
	font-size: var(--fs-xs);
}

/* ===== ボタン ===== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 18px;
	border: 1px solid transparent;
	border-radius: var(--radius-pill);
	font: inherit;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background-color 0.12s ease,
		border-color 0.12s ease;
}

.btn:hover {
	text-decoration: none;
}

/* 一番押してほしいボタン。薄紫 → 紫のグラデーション。
   **background-clip を padding-box にすること。** 既定 (border-box) だと
   1px の透明な枠の下までグラデーションが伸び、角の丸みで枠が重なって滲む */
.btn--primary {
	background: var(--accent-gradient) padding-box;
	color: var(--text-on-accent);
	box-shadow: var(--shadow-md);
}

.btn--primary:hover {
	background: var(--accent-gradient-hover) padding-box;
}

.btn--secondary {
	background: var(--surface);
	border-color: var(--border-strong);
	color: var(--text);
}

.btn--secondary:hover {
	background: var(--surface-muted);
}

.btn--danger {
	background: var(--danger);
	color: var(--text-on-accent);
}

.btn--block {
	width: 100%;
}

.btn--sm {
	padding: 4px 10px;
	font-size: var(--fs-xs);
}

/* 一覧の中の破壊的操作。塗りつぶしの赤は行が並ぶと目に刺さる */
.btn--danger-outline {
	background: var(--surface);
	border-color: var(--danger-border);
	color: var(--danger);
}

.btn:disabled,
.btn:disabled:hover {
	opacity: 0.4;
	cursor: not-allowed;
}

.btn--danger-outline:hover {
	background: var(--danger-soft);
}

/* ===== フラッシュ / バナー ===== */

.flash {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.flash__item,
.form-error {
	/* 周りのパネル (16px) に近い余白にする。詰めると帯が細く見えて、
	   読ませたい文なのに視線が素通りする */
	padding: 14px 16px;
	border: 1px solid;
	border-radius: var(--radius);
	line-height: 1.6;
	/* サービス側のメッセージは改行を含むことがある */
	white-space: pre-wrap;
}

.flash__item--success {
	background: var(--success-soft);
	border-color: var(--success-border);
	color: var(--success);
}

.flash__item--error,
.form-error {
	background: var(--danger-soft);
	border-color: var(--danger-border);
	color: var(--danger);
}

.form-error__text {
	margin: 0;
}

.form-error__list {
	margin: 6px 0 0;
	padding-left: 1.4em;
}

.flash__item--info {
	background: var(--info-soft);
	border-color: var(--info-border);
	color: var(--info);
}

/* ===== バッジ ===== */

.badge {
	display: inline-block;
	padding: 2px 8px;
	border: 1px solid var(--accent-border);
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent-text);
	font-size: var(--fs-xs);
	font-weight: 500;
}

/* ===== ログイン画面 ===== */

.auth {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 48px 16px;
}

.auth__stack {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	max-width: 380px;
}

.auth__card {
	padding: 28px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
}

.auth__title {
	font-size: var(--fs-xl);
	font-weight: 700;
}

.auth__description {
	margin-top: 4px;
	margin-bottom: 24px;
	color: var(--text-muted);
}

.auth__note {
	margin-top: 24px;
	max-width: 380px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
	text-align: center;
}

/* ===== エラーページ ===== */

.error-page {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 24px;
	text-align: center;
}

.error-page__status {
	color: var(--accent-text);
	/* 大きな数字として見せる。段の外の大きさをここだけ直に書く */
	font-size: 56px;
	font-weight: 700;
	line-height: 1;
}

.error-page__title {
	margin-top: 16px;
	font-size: var(--fs-xl);
}

.error-page__description {
	margin-top: 10px;
	color: var(--text-muted);
	white-space: pre-wrap;
}

.error-page__action {
	margin-top: 28px;
}

/*
 * ユーザーが OS 側でアニメーション低減を設定している場合は動かさない。
 *
 * !important はここでは意図的。利用者のアクセシビリティ設定は、
 * 個別のセレクタが後から付ける transition より必ず優先されなければならない。
 */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		/* biome-ignore-start lint/complexity/noImportantStyles: 利用者のアクセシビリティ設定を必ず優先させるため */
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		/* biome-ignore-end lint/complexity/noImportantStyles: 利用者のアクセシビリティ設定を必ず優先させるため */
	}
}

/* ===== 設定画面のタブ ===== */

.settings-nav {
	display: flex;
	gap: 4px;
	margin-bottom: 20px;
	overflow-x: auto;
	border-bottom: 1px solid var(--border);
	scrollbar-width: none;
}

.settings-nav__link {
	flex-shrink: 0;
	white-space: nowrap;
	padding: 8px 14px;
	border-bottom: 2px solid transparent;
	color: var(--text-muted);
	font-weight: 500;
}

.settings-nav__link:hover {
	color: var(--text);
	text-decoration: none;
}

.settings-nav__link[aria-current="page"] {
	border-bottom-color: var(--accent);
	color: var(--accent-text);
}

/* ===== 汎用 ===== */

.panel--spaced {
	margin-top: 20px;
}

.panel--danger {
	border-color: var(--danger-border);
}

.panel__title--danger {
	color: var(--danger);
}

.back-link {
	margin-bottom: 12px;
}

/* 編集画面の対象ユーザーの見出し */
.subject {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin-bottom: 20px;
}

.subject__name {
	font-size: var(--fs-xl);
	font-weight: 700;
}

.subject__meta {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

/* 操作できない理由の掲示 */
.notice {
	padding: 12px 16px;
	background: var(--surface-muted);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

/*
 * 説明とボタンを1行に並べる。説明の下にボタンを置くと、短い操作なのに
 * 縦に間延びして、カードごとにボタンの位置もばらつく。
 */
.action-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

/* 説明は横いっぱいまで使う (途中で改行しない)。ボタンは右に残す */
.action-row__text {
	flex: 1 1 320px;
}

.action-row form {
	flex-shrink: 0;
}

/* 送るボタンと「やめる」などを並べる (間を空ける) */
.form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 20px;
}

/*
 * フォーム主体の画面用。全幅だと入力欄が1200px近くまで伸び、
 * 説明文も1行が長くなって読み返しづらい。
 */
.stack--narrow {
	max-width: 768px;
}

.radio-group {
	margin-top: 16px;
}

/* 画面幅が足りない時は素直に縦に積む */
/*
 * align-items は既定の stretch のままにする。start を指定すると各カードが
 * 中身の分だけの高さになり、入力欄の数が違う左右でカードの下端がずれる。
 */
.two-column {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
	gap: 20px;
}

/* 発行フォームのように、項目が少なく横に並べたいフォーム */
.form--inline {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
}

.form--inline .field {
	flex: 1 1 220px;
}

/* 選択肢が短い項目まで引き伸ばさない */
.form--inline .field--auto {
	flex: 0 0 auto;
}

.form--inline .field--auto .field__input {
	width: auto;
}

.btn-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--danger);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* 消す・外す以外の操作のリンク (赤くしない) */
.btn-link--accent {
	color: var(--accent-text);
}

/* ===== タグ (表内の小さなラベル) ===== */

/* badge より控えめ。セルの文字に寄り添わせるので角丸も余白も小さく取る */
.tag {
	display: inline-block;
	padding: 2px 6px;
	border-radius: 4px;
	/* 行の白地に乗るので --surface-muted では沈んで見えない */
	background: var(--accent-soft);
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	font-weight: 500;
	line-height: 1.4;
	white-space: nowrap;
}

/*
 * 本文とタグを並べるセル。
 * margin と vertical-align で寄せると、文字サイズが違う分だけ上下にずれる。
 * flex の中央揃えなら、タグの高さが変わっても常に中心が揃う。
 */
.cell-inline {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.tag--warning {
	background: var(--warning-soft);
	color: var(--warning);
}

/* 止めたものなど。あることは見せるが目立たせない */
.tag--muted {
	background: var(--surface-muted);
	color: var(--text-subtle);
	border: 1px dashed var(--border-strong);
}

.tag--success {
	background: var(--success-soft);
	color: var(--success);
}

/* ===== 補足文 ===== */

.panel__note {
	margin-top: 4px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.panel__note--warning {
	color: var(--warning);
}

/* 横並びの行の中では、見出しとの間を詰める */
.action-row .panel__note {
	margin-top: 2px;
}

/* 見出し・補足の直後に来るフォームは少し離す */
.panel__note + .form,
.panel__note + form,
.panel__note + .form-error,
.panel__note + .field__error {
	margin-top: 16px;
}

/* 1行レイアウトの中では余白を詰める (行の高さがボタンに引っ張られるため) */
.action-row .panel__note + .form {
	margin-top: 0;
}

/* 変更できない項目。入力欄と同じ形にして位置を揃えつつ、
   触れないことが分かるよう背景を落とす */
.field__readonly {
	padding: 9px 12px;
	background: var(--surface-muted);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	/* 本文と同じ色にする。薄くするとプレースホルダーと区別が付かない */
	color: var(--text);
}

.me__notice {
	margin-bottom: 20px;
}

/* ===== ラジオグループ ===== */

.fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}

.radio {
	display: flex;
	gap: 10px;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
}

.radio + .radio {
	margin-top: 8px;
}

.radio:hover {
	background: var(--surface-muted);
}

/* 権限が足りずに選べない選択肢。押せることを期待させない */
.radio--disabled {
	background: var(--surface-muted);
	color: var(--text-subtle);
	cursor: not-allowed;
}

.radio--disabled:hover {
	background: var(--surface-muted);
}

.radio__label {
	display: block;
	font-weight: 500;
}

.radio__description {
	display: block;
	margin-top: 2px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

/* ===== ページ送り ===== */

/* テーブルと同じカードの中に、区切り線付きの帯として置く */
.pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-top: 1px solid var(--border);
}

.pagination--top {
	border-top: 0;
	border-bottom: 1px solid var(--border);
}

.pagination__summary,
.pagination__position {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.pagination__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pagination__link {
	padding: 5px 12px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	color: var(--text);
	font-size: var(--fs-xs);
	font-weight: 500;
}

.pagination__link:hover {
	background: var(--surface-muted);
	text-decoration: none;
}

.pagination__link--disabled {
	border-color: var(--border);
	color: var(--text-subtle);
	cursor: not-allowed;
}

.pagination__link--disabled:hover {
	background: none;
}

/* ===== 一覧の作り (在庫と同じ: 絞り込みの帯 → 件数 → タブ → 表) ===== */

/* 一覧の上に置く GET のフォーム。狭い幅では折り返す */
.filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
}

.filter-bar__item {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.filter-bar__item--grow {
	flex: 1 1 16rem;
}

.filter-bar__item--grow .field__input {
	width: 100%;
}

/* 下限〜上限の 2 つの欄 */
.filter-bar__range .field__input {
	width: 8rem;
}

.filter-bar__label {
	color: var(--text-muted);
	font-size: var(--fs-xs);
	white-space: nowrap;
}

.filter-bar .field {
	margin: 0;
}

/* 絞り込みの帯の中の入力は 1 段小さく */
.filter-bar .field__input {
	height: calc(1.6 * 13px + 14px);
	padding-top: 6px;
	padding-bottom: 6px;
	font-size: var(--fs-sm);
}

.filter-bar__actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* 一覧のリンクから来た絞り込み (1 人のユーザーだけ など) の断り書き */
.filter-bar__active {
	padding: 8px 16px;
	border-bottom: 1px solid var(--border);
	background: var(--surface-muted);
	font-size: var(--fs-sm);
}

.filter-bar__clear {
	color: var(--text-muted);
	font-size: var(--fs-xs);
	text-decoration: underline;
}

/* 条件に合う件数・合計 */
.list-total {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 20px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	font-size: var(--fs-sm);
}

.list-total__label {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.list-total__value {
	margin-left: 6px;
	font-size: var(--fs-md);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.list-total__note {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

/* 表の上のタブ。リンクなので URL に残り、戻っても同じタブ */
.tab-bar {
	display: flex;
	gap: 4px;
	padding: 0 12px;
	/*
	 * 下の線は border でなく内側の影で描く。border だとタブの下線を線に重ねる時に
	 * タブが帯の外 (border の所) へはみ出し、縦のスクロールバーが出る。影は中身の下に描かれるので、
	 * タブの下線がそのまま線の上に乗る
	 */
	box-shadow: inset 0 -1px 0 var(--border);
	/* 狭い画面では横に送れるが、バーは出さない (「スクロールバーが常に出る」設定でも帯が太らない) */
	overflow-x: auto;
	scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
	display: none;
}

.tab-bar__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 12px 10px 10px;
	border-bottom: 2px solid transparent;
	color: var(--text-muted);
	font-size: var(--fs-sm);
	text-decoration: none;
	white-space: nowrap;
}

.tab-bar__item:hover {
	color: var(--text);
	text-decoration: none;
}

.tab-bar__item[aria-current="page"] {
	border-bottom-color: var(--accent);
	color: var(--accent-text);
	font-weight: 600;
}

.tab-bar__count {
	min-width: 20px;
	padding: 0 6px;
	border: 1px solid var(--border);
	border-radius: var(--radius-pill);
	background: var(--surface-muted);
	color: var(--text-subtle);
	font-size: var(--fs-2xs);
	font-weight: 500;
	text-align: center;
}

.tab-bar__item[aria-current="page"] .tab-bar__count {
	border-color: var(--accent-border);
	background: var(--accent-soft);
	color: var(--accent-text);
}

/* タブと、右のボタン (「作る」など) を 1 行に */
.tab-bar-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	box-shadow: inset 0 -1px 0 var(--border);
}

/* 下の線は行が持つ (帯の影は消す)。タブは行の下端まで届くので、下線は行の線の上に乗る */
.tab-bar-row > .tab-bar {
	flex: 1 1 auto;
	align-self: stretch;
	min-width: 0;
	box-shadow: none;
}

.tab-bar-row__actions {
	margin-left: auto;
	padding: 6px 16px;
}

/* アカウントメニュー内のフォームは行として振る舞わせる */
.account-menu__form {
	border-top: 1px solid var(--border);
}

/*
 * hidden 属性は、クラス側で display を指定するとそちらが勝って
 * 出たままになる (「メンバーの権限」を役割で出し入れする所で使う)。
 * **隠したい時に hidden 以外の手を使わないこと** — ここが効かなくなる。
 */
[hidden] {
	/* biome-ignore lint/complexity/noImportantStyles: クラス側の display に勝つのが
	   目的なので、ここは !important でないと意味がない */
	display: none !important;
}

/* ===== 在庫の画面と同じ小さな部品 (表のセル・並べ替え・説明・数字・画像・吹き出し) ===== */

/* 数字の列。見出しも値も右に寄せ、桁をそろえる */
.cell-number {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* .data-table td の左寄せより詳細度を上げる。クラス単独だと負けて、
   値だけ左に残り見出し (右寄せ) とずれる */
.data-table th.cell-number,
.data-table td.cell-number {
	text-align: right;
}

.cell-thumb {
	/* 画像 (64px) + 左右の余白 */
	width: 96px;
}

/* セルの 2 行目 (識別子など)。1 行目より小さく、詰めて置く */
.cell-sub {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
	margin-top: 2px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
	white-space: normal;
}

/* 右寄せの列の 2 行目 */
.cell-sub--end {
	justify-content: flex-end;
	white-space: nowrap;
}

/* 見出しのリンクで並べ替える (components/sort-head.tsx。並べ替えはサーバーで行う) */
.sort-link {
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.sort-link:hover {
	text-decoration: underline;
}

.sort-link::after {
	content: "↕";
	display: inline-block;
	margin-left: 0.35em;
	opacity: 0.35;
	font-size: 0.8em;
}

.sort-link[data-sorted="asc"]::after {
	content: "↑";
	opacity: 1;
}

.sort-link[data-sorted="desc"]::after {
	content: "↓";
	opacity: 1;
}

/* 数字の札 (components/metric.tsx)。枠は幅に合わせて並ぶ。3 つ固定にしたい所は --3 */
.metric-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 10px;
	margin: 0;
}

.metric-grid--3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* スマホは 2 列 (1 列だと縦に長くなりすぎる) */
@media (max-width: 600px) {
	.metric-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* 狭い画面では 2 列 (1 列だと縦に長くなりすぎる) */
@media (max-width: 800px) {
	.metric-grid--3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.metric {
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface-muted);
}

.metric__label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.metric__value {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	margin: 2px 0 0;
	font-size: var(--fs-xl);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

/* 前の期間との差。良い悪いの色は付けない */
.metric__delta {
	flex-basis: 100%;
	color: var(--text-subtle);
	font-size: var(--fs-xs);
	font-weight: 500;
}

.metric__sub {
	margin: 2px 0 0;
	color: var(--text-subtle);
	font-size: var(--fs-2xs);
}

/* ===== 1 つのフォームを段に分ける ===== */

/*
 * **箱の中の箱は枠を持たせない。**
 *
 * 同じフォームの続きなので、背景は 1 枚のままにして、区切り線と余白で
 * 段を分ける。枠を重ねると、どこまでが 1 つの設定なのかが読めなくなる。
 * 左右の余白を打ち消して、区切り線は箱の幅いっぱいに引く
 */
.panel .panel {
	margin-right: -20px;
	margin-left: -20px;
	border: 0;
	border-top: 1px solid var(--border);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

/* 箱の先頭の段には区切り線を出さない (上に何も無い) */
.panel .panel:first-child {
	margin-top: 0;
	border-top: 0;
}

/*
 * 箱の中で続ける段の間。20px だと、直前の説明文と段の見出しが
 * ひと続きに読めてしまう (招待の画面で「メンバーの権限」が上の文にくっつく)
 */
.panel .panel--spaced {
	margin-top: 28px;
}

/* 段を並べるだけの箱 (フォーム 1 つ分)。中の段が左右の余白を打ち消すので、その分をこちらで持つ */
.panel--sections {
	padding: 0 20px;
}

/* 箱の底にボタンが貼り付かないようにする (段の余白と同じだけ空ける) */
.panel--sections > .form-actions {
	margin-bottom: 20px;
}

/* 入力欄を横に並べる。狭い幅では縦に積む */
.form--grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: 1rem;
}

/* 入力欄の並びの下に置く補足。4px だと欄にくっついて読めない */
.form + .panel__note,
.form--grid + .panel__note {
	margin-top: 10px;
}

/* 説明のすぐ下に表を置く時。詰めると説明と中身が地続きに見える */
.panel__note + .data-table__scroll {
	margin-top: 14px;
}

/* 表のセルの中に並べるタグ。役割の下に小さく出す */
.cell-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 4px;
}

/* ===== メンバーの権限 (機能 × 操作の表) ===== */

.permission-grid {
	min-width: 420px;
}

/* 2 行 (機能名と説明) が入る行。10px だと文字が枠に貼り付いて見える */
.data-table.permission-grid tbody tr td,
.data-table.permission-grid tbody tr th[scope="row"] {
	padding-top: 14px;
	padding-bottom: 14px;
}

.permission-grid__action,
.permission-grid__cell {
	width: 72px;
	text-align: center;
}

.permission-grid__cell input {
	width: 18px;
	height: 18px;
	margin: 0;
	vertical-align: middle;
	accent-color: var(--accent);
	cursor: pointer;
}

/* チェックボックスと同じ 18px の箱に入れ、行の中で高さと中心を揃える */
.permission-grid__none {
	display: inline-block;
	width: 18px;
	height: 18px;
	line-height: 18px;
	text-align: center;
	vertical-align: middle;
	color: var(--text-muted);
}

.permission-grid__feature {
	display: block;
	font-weight: 600;
}

.permission-grid__description {
	display: block;
	color: var(--text-subtle);
	font-size: var(--fs-xs);
	font-weight: 400;
}

/*
 * 機能名と説明の列は折り返す (表は既定で折り返さない)。
 * オリパの説明は選んだ段階で長さが変わるので、折り返さないと狭い画面で表がはみ出す
 */
.data-table.permission-grid tbody tr th[scope="row"] {
	white-space: normal;
}

/* ===== ヘルプの枠 (左の一覧と本文) ===== */

.manual {
	display: grid;
	grid-template-columns: 14rem 1fr;
	gap: 2rem;
	align-items: start;
}

@media (max-width: 760px) {
	.manual {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
}

.manual__nav {
	position: sticky;
	top: 1rem;
	padding: 0.75rem;
	border-radius: 8px;
	background: var(--surface);
	box-shadow: 0 1px 3px rgba(58, 68, 82, 0.08);
}

.manual__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.manual__link {
	display: block;
	padding: 0.4rem 0.6rem;
	border-radius: 6px;
	color: inherit;
	text-decoration: none;
	font-size: var(--fs-sm);
}

.manual__link:hover {
	background: var(--surface-muted);
}

.manual__link[aria-current="page"] {
	background: var(--surface-muted);
	font-weight: 600;
}

/* 本文。文章として読む幅と行間にする */
.manual__body {
	max-width: 46rem;
	padding: 1.75rem 2rem;
	border-radius: 8px;
	background: var(--surface);
	box-shadow: 0 1px 3px rgba(58, 68, 82, 0.08);
	line-height: 1.85;
}

.manual__body > *:first-child {
	margin-top: 0;
}

.manual__body h1 {
	margin: 0 0 1rem;
	font-size: var(--fs-2xl);
}

.manual__body h2 {
	margin: 2rem 0 0.6rem;
	padding-bottom: 0.3rem;
	border-bottom: 1px solid var(--border);
	font-size: var(--fs-lg);
}

.manual__body h3 {
	margin: 1.5rem 0 0.4rem;
	font-size: var(--fs-md);
}

.manual__body p {
	margin: 0 0 1rem;
}

.manual__body ul,
.manual__body ol {
	margin: 0 0 1rem;
	padding-left: 1.4rem;
}

.manual__body li {
	margin-bottom: 0.3rem;
}

.manual__body table {
	width: 100%;
	margin: 0 0 1.25rem;
	border-collapse: collapse;
	font-size: var(--fs-base);
	line-height: 1.6;
}

.manual__body th,
.manual__body td {
	border: 1px solid var(--border);
	padding: 0.4rem 0.6rem;
	text-align: left;
	vertical-align: top;
}

.manual__body thead th {
	background: var(--surface-muted);
	white-space: nowrap;
}

.manual__body code {
	padding: 0.1em 0.35em;
	border-radius: 4px;
	background: var(--surface-muted);
	font-size: 0.9em;
}

.manual__body pre {
	margin: 0 0 1.25rem;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	background: var(--surface-muted);
	overflow-x: auto;
	line-height: 1.6;
}

.manual__body pre code {
	padding: 0;
	background: none;
}

.manual__body strong {
	font-weight: 700;
}

.manual__updated {
	margin: 2rem 0 0;
	padding-top: 0.75rem;
	border-top: 1px solid var(--border);
	font-size: var(--fs-sm);
	color: var(--text-muted);
}

/* ===== ヘルプの本文 ===== */

.manual__title {
	margin-bottom: 16px;
	font-size: var(--fs-2xl);
}

/* そのページの目次。本文の頭に置き、読みたい章へすぐ飛べるようにする */
.manual__toc {
	margin-bottom: 24px;
	padding: 14px 18px;
	border: 1px solid var(--accent-border);
	border-radius: var(--radius);
	background: var(--accent-soft);
}

.manual__toc-title {
	margin-bottom: 6px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.06em;
}

.manual__toc-list {
	margin: 0;
	padding-left: 1.4em;
}

.manual__toc-list li + li {
	margin-top: 2px;
}

.manual__toc-link {
	color: var(--accent-text);
}

/* 目次から飛んだ時、見出しが上端に貼り付かないようにする */
.manual__body h2[id] {
	scroll-margin-top: 16px;
}

.manual__body img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 12px 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

/* ===== 素材 ===== */

/* 絞り込みの帯の最後の行に、タグの選択を折りたたんで置く */
.asset-filter__tags {
	flex-basis: 100%;
}

.asset-filter__tags summary {
	color: var(--text-muted);
	cursor: pointer;
}

.asset-filter__tag-options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.asset-tag-option {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	font-size: var(--fs-sm);
	cursor: pointer;
}

.asset-tag-option__count {
	color: var(--text-subtle);
	font-size: var(--fs-2xs);
}

.asset-filter__summary {
	margin-bottom: 12px;
	color: var(--text-muted);
}

.asset-filter__summary a {
	margin-left: 8px;
}

/* 一覧は格子。幅に合わせて列の数が変わる */
.asset-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 20px;
	list-style: none;
}

.asset-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.asset-card__link {
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: inherit;
	text-decoration: none;
}

.asset-card__name {
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.asset-card__meta {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

/* 素材の見た目の枠。画像の比率に関わらず、枠いっぱいに収める (はみ出さない) */
.asset-preview {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	/* 透過 PNG の抜けた所が分かるよう、白ではなく薄い格子にする */
	background:
		repeating-conic-gradient(#f1f3f6 0% 25%, #fafbfc 0% 50%) 0 0 / 16px 16px;
}

.asset-preview--card {
	aspect-ratio: 1;
}

.asset-preview--thumb {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
}

.asset-preview--large {
	min-height: 240px;
	max-height: 520px;
	border: 0;
	border-radius: 0;
}

.asset-preview__media {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.asset-preview--large .asset-preview__media {
	max-height: 520px;
}

.asset-preview__badge {
	position: absolute;
	top: 6px;
	left: 6px;
	padding: 1px 6px;
	border-radius: 4px;
	background: rgba(35, 39, 47, 0.75);
	color: var(--text-on-accent);
	font-size: var(--fs-2xs);
}

.asset-row {
	display: flex;
	align-items: center;
	gap: 12px;
	color: inherit;
	text-decoration: none;
}

.asset-detail {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 20px;
}

.asset-detail__actions {
	display: flex;
	gap: 16px;
	border-top: 1px solid var(--border);
}

/* 長い URL・ファイル名で枠を押し広げない */
.asset-detail__break {
	overflow-wrap: anywhere;
}

.asset-trash-notice {
	margin-bottom: 20px;
}

.asset-trash-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.asset-usage {
	margin: 8px 0 0;
	padding-left: 20px;
}

.asset-tag-form {
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 8px;
}

/* ボタンを入力欄と同じ高さにそろえる (表の中でも、フォームの部品として並べる) */
.asset-tag-form .btn {
	height: var(--input-height);
	padding-top: 0;
	padding-bottom: 0;
}

.asset-tag-form .field__input {
	min-width: 140px;
}

/* タグの候補 (押すと入力欄に足す) */
.asset-tag-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.asset-tag-suggestion {
	padding: 2px 8px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-muted);
	font: inherit;
	font-size: var(--fs-xs);
	cursor: pointer;
}

.asset-tag-suggestion:hover {
	border-color: var(--accent-border);
	color: var(--accent-text);
}

/* アップロード */
.asset-upload {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 12px;
}

.asset-dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 32px 16px;
	border: 2px dashed var(--border-strong);
	border-radius: var(--radius-lg);
	background: var(--surface-muted);
	text-align: center;
	cursor: pointer;
}

.asset-dropzone--active {
	border-color: var(--accent);
	background: var(--accent-soft);
}

.asset-dropzone__title {
	font-weight: 600;
}

.asset-dropzone__note {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

/* 枠全体を押せるようにし、入力欄そのものは見せない (ラベルが代わりに受ける) */
.asset-dropzone__input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.asset-dropzone[data-state="selected"] {
	border-style: solid;
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.asset-dropzone[data-state="error"] {
	border-color: var(--danger-border);
	background: var(--danger-soft);
}

.asset-dropzone[data-state="error"] .asset-dropzone__note {
	color: var(--danger);
}

.asset-upload__progress-row {
	display: grid;
	grid-template-columns: 200px 1fr;
	align-items: center;
	gap: 12px;
}

.asset-upload__progress {
	width: 100%;
}

.asset-upload__status {
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

.asset-upload__progress-row[data-state="error"] .asset-upload__status {
	color: var(--danger);
}

.asset-upload__progress-row[data-state="done"] .asset-upload__status {
	color: var(--success);
}

@media (max-width: 600px) {
	.asset-upload__progress-row {
		grid-template-columns: 1fr;
	}
}

/* ===== マスタ (カテゴリ・タグ) ===== */

.master-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

/* 名前とコード (タグは名前と親) の 2 列。背景画像は下の行に横いっぱい */
.master-form__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 16px;
}

@media (max-width: 600px) {
	.master-form__fields {
		grid-template-columns: minmax(0, 1fr);
	}
}

.master-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* 子は字下げし、親との繋がりを左の線で見せる */
.master-list--nested {
	margin-left: 22px;
	padding-left: 12px;
	border-left: 1px solid var(--border);
}

.master-list--saving {
	opacity: 0.6;
	pointer-events: none;
}

.master-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 4px 0;
	padding: 6px 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.master-list__item--dragging > .master-row {
	background: var(--accent-soft);
	border-color: var(--accent-border);
}

.master-row__handle {
	color: var(--text-subtle);
	cursor: grab;
	letter-spacing: -2px;
	user-select: none;
}

.master-row__name {
	font-weight: 600;
}

.master-row__code {
	padding: 1px 6px;
	border-radius: 4px;
	background: var(--surface-muted);
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.master-row__count {
	margin-left: auto;
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

.master-row__move {
	display: flex;
	gap: 4px;
}

.master-status {
	margin: 0 0 8px;
	font-size: var(--fs-sm);
}

.master-status[data-state="done"] {
	color: var(--success);
}

.master-status[data-state="error"] {
	color: var(--danger);
}

.master-usage {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
}

.master-picker {
	border: 0;
	margin: 0;
	padding: 0;
}

.master-picker__list {
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
}

.master-picker__item--depth-1 {
	padding-left: 20px;
}

.master-picker__item--depth-2 {
	padding-left: 40px;
}

.permission-grid__level {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}

/* ===== 素材を選ぶ欄・モーダル ===== */

.asset-field {
	display: flex;
	align-items: center;
	gap: 12px;
}

.asset-field__preview {
	flex: 0 0 96px;
	width: 96px;
	height: 72px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--surface-muted);
}

.asset-field__empty {
	color: var(--text-subtle);
	font-size: var(--fs-xs);
}

.asset-field__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.asset-field__name {
	font-size: var(--fs-sm);
	overflow-wrap: anywhere;
}

.asset-field__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.asset-picker {
	width: min(880px, 92vw);
	max-height: 86vh;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
}

.asset-picker::backdrop {
	background: rgba(23, 27, 35, 0.4);
}

.asset-picker__head,
.asset-picker__search,
.asset-picker__pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 16px;
}

.asset-picker__search .field__input {
	width: 100%;
}

.asset-picker__body {
	padding: 0 16px;
	max-height: 56vh;
	overflow: auto;
}

.asset-picker__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.asset-picker__item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	padding: 6px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	text-align: left;
	cursor: pointer;
	font: inherit;
}

.asset-picker__item:hover {
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.asset-picker__name {
	font-size: var(--fs-xs);
	overflow-wrap: anywhere;
}

.asset-picker__count {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.asset-picker__item .asset-preview--thumb {
	flex: none;
	width: 100%;
	height: 100px;
}

/* ===== タイムライン (履歴・引かれた記録) ===== */

.timeline {
	margin: 8px 0 0;
	padding: 0 0 0 16px;
	border-left: 2px solid var(--border);
	list-style: none;
}

.timeline__item {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	padding: 6px 0;
}

.timeline__item::before {
	content: "";
	position: absolute;
	left: -21px;
	top: 12px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
}

.timeline__time {
	color: var(--text-muted);
	font-size: var(--fs-xs);
	min-width: 120px;
}

.timeline__note {
	color: var(--text-muted);
}

/* ===== オリパ ===== */

.tag--info {
	background: var(--accent-soft);
	border-color: var(--accent-border);
	color: var(--accent-text);
}

/* 読み上げにだけ渡す見出し。列の意味は視覚的には自明でも、
   表の見出しが空だと読み上げで位置が分からなくなる */
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.field__input--sm {
	width: auto;
	padding: 5px 8px;
	font-size: var(--fs-sm);
}

.field__input--number {
	max-width: 200px;
}

.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin-bottom: 8px;
}

.panel__header.section-head {
	margin-bottom: 0;
}

.data-table--compact td,
.data-table--compact th {
	padding-top: 6px;
	padding-bottom: 6px;
}

.inventory-filter,
.prize-group-form__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 0 16px;
}

/* 排出商品のタブの一番上: 在庫に無くなったカードの箱 (下の口数と間を空ける) */
.missing-panel {
	margin-bottom: 28px;
	border-color: var(--danger-border);
}

/* 排出商品のタブの一番上: いまの口数 */
.prize-count {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin: 0 0 12px;
	color: var(--text-muted);
}

.prize-count strong {
	color: var(--text);
	font-size: var(--fs-xl);
}

/* 排出商品を作る流れ (上の案内) */
.flow-guide {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.flow-guide__step {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-muted);
}

.flow-guide__step:first-child {
	border-radius: var(--radius) 0 0 var(--radius);
}

.flow-guide__step:last-child {
	border-radius: 0 var(--radius) var(--radius) 0;
}

.flow-guide__step + .flow-guide__step {
	border-left: 0;
}

.flow-guide__step strong {
	display: block;
	font-size: var(--fs-base);
}

.flow-guide__note {
	font-size: var(--fs-xs);
}

.flow-guide__number {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border: 2px solid var(--border-strong);
	border-radius: 50%;
	font-size: var(--fs-sm);
	font-weight: 600;
}

.flow-guide__step--current {
	background: var(--accent-soft);
	color: var(--text);
	box-shadow: inset 0 -3px 0 var(--accent);
}

.flow-guide__step--current .flow-guide__number {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--text-on-accent);
}

.flow-guide__step--done .flow-guide__number {
	border-color: var(--success);
	background: var(--success);
	color: var(--text-on-accent);
}

@media (max-width: 700px) {
	.flow-guide {
		grid-template-columns: 1fr;
	}

	.flow-guide__step,
	.flow-guide__step:first-child,
	.flow-guide__step:last-child {
		border-radius: 0;
	}

	.flow-guide__step + .flow-guide__step {
		border-top: 0;
		border-left: 1px solid var(--border);
	}
}

/* 商品グループを作る (開くと、番号を縦の線でつないだ手順が出る) */
.prize-create__summary {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	cursor: pointer;
	list-style: none;
}

.prize-create__summary::-webkit-details-marker {
	display: none;
}

.prize-create__summary .field__hint {
	display: block;
	margin: 2px 0 0;
}

.prize-create__plus {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--accent);
	color: var(--text-on-accent);
	font-size: var(--fs-lg);
}

.prize-create__plus {
	transition: transform 0.15s ease;
}

/* 開いている時は × にする (押すと畳めることが分かるように) */
.prize-create details[open] .prize-create__plus {
	background: var(--text-muted);
	transform: rotate(45deg);
}

.prize-create__body {
	border-top: 1px solid var(--border);
}

.flow-steps {
	margin: 0;
	padding: 0;
	list-style: none;
}

.flow-step {
	position: relative;
	display: flex;
	gap: 14px;
	padding-bottom: 22px;
}

/* 番号と番号をつなぐ縦の線 */
.flow-step::before {
	content: "";
	position: absolute;
	top: 30px;
	bottom: 2px;
	left: 13px;
	border-left: 2px solid var(--border);
}

.flow-step:last-child {
	padding-bottom: 4px;
}

.flow-step:last-child::before {
	display: none;
}

.flow-step__number {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--accent);
	color: var(--text-on-accent);
	font-size: var(--fs-sm);
	font-weight: 600;
}

.flow-step__body {
	flex: 1;
	min-width: 0;
}

.flow-step__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 3px 0 10px;
	font-weight: 600;
}

.flow-step__optional {
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--surface-muted);
	border: 1px solid var(--border);
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	font-weight: 400;
}

.prize-group-form__name {
	max-width: 360px;
}

/* 「まとめて表示」を選んだ時だけ、名前と画像の欄を出す */
.prize-group-form__summary {
	display: none;
	margin-top: 12px;
	padding: 12px 14px;
	border-left: 3px solid var(--accent-border);
	background: var(--surface-muted);
}

.prize-group-form:has(input[name="displayMode"][value="summary"]:checked)
	.prize-group-form__summary {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* ラジオをカードで並べる */
.choice-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 8px;
}

.choice-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px 12px 38px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface);
	cursor: pointer;
}

.choice-card input {
	position: absolute;
	top: 14px;
	left: 14px;
	margin: 0;
	accent-color: var(--accent);
}

.choice-card__title {
	font-weight: 600;
}

.choice-card__note {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.choice-card:has(input:checked) {
	border-color: var(--accent);
	background: var(--accent-soft);
	box-shadow: 0 0 0 1px var(--accent);
}

.choice-card:has(input:focus-visible) {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.oripa-filter__range {
	display: flex;
	align-items: center;
	gap: 6px;
}

/* 編集の帯 */
.oripa-band {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.oripa-band__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.oripa-band__form {
	display: flex;
	align-items: center;
	gap: 6px;
}

.oripa-reasons {
	margin-bottom: 12px;
}

.oripa-reasons ul {
	margin: 6px 0 0;
	padding-left: 20px;
}

.oripa-tabs__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin-left: 4px;
	border-radius: 50%;
	background: var(--danger);
	color: var(--text-on-accent);
	font-size: var(--fs-2xs);
}

.oripa-readonly {
	margin-bottom: 12px;
}

/* 中の欄の間隔は .form と同じ (fieldset で包むと .form の gap が効かない) */
.oripa-fieldset {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

/* 左に入力、右にプレビュー */
.oripa-edit {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 20px;
	align-items: start;
}

.oripa-edit__preview {
	position: sticky;
	top: 16px;
}

.oripa-edit__preview-title {
	margin: 0 0 8px;
	font-weight: 600;
}

@media (max-width: 1000px) {
	.oripa-edit {
		grid-template-columns: 1fr;
	}

	.oripa-edit__preview {
		position: static;
	}
}

/* カテゴリ・タグを選ぶ欄 */
.master-picker__list--scroll {
	max-height: 220px;
	overflow: auto;
	padding: 6px 8px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.master-create {
	margin-top: 8px;
}

.master-create summary {
	cursor: pointer;
	color: var(--accent-text);
	font-size: var(--fs-sm);
}

.master-create__fields {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}

/* 単位を添えた数の欄 (¥ 1,000 / 回 など) */
.input-affix {
	display: flex;
	align-items: center;
	gap: 8px;
}

.input-affix__text {
	color: var(--text-muted);
	font-weight: 600;
	white-space: nowrap;
}

/* 日時の欄の近道 (今日・明日… / 日初・日終) */
.field__input--datetime {
	max-width: 260px;
}

/* 欄の下にカレンダーを開く。浮かせず下を押し下げる (下の欄に重ならないように) */
.datetime-input {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

/* 自前のカレンダーを使う時は、ブラウザのカレンダーの印を隠す (Chrome・Safari) */
.field__input--no-picker::-webkit-calendar-picker-indicator {
	display: none;
}

.calendar {
	box-sizing: border-box;
	width: 350px;
	max-width: 100%;
	padding: 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow-md);
}

.calendar__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.calendar__title {
	display: flex;
	gap: 6px;
}

.calendar__select.field__input {
	flex: none;
	width: 84px;
	padding: 5px 8px 5px 10px;
	font-weight: 600;
}

/* 年は 4 桁 + 「年」が切れないように */
.calendar__select.field__input[aria-label="年"] {
	width: 108px;
}

.calendar__nav {
	width: 32px;
	height: 32px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	font-size: var(--fs-lg);
	line-height: 1;
	cursor: pointer;
}

.calendar__nav:hover {
	background: var(--accent-soft);
}

.calendar__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	text-align: center;
}

.calendar__week {
	padding: 4px 0;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.calendar__week--sun {
	color: var(--danger);
}

.calendar__week--sat {
	color: var(--accent-text);
}

.calendar__day {
	height: 34px;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: none;
	color: var(--text);
	font: inherit;
	font-size: var(--fs-sm);
	cursor: pointer;
}

.calendar__day:hover {
	background: var(--accent-soft);
}

.calendar__day:disabled {
	color: var(--text-subtle);
	background: none;
	cursor: default;
	opacity: 0.45;
}

.calendar__day--today {
	border-color: var(--accent-border);
	font-weight: 600;
}

.calendar__day--selected,
.calendar__day--selected:hover {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--text-on-accent);
}

.calendar__time {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--border);
}

.calendar__time .field__input--sm {
	padding: 4px 6px;
}

.calendar__time-label {
	margin-right: 2px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.calendar__foot {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 14px;
	padding-top: 14px;
	padding-bottom: 2px;
	border-top: 1px solid var(--border);
}

.datetime-quick {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
}

.datetime-quick__label {
	margin-left: 4px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.datetime-quick__label:first-child {
	margin-left: 0;
}

.chip-button {
	padding: 5px 12px;
	border: 1px solid var(--border-strong);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: var(--fs-sm);
	cursor: pointer;
}

.chip-button:hover {
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.chip-button--muted {
	color: var(--text-muted);
}

.chip-button--sm {
	padding: 4px 10px;
	font-size: var(--fs-xs);
}

/* 配信条件のビルダー。上から 1 列に並べ、間をつなぎ方でつなぐ */
.cond-hint {
	margin: 0 0 8px;
}

.cond-builder {
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.cond-empty {
	margin: 0 0 10px;
	padding: 14px;
	border: 1px dashed var(--border-strong);
	border-radius: var(--radius);
	color: var(--text-muted);
	text-align: center;
}

/* 「かつ」でつながったまとまり。1 つの枠で囲む */
.cond-segment {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	padding: 10px;
	border: 1px solid var(--accent-border);
	border-left: 4px solid var(--accent);
	border-radius: var(--radius);
	background: var(--accent-soft);
}

.cond-rule {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.cond-rule__number-badge {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--accent);
	color: var(--text-on-accent);
	font-size: var(--fs-xs);
	font-weight: 600;
}

.cond-rule__inputs {
	display: flex;
	flex: 1;
	flex-wrap: wrap;
	gap: 6px;
	min-width: 0;
}

.cond-rule__inputs .field__input {
	width: auto;
	max-width: 100%;
}

.cond-rule__number {
	max-width: 120px;
}

.cond-rule__date {
	max-width: 170px;
}

.cond-rule__remove {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 1px solid var(--danger-border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--danger);
	font-size: var(--fs-lg);
	line-height: 1;
	cursor: pointer;
}

.cond-rule__remove:hover {
	background: var(--danger-soft);
}

/* つなぎ方。縦の線の真ん中に置き、押すと切り替わる */
/* 2 つの選択肢を同じ幅にして、境目を縦の線の真ん中に合わせる */
.cond-join {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-self: center;
	gap: 0;
	margin: 6px 0;
	padding: 10px 0;
}

.cond-join::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	border-left: 2px solid var(--border-strong);
	transform: translateX(-1px);
}

.cond-join__option {
	position: relative;
	min-width: 104px;
	padding: 4px 12px;
	text-align: center;
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--text-muted);
	font: inherit;
	font-size: var(--fs-xs);
	cursor: pointer;
}

.cond-join__option:first-child {
	border-radius: 999px 0 0 999px;
}

.cond-join__option:last-child {
	border-left: 0;
	border-radius: 0 999px 999px 0;
}

.cond-join__option[aria-pressed="true"] {
	z-index: 1;
	border-color: var(--accent);
	background: var(--accent);
	color: var(--text-on-accent);
	font-weight: 600;
}

.cond-join--or .cond-join__option[aria-pressed="true"] {
	border-color: var(--caution);
	background: var(--caution);
}

.cond-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.cond-summary {
	margin: 10px 0 0;
	padding: 8px 12px;
	border-radius: var(--radius);
	background: var(--surface-muted);
	border: 1px solid var(--border);
	font-size: var(--fs-sm);
}

/* 詳細画面のブロックの編集 (public/oripa-blocks.js)。キャンバスはアプリの明るい背景に合わせる */
.bk {
	--bk-canvas: #f5f5f9;
	--bk-ink: #15151f;
	--bk-ink-muted: #6b6b7b;
	--bk-line: #e4e4ec;
	--bk-focus: #6f4cff;
}

.bk-canvas {
	display: flex;
	flex-direction: column;
	padding: 10px;
	border-radius: var(--radius-lg);
	background: var(--bk-canvas);
}

.bk-row {
	position: relative;
	border: 1px solid transparent;
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(21, 21, 31, 0.06);
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}

.bk-row:hover {
	border-color: var(--bk-line);
}

.bk-row.is-selected {
	border-color: var(--bk-focus);
	box-shadow: 0 0 0 3px rgba(111, 76, 255, 0.14);
}

.bk-row.is-dragging {
	opacity: 0.4;
}

.bk-row.is-drop-before::before,
.bk-row.is-drop-after::after {
	content: "";
	position: absolute;
	left: 8px;
	right: 8px;
	height: 3px;
	border-radius: 2px;
	background: var(--bk-focus);
}

.bk-row.is-drop-before::before {
	top: -7px;
}

.bk-row.is-drop-after::after {
	bottom: -7px;
}

.bk-row__bar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 6px 0 4px;
	color: var(--bk-ink-muted);
	font-size: var(--fs-2xs);
}

.bk-row__handle {
	padding: 2px 4px;
	border-radius: 4px;
	color: #a3a3b2;
	letter-spacing: -2px;
	cursor: grab;
	user-select: none;
}

.bk-row__handle:hover {
	background: var(--bk-canvas);
	color: var(--bk-ink);
}

.bk-row__type {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-weight: 600;
}

.bk-row__actions {
	display: inline-flex;
	gap: 2px;
	margin-left: auto;
	opacity: 0;
	transition: opacity 0.15s;
}

.bk-row:hover .bk-row__actions,
.bk-row.is-selected .bk-row__actions,
.bk-row__actions:focus-within {
	opacity: 1;
}

.bk-row__body {
	padding: 6px 14px 12px;
	color: var(--bk-ink);
}

.bk-icon {
	display: inline-flex;
}

/* 選んだブロックの装飾のボタン */
.bk-toolbar {
	position: sticky;
	top: 8px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 6px 8px 0;
	padding: 6px 8px;
	border: 1px solid var(--bk-line);
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 4px 14px rgba(21, 21, 31, 0.08);
}

.bk-toolbar__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
}

.bk-toolbar__label {
	min-width: 72px;
	color: var(--bk-ink-muted);
	font-size: var(--fs-2xs);
	font-weight: 600;
}

.bk-toolbar__title {
	margin: 0;
	color: var(--bk-ink-muted);
	font-size: var(--fs-2xs);
}

.bk-tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 6px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--bk-ink);
	font: inherit;
	font-size: var(--fs-sm);
	cursor: pointer;
}

.bk-tool:hover:not(:disabled) {
	background: var(--bk-canvas);
}

.bk-tool[aria-pressed="true"] {
	background: #ede8ff;
	color: var(--bk-focus);
}

.bk-tool:disabled {
	color: #c4c4cf;
	cursor: not-allowed;
}

.bk-tool--bold {
	font-weight: 800;
}

.bk-tool--italic {
	font-style: italic;
	font-family: Georgia, serif;
}

.bk-tool--danger:hover:not(:disabled) {
	background: var(--danger-soft);
	color: var(--danger);
}

.bk-seg {
	display: inline-flex;
	gap: 2px;
}

.bk-sep {
	width: 1px;
	height: 18px;
	margin: 0 4px;
	background: var(--bk-line);
}

.bk-colorbtn {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 1px;
	line-height: 1;
}

.bk-colorbtn__a {
	font-weight: 700;
}

.bk-colorbtn__bar {
	width: 16px;
	height: 4px;
	border-radius: 2px;
}

.bk-colorbtn__bar--none {
	background: repeating-linear-gradient(
		45deg,
		#d6d6df 0 2px,
		transparent 2px 4px
	);
}

.bk-defaults {
	border-top: 1px dashed var(--bk-line);
	padding-top: 4px;
}

.bk-defaults summary {
	color: var(--bk-ink-muted);
	font-size: var(--fs-2xs);
	cursor: pointer;
}

.bk-defaults .bk-toolbar__row {
	margin-top: 4px;
}

.bk-hint {
	color: var(--bk-ink-muted);
	font-size: var(--fs-2xs);
}

/* 見出し・文章 (アプリと同じ大きさ・装飾で見せる) */
.bk-heading {
	width: 100%;
	padding: 4px 0;
	border: 0;
	background: transparent;
	color: var(--bk-ink);
	caret-color: var(--bk-ink);
	font: inherit;
	outline: none;
}

.bk-heading::placeholder {
	color: #a3a3b2;
	-webkit-text-fill-color: #a3a3b2;
}

.bk-rich {
	position: relative;
	min-height: 2.4em;
	padding: 4px 0;
	color: var(--bk-ink);
	caret-color: var(--bk-ink);
	line-height: 1.7;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	outline: none;
}

/* 空の時の案内。カーソルが先頭に来るよう、文字の流れの外 (absolute) に置く */
.bk-rich.is-empty::before {
	content: "文章を入れる";
	position: absolute;
	top: 4px;
	left: 0;
	color: #a3a3b2;
	-webkit-text-fill-color: #a3a3b2;
	pointer-events: none;
}

.bk-p {
	margin: 0;
}

.bk-linked {
	text-decoration: underline;
	text-decoration-color: rgba(46, 144, 250, 0.6);
	text-underline-offset: 2px;
}

.bk-rich-foot {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-top: 4px;
	padding-top: 4px;
	border-top: 1px dashed var(--bk-line);
}

.bk-counter {
	color: var(--bk-ink-muted);
	font-size: var(--fs-2xs);
	white-space: nowrap;
}

.bk-counter.is-over {
	color: var(--danger);
	font-weight: 600;
}

.bk-image {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bk-image .field {
	margin: 0;
}

/* 種類は行の札に出ているので、欄の見出しは出さない */
.bk-image .field__label {
	display: none;
}

.bk-divider {
	margin: 10px 0 4px;
	border: 0;
	border-top: 1px solid var(--bk-line);
}

/* 商品一覧 */
.bk-prizes {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.bk-prizes__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding: 6px 8px;
	border-radius: 8px;
	background: var(--bk-canvas);
}

.bk-prizes__row.is-off .bk-prizes__name {
	opacity: 0.4;
}

.bk-prizes__pick {
	display: inline-flex;
	flex: 1;
	align-items: center;
	gap: 8px;
	min-width: 0;
	cursor: pointer;
}

.bk-prizes__badge {
	padding: 1px 6px;
	border-radius: 4px;
	background: #fff4e0;
	color: #b06a00;
	font-size: var(--fs-2xs);
	font-weight: 600;
}

.bk-prizes__badge--muted {
	background: #efeff4;
	color: var(--bk-ink-muted);
}

.bk-prizes__toggle {
	padding: 2px 8px;
	border: 1px solid var(--bk-line);
	border-radius: 999px;
	background: #ffffff;
	color: var(--bk-ink-muted);
	font: inherit;
	font-size: var(--fs-2xs);
	cursor: pointer;
}

.bk-prizes__toggle.is-custom {
	border-color: #c9bcff;
	background: #ede8ff;
	color: var(--bk-focus);
}

.bk-prizes__panel {
	display: flex;
	flex: 0 0 100%;
	flex-direction: column;
	gap: 4px;
	padding: 6px 8px;
	border: 1px solid var(--bk-line);
	border-radius: 8px;
	background: #ffffff;
}

.bk-prizes__panel-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

/* ブロックの間の「＋」 */
.bk-gap {
	position: relative;
	height: 14px;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.bk-gap::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 12px;
	right: 12px;
	border-top: 2px solid var(--bk-focus);
	opacity: 0;
	transition: opacity 0.15s;
}

.bk-gap__plus {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--bk-focus);
	color: #ffffff;
	font-size: var(--fs-sm);
	transform: translate(-50%, -50%);
	opacity: 0;
	transition: opacity 0.15s;
}

.bk-gap:hover::before,
.bk-gap:hover .bk-gap__plus,
.bk-gap:focus-visible::before,
.bk-gap:focus-visible .bk-gap__plus {
	opacity: 1;
}

.bk-gap:disabled {
	cursor: default;
	opacity: 0;
}

.bk-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 36px 16px;
	border: 2px dashed #c9bcff;
	border-radius: 10px;
	background: #ffffff;
	color: var(--bk-ink-muted);
	font: inherit;
	font-size: var(--fs-xs);
	cursor: pointer;
}

.bk-empty strong {
	color: var(--bk-focus);
	font-size: var(--fs-base);
}

.bk-foot {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
}

.bk-add {
	flex: 1;
	border-style: dashed;
}

.bk-actions__status {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

/* ポップオーバー (色・リンク・ブロックを足す) */
.bk-pop {
	position: absolute;
	z-index: 50;
	padding: 10px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 12px 32px rgba(21, 21, 31, 0.16);
	color: var(--text);
	font-size: var(--fs-sm);
}

.bk-pop--color {
	width: 330px;
}

.bk-pop--link {
	width: 320px;
}

.bk-color {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bk-color__label {
	margin: 4px 0 0;
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	font-weight: 600;
}

.bk-color__row {
	display: flex;
	align-items: center;
	gap: 6px;
}

.bk-color__row--wrap {
	flex-wrap: wrap;
}

.bk-color__none,
.bk-color__gradient {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: #ffffff;
	color: var(--text);
	font: inherit;
	font-size: var(--fs-xs);
	cursor: pointer;
}

.bk-color__swatch {
	width: 22px;
	height: 22px;
	border: 1px solid rgba(21, 21, 31, 0.15);
	border-radius: 50%;
	cursor: pointer;
}

.bk-color__chip {
	display: inline-block;
	width: 18px;
	height: 18px;
	border-radius: 4px;
}

.bk-color__chip--wide {
	flex: 1;
	height: 22px;
}

.bk-color .is-on {
	outline: 2px solid #6f4cff;
	outline-offset: 1px;
}

/* 「自由に」は色の丸のすぐ後ろに置く (右の端に離さない) */
.bk-color__freewrap {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 4px;
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	white-space: nowrap;
}

.bk-color input[type="color"] {
	width: 26px;
	height: 24px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 4px;
	background: none;
	cursor: pointer;
}

.bk-color__builder {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px;
	border-radius: 8px;
	background: var(--surface-muted);
}

.bk-color__stops {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.bk-color__stop {
	display: inline-flex;
	align-items: center;
}

.bk-color__remove,
.bk-color__add {
	border: 0;
	background: none;
	color: var(--text-muted);
	font: inherit;
	cursor: pointer;
}

.bk-color__remove:disabled,
.bk-color__add:disabled {
	opacity: 0.3;
	cursor: default;
}

.bk-color__angle-row,
.bk-color__apply {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bk-color__angle-row input {
	flex: 1;
}

.bk-color__angle {
	min-width: 36px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.bk-color__foot,
.bk-link__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.bk-link {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bk-add-menu {
	display: flex;
	flex-direction: column;
	width: 280px;
}

.bk-add-menu__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.bk-add-menu__item:hover,
.bk-add-menu__item:focus-visible {
	background: #ede8ff;
}

.bk-add-menu__item .bk-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: #f5f5f9;
	color: #6f4cff;
}

.bk-add-menu__text {
	display: flex;
	flex-direction: column;
	font-size: var(--fs-xs);
}

.bk-add-menu__text span {
	color: var(--text-muted);
	font-size: var(--fs-2xs);
}

/* 太字・斜体 (詳細のブロックとプレビューで共通。大きさは style の font-size) */
.is-bold {
	font-weight: 700;
}

.is-italic {
	font-style: italic;
}

/* アプリの画面を模したプレビュー。文字の大きさと色はアプリに合わせて直に書く (管理画面の段は使わない) */
.app-screen {
	position: relative;
	padding: 12px;
	border: 6px solid #23272f;
	border-radius: 24px;
	background: #ffffff;
	color: #15151f;
	overflow: hidden;
}

/* 演出・出た商品は暗い画面のまま (動画・カードが映えるように) */
.app-screen--effect,
.app-screen--result {
	background: #12141a;
	color: #f5f6f8;
}

.app-screen__bg {
	position: absolute;
	inset: 0;
	background-position: center;
	background-size: cover;
	opacity: 0.55;
}

.app-screen > * {
	position: relative;
}

.app-screen__tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 10px;
	overflow: hidden;
}

.app-tab {
	padding: 3px 10px;
	border-radius: 999px;
	background: #efeff4;
	color: #6b6b7b;
	font-size: 11px;
	white-space: nowrap;
}

.app-tab--on {
	background: #15151f;
	color: #ffffff;
	font-weight: 600;
}

.app-screen__note {
	margin: 8px 0 0;
	color: #6b6b7b;
	font-size: 11px;
}

/* 白い背景に溶けないよう、枠と影で区切る */
.oripa-card {
	border: 1px solid #e4e4ec;
	border-radius: 14px;
	background: #ffffff;
	box-shadow: 0 2px 10px rgba(21, 21, 31, 0.06);
	color: #23272f;
	overflow: hidden;
}

.oripa-card__image {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	background: linear-gradient(135deg, #e8a600, #9b4dff);
}

.oripa-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.oripa-card__noimage {
	color: rgba(255, 255, 255, 0.85);
	font-size: 12px;
}

.oripa-card__badge {
	position: absolute;
	right: 8px;
	bottom: 8px;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.6);
	color: #ffffff;
	font-size: 10px;
}

.oripa-card__body {
	padding: 10px 12px 12px;
}

.oripa-card__title {
	margin: 0 0 6px;
	font-size: 15px;
}

.oripa-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 8px;
}

.oripa-card__tag {
	padding: 1px 6px;
	border-radius: 4px;
	background: #eef2f8;
	color: #4a6fa5;
	font-size: 10px;
}

.oripa-card__meta {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
}

.oripa-card__price {
	font-weight: 700;
}

.oripa-card__bar {
	height: 6px;
	margin-top: 6px;
	border-radius: 999px;
	background: #e4e7ec;
	overflow: hidden;
}

.oripa-card__bar span {
	display: block;
	height: 100%;
	background: #e5383b;
}

/* 詳細はアプリの明るいテーマ (apps/mobile の app_colors.dart) に合わせる。色は保存した hex のまま見せる */
.app-screen--detail {
	max-height: 640px;
	background: #ffffff;
	color: #15151f;
	overflow: auto;
}

.app-screen--detail .oripa-card__image {
	border-radius: 12px;
	overflow: hidden;
}

.oripa-detail__title {
	margin: 10px 0 2px;
	font-size: 16px;
}

.oripa-detail__price {
	margin: 0 0 10px;
	color: #6b6b7b;
	font-size: 12px;
}

/* コンテンツのブロック */
.content-blocks {
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 15px;
	line-height: 1.6;
}

.cb {
	margin: 0;
	border-radius: 6px;
	transition: box-shadow 0.15s;
}

/* 編集画面で選んでいるブロック */
.cb--selected {
	box-shadow:
		0 0 0 2px #ffffff,
		0 0 0 4px #6f4cff;
}

.cb--align-center {
	text-align: center;
}

.cb--align-right {
	text-align: right;
}

.cb-heading {
	font-weight: 400;
	line-height: 1.35;
}

.cb-p {
	margin: 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.cb-p--empty {
	min-height: 1.6em;
}

.content-blocks a {
	color: inherit;
	text-decoration-color: rgba(46, 144, 250, 0.7);
	text-underline-offset: 2px;
}

.cb-image {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.cb-image.cb--align-center {
	align-items: center;
}

.cb-image.cb--align-right {
	align-items: flex-end;
}

.cb-image img {
	display: block;
	width: 100%;
	border-radius: 8px;
}

.cb-image__empty {
	width: 100%;
}

.cb-image > a,
.cb-image > img,
.cb-image > .cb--size-large > a,
.cb--size-large > img,
.cb--size-large > .cb-image__empty {
	width: 75%;
}

.cb--size-medium > a,
.cb--size-medium > img,
.cb--size-medium > .cb-image__empty {
	width: 50%;
}

.cb--size-small > a,
.cb--size-small > img,
.cb--size-small > .cb-image__empty {
	width: 33%;
}

.cb-image figcaption {
	margin-top: 4px;
	color: #6b6b7b;
	font-size: 11px;
}

.cb-image__empty {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	background: #e4e4ec;
	color: #6b6b7b;
	font-size: 11px;
}

.cb-empty {
	margin: 0;
	color: #6b6b7b;
	font-size: 12px;
}

.cb-divider {
	width: 100%;
	border: 0;
	border-top: 1px solid #e4e4ec;
}

.prize-list__group + .prize-list__group {
	margin-top: 12px;
}

.prize-list__name {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 400;
}

.prize-list__name.cb--align-center {
	justify-content: center;
}

.prize-list__name.cb--align-right {
	justify-content: flex-end;
}

.prize-list__badge {
	padding: 1px 6px;
	border-radius: 4px;
	background: #ffb400;
	color: #15151f;
	font-size: 10px;
}

.prize-list__count {
	color: #6b6b7b;
	font-size: 11px;
}

/* 1 行に --cols 枚 (CMS の「並べ方」。既定 3)。寄せは行の中の寄せ (まとめ画像の 1 枚の時に効く) */
.prize-tiles {
	--cols: 3;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.prize-tiles--center {
	justify-content: center;
}

.prize-tiles--right {
	justify-content: flex-end;
}

.prize-tile {
	display: flex;
	flex: 0 0 calc((100% - (var(--cols) - 1) * 6px) / var(--cols));
	flex-direction: column;
	gap: 2px;
	font-size: 10px;
}

.prize-tile > a {
	display: block;
}

.prize-tile__image {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 5 / 7;
	border-radius: 6px;
	background: #e4e4ec;
	overflow: hidden;
}

.prize-tile__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.prize-tile__points {
	color: #00b383;
	font-weight: 600;
}

/* 排出商品 */

.prize-group__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.prize-group__head .panel__title {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.prize-group__actions {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

.prize-group__edit {
	margin: 8px 0;
}

/* 商品を足す: 3 つのやり方をカードで並べ、押すと下に欄を開く */
.prize-add {
	margin: 14px 0;
	padding: 14px;
	border: 1px dashed var(--accent-border);
	border-radius: var(--radius);
	background: var(--accent-soft);
}

.prize-add__title {
	margin: 0 0 10px;
	font-weight: 600;
}

.prize-add__choices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 8px;
}

.prize-add__choice {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.prize-add__choice span {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.prize-add__choice:hover,
.prize-add__choice[aria-expanded="true"] {
	border-color: var(--accent);
	box-shadow: 0 0 0 1px var(--accent);
}

.prize-add__form {
	margin-top: 10px;
	padding: 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

/* 商品の一覧 (多くても伸びないよう、表は決まった高さでスクロール) */
.prize-items {
	margin-top: 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

.prize-items__toolbar,
.prize-items__bulk {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
}

.prize-items__summary {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 14px;
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

.prize-items__summary strong {
	color: var(--text);
	font-size: var(--fs-md);
}

.prize-items__filter {
	width: 220px;
	margin-left: auto;
}

.prize-items__bulk {
	background: var(--surface-muted);
}

.prize-items__selected {
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

.prize-items__bulk-points {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.prize-items__points {
	width: 120px;
}

.prize-items__remove {
	margin-left: auto;
}

.prize-items__scroll {
	max-height: 440px;
	overflow: auto;
}

.prize-items__table {
	margin: 0;
}

.prize-items__table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: var(--surface);
	box-shadow: inset 0 -1px 0 var(--border);
}

.prize-items__check {
	width: 36px;
}

.prize-items__item {
	display: flex;
	align-items: center;
	gap: 10px;
}

.prize-items__thumb {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 42px;
	border-radius: 4px;
	background: var(--surface-muted);
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	overflow: hidden;
}

.prize-items__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.prize-items__name {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* 商品の在庫の様子 (ブランド・在庫に無い印・在庫の画面への行き先・対応のボタン) */
.prize-items__inventory {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	margin-top: 2px;
	font-size: var(--fs-xs);
}

.prize-items__fix {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

/* 差し替え (1 枚だけ選ぶ) の時は「全部選ぶ」を出さない */
[data-swap] [data-inventory-page-all] {
	display: none;
}

/* 抽選順の地図 (1 マス = 1 口。100 口ずつの塊) */
.order-map {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 18px;
	margin: 6px 0 14px;
	padding: 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface-muted);
}

.order-map__block {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.order-map__label {
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	font-variant-numeric: tabular-nums;
}

.order-map__grid {
	display: grid;
	grid-template-rows: repeat(10, 11px);
	grid-auto-columns: 11px;
	grid-auto-flow: column;
	gap: 2px;
}

.order-map__cell {
	border-radius: 2px;
	cursor: pointer;
	transition: opacity 0.12s ease;
}

.order-map__cell:hover {
	outline: 2px solid var(--text);
	outline-offset: 0;
}

/* ラストワン (最後で固定) は枠で目立たせる */
.order-map__cell[draggable="true"] {
	cursor: grab;
}

.order-map__cell--dragging {
	opacity: 0.3;
}

/* ドラッグ中に、離すと入る口 */
.order-map__cell--target {
	outline: 2px solid var(--text);
	outline-offset: 1px;
	transform: scale(1.35);
}

.order-map__cell--last {
	box-shadow: inset 0 0 0 2px var(--surface);
	outline: 1px solid var(--text);
}

.order-map--focus .order-map__cell {
	opacity: 0.15;
}

.order-map--focus .order-map__cell--on {
	opacity: 1;
}

/* マスに乗った時のカード (画像・名前・口・コイン) */
.order-tip {
	position: fixed;
	z-index: 50;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 280px;
	padding: 8px 10px;
	border-radius: var(--radius);
	background: var(--text);
	color: var(--text-on-accent);
	font-size: var(--fs-xs);
	pointer-events: none;
	box-shadow: var(--shadow-md);
}

.order-tip img {
	flex: none;
	width: 40px;
	height: 56px;
	border-radius: 3px;
	object-fit: cover;
	background: rgba(255, 255, 255, 0.1);
}

.order-tip span {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.order-tip strong {
	font-size: var(--fs-sm);
}

.order-legend__item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: none;
	color: var(--text);
	font: inherit;
	cursor: default;
}

.order-legend__item:hover,
.order-legend__item:focus-visible {
	border-color: var(--border-strong);
	background: var(--surface);
}

.order-details {
	margin-top: 4px;
}

.order-details > summary {
	margin-bottom: 10px;
	cursor: pointer;
}

.order-table__flash {
	animation: order-flash 1.6s ease;
}

@keyframes order-flash {
	0%,
	40% {
		background: var(--accent-soft);
	}
	100% {
		background: transparent;
	}
}

/* 在庫から探して選ぶ (左に条件、右にカード、下に選んだ数と「足す」) */
.inventory-dialog[open] {
	display: flex;
	flex-direction: column;
	width: min(1180px, 96vw);
	height: 88vh;
	max-height: 88vh;
}

.inventory-dialog__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--border);
}

.inventory-dialog__group {
	margin-left: 10px;
	color: var(--text-muted);
	font-size: var(--fs-sm);
	font-weight: 400;
}

.inventory-dialog__body {
	flex: 1;
	min-height: 0;
}

/* 下の帯: 足し方ごとに 1 段 (手で選ぶ / 指定の条件でランダムに選ぶ) */
.inventory-dialog__foot {
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--border);
	background: var(--surface-muted);
}

.inv-mode {
	display: flex;
	align-items: center;
	gap: 8px 14px;
	padding: 10px 18px;
}

.inv-mode + .inv-mode {
	border-top: 1px dashed var(--border);
}

.inv-mode__title {
	flex: 0 0 200px;
	font-weight: 600;
}

/* 条件が長くても 1 段のまま。条件の部分だけを「…」にして (乗ると全文)、枚数は必ず出す */
.inv-mode__note {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	color: var(--text-muted);
	font-size: var(--fs-sm);
	white-space: nowrap;
}

/* 後ろの「に合う ◯ 枚から」との間 (flex の中では文字の空白が消えるため) */
.inv-mode__query {
	min-width: 0;
	margin-right: 0.3em;
	overflow: hidden;
	text-overflow: ellipsis;
}

.inv-mode > :not(.inv-mode__note) {
	flex-shrink: 0;
}

.inv-mode__submit {
	min-width: 180px;
}

.inventory-dialog__points {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: var(--fs-sm);
}

.inventory-dialog__points .field__input {
	width: 110px;
}

.inventory-dialog__points .inv-mode__count {
	width: 80px;
}

.inv {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	height: 100%;
}

.inv__filters {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	border-right: 1px solid var(--border);
	overflow: auto;
}

.inventory-filter--stack {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.inventory-filter--stack .field__label {
	margin-bottom: 4px;
	font-size: var(--fs-xs);
}

.inv__filter-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.inv__results {
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 14px 16px;
	overflow: auto;
}

.inv__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 12px;
	font-size: var(--fs-sm);
}

.inv__empty {
	padding: 40px 0;
	color: var(--text-muted);
	text-align: center;
}

.inv__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.inv-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	cursor: pointer;
	overflow: hidden;
}

.inv-card:hover {
	border-color: var(--accent-border);
}

.inv-card:has(.inv-card__check:checked) {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px var(--accent);
}

.inv-card__check {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 1;
	width: 18px;
	height: 18px;
	accent-color: var(--accent);
}

.inv-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	padding: 8px;
	background: var(--surface-muted);
}

.inv-card__image img {
	max-width: 100%;
	max-height: 100%;
	border-radius: 4px;
	object-fit: contain;
}

.inv-card__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 8px 10px 10px;
	min-width: 0;
}

.inv-card__name {
	font-weight: 600;
	font-size: var(--fs-sm);
	overflow-wrap: anywhere;
}

.inv-card__meta {
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	overflow-wrap: anywhere;
}

.inv-card__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 2px 0;
}

.inv-card__prices {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px;
	font-size: var(--fs-xs);
}

.inv-card__prices strong {
	color: var(--accent-text);
	font-size: var(--fs-sm);
}

.inv__pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 14px;
	font-size: var(--fs-sm);
}

@media (max-width: 760px) {
	.inv {
		grid-template-columns: 1fr;
		height: auto;
	}

	.inv__filters {
		border-right: 0;
		border-bottom: 1px solid var(--border);
	}

	/* 狭い幅は箱ごと縦に流す (下の帯を固定すると、カードの見える所が残らない) */
	.inventory-dialog[open] {
		overflow-y: auto;
	}

	.inventory-dialog__body {
		flex: none;
	}

	.inv-mode {
		flex-wrap: wrap;
	}

	.inv-mode__title {
		flex-basis: 100%;
	}

	.inv__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.order-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 8px 0;
	padding: 0;
	list-style: none;
	font-size: var(--fs-sm);
}

.order-legend__swatch {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 4px;
	border-radius: 2px;
}

.order-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.order-table {
	max-height: 520px;
	overflow: auto;
}

.order-table__dragging {
	background: var(--accent-soft);
}

.order-move {
	display: flex;
	gap: 4px;
}

.order-progress {
	height: 8px;
	margin: 6px 0 12px;
	border-radius: 999px;
	background: var(--border);
	overflow: hidden;
}

.order-progress span {
	display: block;
	height: 100%;
	background: var(--accent);
}

.item-dialog__body {
	padding-bottom: 16px;
}

/* プレビューのタブ: 左にアプリの画面、右に手順・説明・操作 */
.pv {
	display: grid;
	grid-template-columns: 380px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
	max-width: 1000px;
}

.pv-phone {
	position: sticky;
	top: 16px;
}

.pv-phone .app-screen {
	min-height: 560px;
}

.pv-tap {
	border-radius: 24px;
	cursor: pointer;
}

.pv-tap .oripa-card {
	transition:
		transform 0.15s,
		box-shadow 0.15s;
}

.pv-tap:hover .oripa-card {
	box-shadow: 0 6px 18px rgba(21, 21, 31, 0.12);
	transform: translateY(-2px);
}

.pv-side {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.pv-side__lead {
	margin: 0;
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

/* 手順。押すとその画面へ (演出・出た商品はグループを選んでから) */
.pv-steps {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pv-steps li {
	position: relative;
}

.pv-steps li + li::before {
	content: "";
	position: absolute;
	top: -10px;
	left: 23px;
	height: 20px;
	border-left: 2px solid var(--border);
}

.pv-steps__item {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 8px 10px;
	border: 0;
	border-radius: var(--radius);
	background: none;
	color: var(--text-muted);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.pv-steps__item:hover {
	background: var(--surface-muted);
}

.pv-steps__num {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 2px solid var(--border-strong);
	border-radius: 50%;
	background: var(--surface);
	font-size: var(--fs-xs);
	font-weight: 700;
}

.pv-steps__text {
	display: flex;
	flex-direction: column;
	font-size: var(--fs-xs);
}

.pv-steps__text strong {
	color: var(--text);
	font-size: var(--fs-base);
}

.pv-steps__item.is-done .pv-steps__num {
	border-color: var(--success);
	background: var(--success);
	color: var(--text-on-accent);
}

.pv-steps__item.is-current {
	background: var(--accent-soft);
}

.pv-steps__item.is-current .pv-steps__num {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--text-on-accent);
}

.pv-panel {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px 18px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
	font-size: var(--fs-base);
}

.pv-panel p {
	margin: 0;
}

.pv-panel__title {
	margin: 0;
	font-size: var(--fs-md);
}

.pv-panel__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
}

/* 出るグループを選ぶ */
.pv-groups {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 8px;
}

.pv-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--border);
	border-left: 4px solid var(--group-color, var(--accent));
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}

.pv-group:hover,
.pv-group:focus-visible {
	border-color: var(--group-color, var(--accent));
	box-shadow: var(--shadow-md);
}

.pv-group__name {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: var(--fs-md);
}

.pv-group__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--group-color, var(--accent));
}

.pv-group__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.pv-chip {
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--surface-muted);
	border: 1px solid var(--border);
	color: var(--text-muted);
	font-size: var(--fs-2xs);
}

.pv-chip--on {
	border-color: var(--accent-border);
	background: var(--accent-soft);
	color: var(--accent-text);
}

.pv-chip--warn {
	border-color: var(--warning-border);
	background: var(--warning-soft);
	color: var(--warning);
}

.pv-empty {
	color: var(--text-muted);
}

/* 出た商品の説明 */
.pv-facts {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
}

.pv-facts__row {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	gap: 10px;
}

.pv-facts dt {
	color: var(--text-muted);
	font-size: var(--fs-xs);
	font-weight: 600;
}

.pv-facts dd {
	margin: 0;
}

/* アプリの画面の中: 詳細の下の「1 回引く」 */
.app-cta-bar {
	position: sticky;
	bottom: -12px;
	margin: 12px -12px -12px;
	padding: 10px 12px 14px;
	background: linear-gradient(rgba(255, 255, 255, 0), #ffffff 30%);
}

.app-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 12px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #ff5e8a, #ff3d71 50%, #9b4dff);
	box-shadow: 0 6px 16px rgba(255, 61, 113, 0.35);
	color: #ffffff;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.app-cta__price {
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.22);
	font-size: 12px;
}

/* 抽選中 */
.app-screen--wait {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: #15151f;
	color: #ffffff;
}

.app-wait__spinner {
	width: 44px;
	height: 44px;
	border: 4px solid rgba(255, 255, 255, 0.2);
	border-top-color: #ff3d71;
	border-radius: 50%;
	animation: app-spin 0.9s linear infinite;
}

.app-wait__text {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.1em;
}

@keyframes app-spin {
	to {
		transform: rotate(360deg);
	}
}

/* 演出 */
.app-screen--effect {
	display: flex;
	align-items: center;
	justify-content: center;
}

.app-screen--effect video {
	width: 100%;
	border-radius: 12px;
}

.app-effect__none {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	color: rgba(255, 255, 255, 0.6);
}

.app-effect__none p {
	margin: 0;
	font-size: 13px;
}

.app-effect__burst {
	color: #ffb400;
	font-size: 44px;
}

/* 出た商品 */
.app-screen--result {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: radial-gradient(circle at 50% 35%, #3a2a5e 0%, #15151f 70%);
	text-align: center;
}

.app-result__label {
	margin: 0;
	color: #ffb400;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: 0.08em;
}

.app-result__group {
	padding: 2px 12px;
	border: 1px solid var(--group-color, #ffb400);
	border-radius: 999px;
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
}

.app-result__card {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 62%;
	aspect-ratio: 5 / 7;
	margin: 6px 0;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.08);
	box-shadow: 0 0 40px rgba(255, 180, 0, 0.35);
	overflow: hidden;
}

.app-result__card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.app-result__noimage {
	color: rgba(255, 255, 255, 0.5);
	font-size: 20px;
	font-weight: 700;
}

.app-result__name {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
}

.app-result__points {
	margin: 0;
	color: rgba(255, 255, 255, 0.7);
	font-size: 12px;
}

.app-result__points strong {
	color: #00d39b;
	font-size: 15px;
}

.app-result__empty {
	margin: 20px 0 0;
	color: rgba(255, 255, 255, 0.6);
	font-size: 13px;
}

@media (max-width: 900px) {
	.pv {
		grid-template-columns: 1fr;
	}

	.pv-phone {
		position: static;
		max-width: 380px;
	}
}

/* オリパの権限 (段階)。閲覧〜削除の列をまとめた 1 つの切り替え */
.segmented {
	display: inline-flex;
	width: 100%;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	overflow: hidden;
}

.segmented__item {
	flex: 1 1 0;
	cursor: pointer;
}

.segmented__item + .segmented__item {
	border-left: 1px solid var(--border-strong);
}

.segmented__item input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.segmented__item span {
	display: block;
	padding: 6px 4px;
	text-align: center;
	font-size: var(--fs-sm);
	white-space: nowrap;
}

.segmented__item:hover span {
	background: var(--surface-muted);
}

.segmented__item input:checked + span {
	background: var(--accent);
	color: var(--text-on-accent);
	font-weight: 600;
}

.segmented__item input:focus-visible + span {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}

.oripa-filter__range {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 6px;
}

.oripa-filter__range .field__input {
	min-width: 0;
}

/* 複数を選ぶ欄 */
.multi-select {
	position: relative;
}

.multi-select__summary {
	overflow: hidden;
	list-style: none;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
}

.multi-select__summary::-webkit-details-marker {
	display: none;
}

.multi-select__summary::after {
	content: "▾";
	float: right;
	color: var(--text-muted);
}

.multi-select__panel {
	position: absolute;
	z-index: 10;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	max-height: 260px;
	padding: 6px 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-md);
	overflow: auto;
}

.multi-select__option {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 5px 8px;
	font-size: var(--fs-sm);
	cursor: pointer;
}

.multi-select__option:hover {
	background: var(--surface-muted);
}

/* ブランドの絞り込み (ほかの絞り込みと同じ multi-select)。開いた欄は右に揃える */
.prize-items__brand .multi-select__summary {
	min-width: 10rem;
	max-width: 14rem;
}

.prize-items__brand .multi-select__panel {
	left: auto;
	min-width: 12rem;
}

.oripa-loss {
	color: var(--danger);
}

/* 今の条件の札 (× で 1 つずつ外す) */
.condition-chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
}

.condition-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 6px 3px 10px;
	border: 1px solid var(--accent-border);
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent-text);
	font-size: var(--fs-xs);
}

.condition-chip:hover {
	text-decoration: none;
	border-color: var(--accent);
}

.condition-chip__x {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--accent-border);
	font-size: var(--fs-2xs);
}

.condition-chip:hover .condition-chip__x {
	background: var(--accent);
	color: var(--text-on-accent);
}

.condition-chips__clear {
	margin-left: 4px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
	text-decoration: underline;
}

.condition-chips__clear:hover {
	color: var(--text);
}

.oripa-new {
	max-width: 640px;
}

/* 素材を選ぶモーダルのタブ・タグの札・アップロード */
.asset-picker__tabs {
	margin: 0;
	border-bottom: 0;
}

.asset-picker__tabs .settings-nav__link {
	border-top: 0;
	border-right: 0;
	border-left: 0;
	background: none;
	font: inherit;
	cursor: pointer;
}

.asset-picker__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.asset-picker__tag {
	padding: 2px 10px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-muted);
	font: inherit;
	font-size: var(--fs-xs);
	cursor: pointer;
}

.asset-picker__tag:hover {
	border-color: var(--accent-border);
}

.asset-picker__tag--on {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--text-on-accent);
}

.asset-picker__upload-pane {
	padding-bottom: 16px;
}

.asset-picker__search {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	gap: 8px;
}

.asset-picker__search .asset-picker__select {
	width: auto;
}

/* 表示を切り替える部分。display を持つ class より hidden を優先する */
[data-source][hidden] {
	display: none;
}

.asset-id {
	color: var(--text-subtle);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: var(--fs-2xs);
}

/* 選んだファイル・入れた URL のプレビュー (送る前に確かめる) */
.asset-file-preview {
	display: flex;
	justify-content: center;
	margin-bottom: 8px;
}

.asset-file-preview[hidden] {
	display: none;
}

.asset-file-preview__media {
	max-width: 100%;
	max-height: 200px;
	border-radius: var(--radius);
	object-fit: contain;
	background: var(--surface);
}

.asset-file-preview--url {
	justify-content: flex-start;
	margin-top: 8px;
}

/* ===== 画像の切り取り ===== */

.asset-crop-button {
	margin-top: 8px;
}

.asset-crop-button[hidden] {
	display: none;
}

.image-cropper {
	width: min(900px, 94vw);
	padding: 0;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
}

.image-cropper::backdrop {
	background: rgba(23, 27, 35, 0.55);
}

.image-cropper__head,
.image-cropper__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	padding: 12px 16px;
}

.image-cropper__foot {
	justify-content: flex-end;
}

.image-cropper__foot .field__hint {
	margin-right: auto;
}

.image-cropper__ratios {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.image-cropper__ratio {
	padding: 2px 10px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	font: inherit;
	font-size: var(--fs-xs);
	cursor: pointer;
}

.image-cropper__ratio[aria-pressed="true"] {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--text-on-accent);
}

.image-cropper__stage {
	position: relative;
	width: fit-content;
	margin: 0 auto;
	background:
		repeating-conic-gradient(#e4e7ec 0% 25%, #ffffff 0% 50%) 0 0 / 16px 16px;
	user-select: none;
}

.image-cropper__image {
	display: block;
	max-width: min(860px, 90vw);
	max-height: 62vh;
}

/* 枠の外を暗くして、切り取る範囲だけを見せる */
.image-cropper__box {
	position: absolute;
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
	cursor: move;
	touch-action: none;
}

.image-cropper__handle {
	position: absolute;
	width: 14px;
	height: 14px;
	border: 2px solid var(--accent);
	background: var(--surface);
}

.image-cropper__handle[data-handle="nw"] {
	top: -8px;
	left: -8px;
	cursor: nwse-resize;
}

.image-cropper__handle[data-handle="ne"] {
	top: -8px;
	right: -8px;
	cursor: nesw-resize;
}

.image-cropper__handle[data-handle="sw"] {
	bottom: -8px;
	left: -8px;
	cursor: nesw-resize;
}

.image-cropper__handle[data-handle="se"] {
	right: -8px;
	bottom: -8px;
	cursor: nwse-resize;
}

/* 長いファイル名でも枠からはみ出さない */
.asset-dropzone {
	min-width: 0;
	text-align: center;
}

.asset-dropzone__title,
.asset-dropzone__note {
	max-width: 100%;
	overflow-wrap: anywhere;
}

/* ===== ログのタブ ===== */

.lg-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 10px 16px;
	margin-bottom: 14px;
}

.panel__header.lg-head {
	margin-bottom: 0;
}

.lg-head__note {
	margin: 2px 0 0;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.lg-empty {
	margin: 0;
	padding: 24px 16px;
	border: 1px dashed var(--border-strong);
	border-radius: var(--radius);
	color: var(--text-muted);
	text-align: center;
}

.lg-waiting {
	border-style: dashed;
	background: var(--surface-muted);
}

.lg-waiting__title {
	margin: 0;
	font-weight: 700;
}

.lg-waiting__text {
	margin: 4px 0 0;
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

/* 抽選順の進み具合 */
.lg-progress {
	margin-bottom: 16px;
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface-muted);
}

.lg-progress__nums {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	color: var(--text-muted);
}

.lg-progress__nums strong {
	color: var(--text);
	font-size: var(--fs-xl);
	font-variant-numeric: tabular-nums;
}

.lg-progress__rate {
	color: var(--accent-text);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.lg-progress__bar {
	height: 8px;
	margin: 8px 0;
	border-radius: 999px;
	background: var(--border);
	overflow: hidden;
}

.lg-progress__bar span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--accent);
}

.lg-progress__note {
	margin: 0;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.lg-draws__user {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
}

/* 長いログは枠の中でスクロールする (見出しの行・日付は上に留める) */
.lg-scroll {
	max-height: min(480px, 60vh);
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.lg-days.lg-scroll {
	padding: 0 16px 4px;
}

.lg-draws thead th {
	position: sticky;
	top: 0;
	z-index: 1;
}

/* 種類の色。札・点・絞り込みで同じ色を使う */
.lg-kind--status {
	--kind: #7a5ab8;
	--kind-soft: #f3effa;
}

.lg-kind--basics {
	--kind: var(--accent);
	--kind-soft: var(--accent-soft);
}

.lg-kind--rules {
	--kind: #2f7f8a;
	--kind-soft: #ebf5f6;
}

.lg-kind--content {
	--kind: #b06a2c;
	--kind-soft: #fbf1e7;
}

.lg-kind--prizes {
	--kind: var(--success);
	--kind-soft: var(--success-soft);
}

.lg-kind--order {
	--kind: #a5527a;
	--kind-soft: #f9eef3;
}

.lg-kind--trash {
	--kind: var(--text-muted);
	--kind-soft: var(--surface-muted);
}

.lg-kind {
	display: inline-block;
	margin-right: 8px;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--kind-soft);
	color: var(--kind);
	font-size: var(--fs-2xs);
	font-weight: 700;
	vertical-align: 1px;
	white-space: nowrap;
}

/* 絞り込み */
.lg-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.lg-filter__item {
	padding: 3px 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-muted);
	font: inherit;
	font-size: var(--fs-xs);
	cursor: pointer;
}

.lg-filter__item:hover {
	border-color: var(--border-strong);
	color: var(--text);
}

.lg-filter__item.is-active {
	border-color: var(--kind, var(--text));
	background: var(--kind-soft, var(--text));
	color: var(--kind, var(--text-on-accent));
	font-weight: 700;
}

/* まだ公開していない (中身の無い) もの。規約の言語のタブ */
.lg-filter__count {
	margin-left: 6px;
	font-size: var(--fs-2xs);
	font-weight: 400;
	opacity: 0.7;
}

/* 日ごとのタイムライン */
.lg-day + .lg-day {
	margin-top: 2px;
}

.lg-day__date {
	position: sticky;
	top: 0;
	z-index: 2;
	margin: 0 -16px 4px;
	padding: 5px 16px 4px;
	border-bottom: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-muted);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.02em;
}

.lg-hist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lg-hist__item {
	position: relative;
	display: grid;
	grid-template-columns: 48px 12px minmax(0, 1fr);
	gap: 0 12px;
	padding: 0 0 8px;
}

/* 点をつなぐ線 */
.lg-hist__item:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 16px;
	bottom: 0;
	left: calc(48px + 12px + 5px);
	width: 2px;
	background: var(--border);
}

.lg-hist__time {
	padding-top: 2px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.lg-hist__dot {
	position: relative;
	z-index: 1;
	width: 12px;
	height: 12px;
	margin-top: 5px;
	border: 2px solid var(--surface);
	border-radius: 50%;
	background: var(--kind);
	box-shadow: 0 0 0 1px var(--kind);
}

.lg-hist__body {
	min-width: 0;
}

.lg-hist__title {
	margin: 0;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.lg-hist__details {
	margin: 4px 0 0;
	padding: 6px 10px;
	border-radius: var(--radius);
	background: var(--surface-muted);
	border: 1px solid var(--border);
	list-style: none;
	font-size: var(--fs-sm);
}

.lg-hist__details li {
	overflow-wrap: anywhere;
}

.lg-hist__details li + li {
	margin-top: 2px;
}

.lg-hist__actor {
	margin: 2px 0 0;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

@media (max-width: 600px) {
	.lg-hist__item {
		grid-template-columns: 40px 12px minmax(0, 1fr);
		gap: 0 8px;
	}

	.lg-hist__item:not(:last-child)::after {
		left: calc(40px + 8px + 5px);
	}
}

/* ===== 予約公開の小窓 (帯) ===== */

.schedule-dialog {
	width: min(560px, calc(100vw - 32px));
	max-height: 90vh;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow-md);
}

.schedule-dialog::backdrop {
	background: rgba(23, 27, 35, 0.4);
}

.schedule-dialog__head {
	padding: 18px 20px 0;
}

.schedule-dialog__title {
	margin: 0;
	font-size: var(--fs-md);
}

.schedule-dialog__lead {
	margin: 4px 0 0;
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

.schedule-dialog__body {
	padding: 16px 20px 4px;
}

.schedule-dialog__body .field {
	margin-bottom: 0;
}

.schedule-dialog__ends {
	margin: 14px 0 0;
	padding: 10px 12px;
	border-radius: var(--radius);
	background: var(--surface-muted);
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.schedule-dialog__foot {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 16px;
	padding: 12px 20px;
	border-top: 1px solid var(--border);
	background: var(--surface-muted);
}

/* ログのタブ: 抽選順の地図 (引かれた口はグレー) と、1 回で出たカード */
.lg-order {
	margin: 4px 0 8px;
}

.lg-order .order-map {
	margin-bottom: 0;
	background: var(--surface);
}

.order-map__cell--drawn {
	background: var(--border-strong);
	opacity: 0.7;
}

/* 在庫に無くなった口: 赤い枠と斜線 (引かれた口でも分かるよう、色ではなく形で出す) */
.order-map__cell--missing {
	outline: 2px solid var(--danger);
	outline-offset: -2px;
	background-image: repeating-linear-gradient(
		45deg,
		transparent 0 3px,
		rgba(201, 54, 82, 0.55) 3px 5px
	);
	opacity: 1;
}

.order-legend__drawn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

.lg-draws td {
	vertical-align: top;
}

.lg-draws__cards {
	white-space: normal;
	min-width: 320px;
}

.lg-draws__range {
	margin: 0 0 6px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.lg-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lg-card {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	padding: 4px 8px 4px 4px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.lg-card__img {
	flex: none;
	width: 28px;
	height: 39px;
	border-radius: 3px;
	object-fit: cover;
	background: var(--surface-muted);
}

.lg-card__img--none {
	display: grid;
	place-items: center;
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	font-weight: 700;
}

.lg-card__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.lg-card__name {
	overflow: hidden;
	font-size: var(--fs-xs);
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lg-card__meta {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	white-space: nowrap;
}

.lg-card__dot {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 2px;
}

/* 日時・引いた人・口数は中身の幅だけ。残りを出たカードに回す */
.lg-draws th:not(:last-child),
.lg-draws td:not(:last-child) {
	width: 1%;
}

/* ===== 公開中の一覧: カテゴリの札と表示順 ===== */

.category-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--border);
}

.category-tabs__item {
	padding: 5px 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font-size: var(--fs-sm);
	text-decoration: none;
}

.category-tabs__item:hover {
	border-color: var(--border-strong);
	background: var(--surface-muted);
}

.category-tabs__item[aria-current="page"] {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--text-on-accent);
	font-weight: 700;
}

.data-table .display-order__handle-col {
	width: 1%;
	padding-right: 0;
}

.display-order__handle {
	padding: 4px 6px;
	border: 0;
	border-radius: 4px;
	background: none;
	color: var(--text-subtle);
	font: inherit;
	letter-spacing: -2px;
	cursor: grab;
}

.display-order__handle:hover {
	background: var(--surface-muted);
	color: var(--text);
}

.display-order__row--scheduled td {
	background: repeating-linear-gradient(
		-45deg,
		var(--surface),
		var(--surface) 8px,
		var(--surface-muted) 8px,
		var(--surface-muted) 16px
	);
}

.display-order__row--scheduled td {
	color: var(--text-muted);
}

.display-order__row--scheduled .asset-row,
.display-order__row--scheduled .data-table__strong {
	opacity: 0.65;
}

.display-order__row--dragging td {
	background: var(--accent-soft);
	opacity: 0.6;
}

.display-order__row--saved td {
	background: var(--success-soft);
	transition: background 0.6s ease;
}

.display-order--saving {
	cursor: progress;
}

/* ===== 使われている場所 (素材・カテゴリ・タグの詳細) ===== */

.usage-head {
	margin-bottom: 0;
}

.usage-head .panel__title {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.usage-head__count {
	color: var(--text-muted);
	font-size: var(--fs-xs);
	font-weight: 400;
}

.usage-head__note {
	margin: 2px 0 0;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.usage-empty {
	margin: 0;
	padding: 18px 16px;
	border: 1px dashed var(--border-strong);
	border-radius: var(--radius);
	color: var(--text-muted);
	text-align: center;
}

.usage-table {
	max-height: min(420px, 60vh);
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.usage-table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
}

.usage-table td {
	white-space: normal;
}

.usage-table__kind {
	display: inline-block;
	margin-right: 8px;
	padding: 1px 8px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface-muted);
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	white-space: nowrap;
}

.data-table td.usage-table__open {
	width: 1%;
	text-align: right;
	white-space: nowrap;
}

/* 「使われている場所」から飛んだ先 (#group-… / #item-…) を少し目立たせる */
.prize-group:target,
tr:target td {
	box-shadow: inset 0 0 0 2px var(--accent-border);
	scroll-margin-top: 16px;
}

/* ===== サービスユーザー ===== */

.tag--danger {
	border-color: var(--danger-border);
	background: var(--danger-soft);
	color: var(--danger);
}

.btn-link--danger {
	color: var(--danger);
}

.field--check {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: var(--fs-sm);
}

.user-avatar {
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--surface-muted);
	border: 1px solid var(--border);
	object-fit: cover;
}

.user-avatar--md {
	width: 48px;
	height: 48px;
}

.user-avatar--lg {
	width: 72px;
	height: 72px;
}

/* 頭文字の大きさは丸の大きさに合わせる (段ではなく直に書く) */
.user-avatar--text {
	display: inline-grid;
	place-items: center;
	color: var(--text-muted);
	font-size: 16px;
	font-weight: 700;
}

.user-avatar--md.user-avatar--text {
	font-size: 20px;
}

.user-avatar--lg.user-avatar--text {
	font-size: 30px;
}

/* ランクの札 (下のランクほど落ち着いた色、上ほど目立つ色) */
.rank-tag {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--surface-muted);
	border: 1px solid var(--border);
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	font-weight: 700;
	white-space: nowrap;
}

.rank-tag--bronze {
	border-color: #e2c4a4;
	background: #fbf3ea;
	color: #94622f;
}

.rank-tag--silver {
	border-color: #cfd5dd;
	background: #f3f5f8;
	color: #5c6672;
}

.rank-tag--gold {
	border-color: #ead48e;
	background: #fdf8e6;
	color: #8a6a12;
}

.rank-tag--platinum {
	border-color: #b9d6e6;
	background: #eef7fb;
	color: #2f6d8a;
}

.rank-tag--champion {
	border-color: #d8b9ec;
	background: #f6eefc;
	color: #7a3fa6;
}

/* 詳細の見出し: 画像・名前と札・ID などの小さな表・右に操作 */
.user-hero {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 20px;
	margin-bottom: 16px;
	padding: 20px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
}

.user-hero__main {
	flex: 1 1 360px;
	min-width: 0;
}

.user-hero__name {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin: 0 0 10px;
	font-size: var(--fs-xl);
}

.user-hero__text {
	margin-right: 4px;
	overflow-wrap: anywhere;
}

.user-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 24px;
	margin: 0;
	font-size: var(--fs-sm);
}

.user-hero__meta div {
	display: flex;
	gap: 6px;
	min-width: 0;
}

.user-hero__meta dt {
	color: var(--text-muted);
}

.user-hero__meta dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.user-hero__meta code {
	font-size: var(--fs-xs);
}

.user-hero__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	margin-left: auto;
}

.user-hero__group,
.user-hero__group form {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

@media (max-width: 720px) {
	.user-hero__actions {
		align-items: flex-start;
		margin-left: 0;
	}

	.user-hero__group {
		justify-content: flex-start;
	}
}

/* 止めている理由の掲示 (BAN・休止・休止の予約・退会) */
.user-notice {
	margin-bottom: 16px;
	padding: 14px 18px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface-muted);
	font-size: var(--fs-sm);
}

.user-notice--danger {
	border-color: var(--danger-border);
	background: var(--danger-soft);
}

.user-notice--warning {
	border-color: var(--warning-border);
	background: var(--warning-soft);
}

.user-notice--info {
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.user-notice__title {
	margin: 0;
	font-weight: 700;
}

.user-notice--danger .user-notice__title {
	color: var(--danger);
}

.user-notice--warning .user-notice__title {
	color: var(--warning);
}

.user-notice--info .user-notice__title {
	color: var(--accent-text);
}

.user-notice__list {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 4px 16px;
	margin: 10px 0 0;
}

.user-notice__list dt {
	color: var(--text-muted);
}

.user-notice__list dd {
	margin: 0;
}

.user-notice__list .tag {
	margin-left: 8px;
}

.user-notice__text {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.user-tabs {
	margin-bottom: 16px;
}

/* タブの中身: 枠を同じ間隔で縦に積む */
.user-stack {
	display: grid;
	gap: 16px;
}

.user-stack > .panel--spaced {
	margin-top: 0;
}

/* 1 つの枠。見出しの行の下に中身 (ほかの画面の枠と同じく、線では分けない) */
.user-panel__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
}

.user-panel__heading {
	min-width: 0;
}

.user-panel__note {
	margin: 4px 0 0;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.user-panel__body {
	padding: 20px;
}

/* 表は枠いっぱいに */
.user-panel__body--flush {
	padding: 0;
}

.user-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.user-grid--single {
	grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 960px) {
	.user-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* 左右に並ぶ枠の片側なので 2 × 2 */
.user-stats {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-rank {
	margin-top: 16px;
}

.user-rank__label {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 12px;
	margin: 0;
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

.user-rank__label strong {
	color: var(--text);
}

.user-detail-list {
	grid-template-columns: 140px minmax(0, 1fr);
	gap: 10px 16px;
	font-size: var(--fs-base);
}

.user-detail-list__sub {
	display: block;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

/* 値の下の小さな操作 (SMS の認証を解除) */
.user-detail-list__action {
	margin: 4px 0 0;
	font-size: var(--fs-xs);
}

/* プロフィールの画像: 今のまま + 既定の画像の候補 */
.avatar-choices {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.avatar-choices__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.avatar-choice {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
}

.avatar-choice input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.avatar-choice:has(input:checked) {
	border-color: var(--accent);
	background: var(--accent-soft);
	box-shadow: 0 0 0 1px var(--accent);
}

.avatar-choice:has(input:focus-visible) {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.avatar-choice__label {
	padding-right: 6px;
	font-size: var(--fs-xs);
}

/* 配送先: カードを並べる */
.user-addresses {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.user-address {
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.user-address:has(.user-address__edit[open]) {
	grid-column: 1 / -1;
}

.user-address__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px;
	margin-bottom: 8px;
}

.user-address__name {
	margin: 0;
	font-weight: 700;
}

.user-address__kana {
	margin-left: 8px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
	font-weight: 400;
}

.user-address__tags {
	display: flex;
	gap: 4px;
}

.user-address__line {
	margin: 0 0 4px;
	font-size: var(--fs-sm);
}

.user-address__line--muted {
	color: var(--text-muted);
}

.user-address__edit {
	margin-top: 12px;
}

.user-address__edit > summary {
	list-style: none;
}

.user-address__edit > summary::-webkit-details-marker {
	display: none;
}

.user-address__form {
	margin-top: 12px;
	padding: 16px;
	border-radius: var(--radius);
	background: var(--surface-muted);
}

.user-address__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 16px;
}

.user-address__grid .field {
	margin: 0;
}

.user-address__actions {
	margin-top: 16px;
}

.user-address__wide {
	grid-column: 1 / -1;
}

@media (max-width: 600px) {
	.user-address__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.user-address__delete {
	margin-top: 8px;
	text-align: right;
}

/* オリパログ: 出たカード 1 枚ずつの行。右に今の状態 */
.user-log.lg-days {
	max-height: min(640px, 70vh);
}

.user-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 6px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.user-cards--flat {
	margin: 0 0 12px;
}

.user-card {
	--card-tone: var(--text-muted);
	--card-soft: var(--surface-muted);
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: start;
	gap: 10px;
	padding: 8px 10px;
	border: 1px solid var(--border);
	border-left: 3px solid var(--card-tone);
	border-radius: var(--radius);
	background: var(--surface);
}

.user-card--awaiting {
	--card-tone: var(--caution);
	--card-soft: var(--caution-soft);
}

.user-card--shipped {
	--card-tone: var(--success);
	--card-soft: var(--success-soft);
}

.user-card--exchanged {
	--card-tone: var(--accent);
	--card-soft: var(--accent-soft);
}

.user-card__body {
	min-width: 0;
}

.user-card__name {
	margin: 0;
	font-size: var(--fs-sm);
	font-weight: 600;
	overflow-wrap: anywhere;
}

.user-card__meta {
	margin: 2px 0 0;
	color: var(--text-muted);
	font-size: var(--fs-xs);
	overflow-wrap: anywhere;
}

.user-card__status {
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--card-soft);
	color: var(--card-tone);
	font-size: var(--fs-2xs);
	font-weight: 700;
	white-space: nowrap;
}

.user-ship {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.user-ship .field__input {
	width: 200px;
	max-width: 100%;
}

/* コインの付与 */
.user-grant {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr) auto;
	align-items: start;
	gap: 0 16px;
}

.user-grant .field {
	margin-bottom: 0;
}

.user-grant__submit {
	padding-top: calc(13px * 1.6 + 6px);
}

@media (max-width: 720px) {
	.user-grant {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.user-grant__submit {
		padding-top: 0;
	}
}

/* お問い合わせ・メモ */
.user-notes,
.user-inquiries {
	margin: 0;
	padding: 0;
	list-style: none;
}

.user-inquiries {
	padding: 0 16px;
}

.user-note,
.user-inquiry {
	padding: 14px 0;
}

.user-note:first-child {
	padding-top: 0;
}

.user-note + .user-note,
.user-inquiry + .user-inquiry {
	border-top: 1px solid var(--border);
}

.user-note__head,
.user-inquiry__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	margin: 0 0 6px;
	font-size: var(--fs-sm);
}

.user-note__body,
.user-inquiry__body {
	margin: 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.user-note__edit {
	margin-top: 8px;
}

/* 休止の小窓: 始まりと終わり (終わりは「無期限」で止める) */
.suspend-period {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 16px;
}

@media (max-width: 600px) {
	.suspend-period {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* 「無期限」の時は、終わりの欄を薄くして押せなくする */
.user-dialog__section:has([data-suspend-indefinite]:checked)
	.suspend-period__until
	:is(.datetime-input, [data-datetime-quick], .field__label) {
	opacity: 0.4;
	pointer-events: none;
}

/* ===== マスタ: バナー・規約・ユーザー画像 ===== */

.page-actions {
	margin: 0 0 12px;
}

.banner-list > .master-list__item + .master-list__item {
	margin-top: 10px;
}

.banner-row {
	align-items: center;
	gap: 16px;
	margin: 0;
	padding: 12px 16px;
}

.banner-row__image {
	display: block;
	flex: none;
	width: 180px;
	height: 72px;
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface-muted);
}

.banner-row__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.banner-row__text {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
	font-size: var(--fs-xs);
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.banner-row__text .master-row__name {
	font-size: var(--fs-md);
	line-height: 1.4;
}

.banner-form__link {
	margin: 0;
	padding: 0;
	border: 0;
}

.banner-form__link .segmented {
	max-width: 420px;
}

/* 選んだリンクの種類の欄だけ出す */
.banner-form__oripa,
.banner-form__external {
	display: none;
	margin-top: 10px;
}

.banner-form__link:has(input[value="oripa"]:checked) .banner-form__oripa,
.banner-form__link:has(input[value="external"]:checked) .banner-form__external {
	display: block;
}

.banner-form__period {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 22px 20px;
}

.legal-kinds {
	margin-bottom: 12px;
}

/* 日付だけの欄 (一覧の絞り込み): カレンダーは浮かせて下の欄に重ねる */
.date-input {
	position: relative;
	align-items: stretch;
}

.date-input > .field__input {
	width: 100%;
}

/* ページの下の方で開いても、下まで動かした時にカレンダーの下に余白を残す */
.calendar::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 0;
	width: 1px;
	height: 24px;
}

/* 欄が狭くても、カレンダーは決まった幅で出す (欄の幅に縮めると日が折り返して崩れる) */
.date-input .calendar {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 30;
	width: 340px;
	max-width: calc(100vw - 32px);
}

/* マスタ: ユーザー画像の候補 */
.avatar-add {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0 16px;
}

.avatar-add .field {
	flex: 1 1 360px;
	margin-bottom: 0;
}

.avatar-row__image {
	flex: none;
	width: 48px;
	height: 48px;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: var(--surface-muted);
	object-fit: cover;
}

.avatar-row__image--none {
	display: grid;
	place-items: center;
	color: var(--text-muted);
	font-size: var(--fs-2xs);
}

.avatar-row__text > span:first-child {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.avatar-row__text {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	font-size: var(--fs-xs);
}

.postal-picker {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}

/* 見出しのすぐ下にフォームが来る枠 (マスタの追加・編集など)。見出しと 1 つ目の欄を離す */
.panel__title + .form,
.panel__title + form,
.panel__title + .form-error {
	margin-top: 16px;
}

/* マスタの追加の欄: 背景画像は高さが違うので、名前・コードと同じ行にせず 1 行に置く */
.master-form__fields > [data-asset-field] {
	grid-column: 1 / -1;
	margin-top: 18px;
}

/* プロフィールの欄は横に広げすぎない */
.user-profile-form {
	max-width: 640px;
}

/* 画像の欄: 名前がまだ無い時は空の行を作らず、ボタンを画像の上端に揃える */
.asset-field {
	align-items: flex-start;
}

.asset-field__name:empty {
	display: none;
}

/* オリパの画面でカテゴリをその場で作る欄: 背景画像の下に「作る」 */
.master-create__background {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 8px 12px;
	margin-top: 8px;
}

.master-create__background .field {
	flex: 1 1 320px;
	margin-bottom: 0;
}

/* オリパログの「さらに読み込む」 */
.user-log__more {
	padding: 12px 0 8px;
	text-align: center;
}

/* お問い合わせの一覧: 1 件ずつ押すとやり取りへ */
.user-inquiry__link {
	display: block;
	margin: -14px -16px;
	padding: 14px 16px;
	color: inherit;
}

.user-inquiry__link:hover {
	background: var(--surface-muted);
	text-decoration: none;
}

.user-inquiry__body--clip {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

/* お問い合わせのやり取り (メールのスレッドのように古い順。ユーザーは左、管理者は右寄せ) */
.inquiry-thread {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.inquiry-message {
	max-width: min(720px, 88%);
	padding: 12px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--surface-muted);
}

.inquiry-message--admin {
	justify-self: end;
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.inquiry-message__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	margin: 0 0 8px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.inquiry-message__head strong {
	color: var(--text);
	font-size: var(--fs-sm);
}

.inquiry-message__text {
	margin: 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.inquiry-reply__actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 12px;
}

/* 返信の中身 (やり取りの表示と、書く欄で同じ見た目) */
.reply-content p {
	margin: 0 0 0.6em;
}

.reply-content p:last-child {
	margin-bottom: 0;
}

.reply-content ul {
	margin: 0 0 0.6em;
	padding-left: 1.4em;
}

.reply-content img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--radius);
}

/* 書く欄で押して選んだ画像 */
.reply-editor__body img {
	cursor: pointer;
}

.reply-editor__body img.is-picked {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

.reply-editor__sizes {
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

.reply-editor__sizes[hidden] {
	display: none;
}

.reply-content a {
	color: var(--accent-text);
	text-decoration: underline;
}

.reply-content b,
.reply-content strong,
.reply-b {
	font-weight: 700;
}

.reply-content i,
.reply-content em,
.reply-i {
	font-style: italic;
}

.reply-content u,
.reply-u {
	text-decoration: underline;
}

/* 返信を書く欄 */
.reply-editor {
	position: relative;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface);
}

.reply-editor:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.reply-editor__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px;
	padding: 6px;
	border-bottom: 1px solid var(--border);
}

.reply-editor__toolbar button {
	min-width: 32px;
	height: 30px;
	padding: 0 8px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: none;
	color: var(--text);
	font: inherit;
	font-size: var(--fs-sm);
	cursor: pointer;
}

.reply-editor__toolbar button:hover {
	background: var(--surface-muted);
}

.reply-editor__toolbar button.is-active {
	border-color: var(--accent-border);
	background: var(--accent-soft);
	color: var(--accent-text);
}

.reply-editor__sep {
	width: 1px;
	height: 18px;
	margin: 0 4px;
	background: var(--border);
}

.reply-editor__link {
	display: flex;
	gap: 6px;
	padding: 6px;
	border-bottom: 1px solid var(--border);
	background: var(--surface-muted);
}

.reply-editor__link .field__input {
	flex: 1;
}

.reply-editor__body {
	min-height: 200px;
	max-height: 60vh;
	padding: 12px 14px;
	overflow-y: auto;
	outline: none;
	line-height: 1.7;
	overflow-wrap: anywhere;
}

.reply-editor__status {
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

/* 選んだ画像の右下のつまみ (ドラッグで横幅を変える) */
.reply-editor__handle {
	position: absolute;
	z-index: 2;
	width: 14px;
	height: 14px;
	margin: -9px 0 0 -9px;
	border: 2px solid var(--surface);
	border-radius: 3px;
	background: var(--accent);
	box-shadow: 0 0 0 1px var(--accent);
	cursor: nwse-resize;
	touch-action: none;
}

.reply-editor__handle[hidden] {
	display: none;
}

.reply-editor__width {
	min-width: 3em;
	padding: 0 6px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
	font-variant-numeric: tabular-nums;
}

/* ===== ユーザーの操作の小窓 (休止・BAN・退会) ===== */
.user-dialog {
	width: min(600px, calc(100vw - 32px));
	max-height: min(88vh, 860px);
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: var(--surface);
	color: var(--text);
	box-shadow: 0 24px 64px rgba(23, 27, 35, 0.24);
}

.user-dialog::backdrop {
	background: rgba(23, 27, 35, 0.45);
	backdrop-filter: blur(2px);
}

.user-dialog > form {
	display: flex;
	flex-direction: column;
	max-height: inherit;
}

.user-dialog__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 18px;
	border-top: 4px solid var(--accent);
	border-radius: 14px 14px 0 0;
}

.user-dialog--danger .user-dialog__head {
	border-top-color: var(--danger);
}

.user-dialog__title {
	margin: 0;
	font-size: var(--fs-lg);
}

.user-dialog--danger .user-dialog__title {
	color: var(--danger);
}

.user-dialog__lead {
	margin: 6px 0 0;
	color: var(--text-muted);
	font-size: var(--fs-sm);
	line-height: 1.6;
}

.user-dialog__close {
	flex: none;
	width: 32px;
	height: 32px;
	margin: -4px -8px 0 0;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--text-muted);
	font-size: var(--fs-xl);
	line-height: 1;
	cursor: pointer;
}

.user-dialog__close:hover {
	background: var(--surface-muted);
	color: var(--text);
}

.user-dialog__body {
	display: grid;
	gap: 20px;
	padding: 4px 24px 24px;
	overflow-y: auto;
}

.user-dialog__section {
	display: grid;
	gap: 8px;
}

.user-dialog__label {
	margin: 0;
	font-size: var(--fs-sm);
	font-weight: 700;
}

/* 欄の見出しをそのまま区切りの見出しにする (日時の欄など) */
.user-dialog__section--field .field__label {
	font-size: var(--fs-sm);
	font-weight: 700;
}

.user-dialog__section .field {
	margin: 0;
}

.user-dialog__section .field__hint {
	margin: 0;
}

.user-dialog__foot {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 14px 24px;
	border-top: 1px solid var(--border);
	background: var(--surface-muted);
	border-radius: 0 0 14px 14px;
}

/* 切り替え (無期限など) */
.switch {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	width: fit-content;
	font-size: var(--fs-sm);
	cursor: pointer;
}

.switch input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.switch__track {
	position: relative;
	flex: none;
	width: 36px;
	height: 20px;
	border-radius: 999px;
	background: var(--border-strong);
	transition: background 0.15s;
}

.switch__track::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--surface);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
	transition: transform 0.15s;
}

.switch input:checked + .switch__track {
	background: var(--accent);
}

.switch input:checked + .switch__track::after {
	transform: translateX(16px);
}

.switch input:focus-visible + .switch__track {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* メモ: 中身と、直す欄 */
/* 中身は段落で分かれているので、文字の改行の扱いは普通に戻す */
.user-note__body.reply-content {
	white-space: normal;
}

.user-note__edit[open] > summary {
	margin-bottom: 8px;
}

.user-note__delete {
	margin-top: 8px;
	text-align: right;
}

/* バナー: 一覧 (足したばかりの行を目立たせる)・編集 (左に中身、右に管理用) */
.banner-row__memo {
	overflow: hidden;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.master-list__item.is-added > .master-row {
	border-color: var(--accent);
	background: var(--accent-soft);
	animation: banner-added 2.4s ease-out 1 both;
}

@keyframes banner-added {
	from {
		box-shadow: 0 0 0 4px var(--accent-border);
	}
	to {
		box-shadow: 0 0 0 0 transparent;
	}
}

.banner-form__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 24px 32px;
	align-items: start;
}

@media (max-width: 960px) {
	.banner-form__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* 欄どうしの間を空ける (2 列の中は .form の gap が効かない) */
.banner-form__main,
.banner-form__side {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

.banner-form__side {
	gap: 20px;
	padding: 20px;
	border-radius: var(--radius);
	background: var(--surface-muted);
}

.banner-form .switch {
	padding-top: 16px;
	border-top: 1px solid var(--border);
	width: 100%;
}

/* 種類ごとのログ: 記録の対象 (どの素材・バナーか) */
.lg-hist__target {
	margin-left: 8px;
	font-weight: 400;
	font-size: var(--fs-sm);
}

.lg-hist__target::before {
	content: "— ";
	color: var(--text-subtle);
}

/* WYSIWYG の見出し 1〜6 (規約の「第 1 条」など)。どれも太字 */
.reply-content :is(h1, h2, h3, h4, h5, h6) {
	margin: 1.1em 0 0.45em;
	font-weight: 700;
	line-height: 1.4;
}

.reply-content h1 {
	font-size: var(--fs-2xl);
}

.reply-content h2 {
	font-size: var(--fs-xl);
}

.reply-content h3 {
	font-size: var(--fs-lg);
}

.reply-content h4 {
	font-size: var(--fs-md);
}

.reply-content h5 {
	font-size: var(--fs-base);
}

.reply-content h6 {
	font-size: var(--fs-sm);
	color: var(--text-muted);
}

.reply-content > :is(h1, h2, h3, h4, h5, h6):first-child {
	margin-top: 0;
}

/* 段落の種類 (本文 / 見出し 1〜6) の選択 */
.reply-editor__block {
	height: 30px;
	padding: 0 8px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: var(--fs-sm);
}

/* 規約のような長い文を書く欄 */
.reply-editor__body--tall {
	min-height: 480px;
	max-height: 75vh;
}

.legal-form {
	max-width: 880px;
}

/* 規約を見るだけの人 (編集の権限が無い) */
.legal-view {
	max-width: 880px;
}

.legal-view__title {
	margin: 0 0 16px;
	font-size: var(--fs-lg);
}

/* ===== 売上 (/revenue) ===== */

/* 一覧の切り替え (決済 / オリパ別・配布のステータス) */
/* 一覧の上の段: 左に絞り込み、右に「作る」 */
/* 期間 (今日 / 7 日 / 30 日 / 期間指定) */
.rv-period {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin: 0 0 16px;
}

.rv-period .segmented {
	width: auto;
}

.rv-period .segmented__item span {
	padding: 6px 14px;
}

/* スマホは 1 行に収まらないので折り返す */
@media (max-width: 600px) {
	.rv-period .segmented {
		flex-wrap: wrap;
	}

	.rv-period .segmented__item span {
		padding: 6px 10px;
	}
}

.rv-period__custom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

/* 期間・並びの欄は、期間のボタンと同じ高さにそろえる */
.rv-period .field__input,
.rv-top__head .field__input {
	box-sizing: border-box;
	height: 34px;
	padding: 4px 10px;
	font-size: var(--fs-sm);
}

.rv-period .field__input {
	width: 150px;
}

.rv-period .btn {
	height: 34px;
}

/* 期間指定を選んだ時だけ日付を出す */
.rv-period:not(:has(input[value="custom"]:checked)) .rv-period__custom {
	display: none;
}

.rv-change {
	color: var(--text-muted);
	font-size: var(--fs-xs);
	font-weight: 600;
}

.rv-change--good {
	color: var(--success);
}

.rv-change--bad {
	color: var(--danger);
}

/* 指標の見方 (? を押すと開く) */
.rv-help {
	position: relative;
}

.rv-help summary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border: 1px solid var(--border-strong);
	border-radius: 50%;
	color: var(--text-muted);
	font-size: var(--fs-2xs);
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}

.rv-help summary::-webkit-details-marker {
	display: none;
}

.rv-help[open] summary {
	border-color: var(--accent);
	color: var(--accent-text);
}

.rv-help__body {
	position: absolute;
	top: 24px;
	right: 0;
	z-index: 10;
	width: min(320px, 80vw);
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
	color: var(--text);
	font-size: var(--fs-sm);
	font-weight: 400;
	line-height: 1.6;
}

/* revenue.js が画面の中に置く (JS が無ければ上の absolute のまま) */
.rv-help__body--placed {
	position: fixed;
	right: auto;
}

.rv-help__body p {
	margin: 0;
}

.rv-help__body p + p {
	margin-top: 6px;
}

/* 返金のダイアログ: 決済・付けたコイン・残高を並べ、額を入れる */
.rv-refund__summary {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.rv-refund__summary > div {
	display: grid;
	gap: 2px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface-muted);
}

.rv-refund__summary span,
.rv-refund__summary small {
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.rv-refund__summary strong {
	font-size: var(--fs-lg);
	font-variant-numeric: tabular-nums;
}

.rv-refund__summary .rv-refund__short strong {
	color: var(--danger);
}

.rv-refund__amount {
	display: flex;
	align-items: center;
	gap: 8px;
}

.rv-refund__amount .field__input {
	max-width: 200px;
	font-size: var(--fs-md);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.rv-refund__after {
	margin: 0;
	font-size: var(--fs-sm);
}

.rv-refund__after--bad {
	color: var(--danger);
}

@media (max-width: 520px) {
	.rv-refund__summary {
		grid-template-columns: 1fr;
	}
}

/* 内訳の横棒 */
.rv-breakdown {
	margin-top: 14px;
}

.rv-breakdown__bar {
	display: flex;
	height: 10px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--surface-muted);
}

.rv-breakdown__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	font-size: var(--fs-sm);
}

.rv-breakdown__legend li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.rv-breakdown__dot {
	width: 10px;
	height: 10px;
	border-radius: 3px;
}

.rv-tone--paid {
	background: #4a6fa5;
}

.rv-tone--free {
	background: #d08a4c;
}

.rv-tone--free2 {
	background: #c7a24a;
}

.rv-tone--free3 {
	background: #b36f86;
}

.rv-tone--loop {
	background: #3d8168;
}

.rv-tone--loop2 {
	background: #7fae9b;
}

.rv-split {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 8px 28px;
	margin-top: 8px;
}

.rv-subtitle {
	margin: 18px 0 0;
	color: var(--text-muted);
	font-size: var(--fs-sm);
	font-weight: 600;
}

.rv-subtitle a {
	margin-left: 8px;
	font-weight: 400;
}

.rv-top .data-table {
	margin-top: 8px;
}

/* オリパ別の見出しと並び (右に寄せる) */
.rv-top__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.rv-top__head .field__input {
	width: auto;
	padding-right: 28px;
}

/* オリパ別: 増えても画面が伸びないよう、箱の中で縦に送る (見出しは上に残す) */
.rv-top__table {
	max-height: 420px;
	margin-top: 8px;
	overflow: auto;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.rv-top__table .data-table {
	margin-top: 0;
}

.rv-top__table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: var(--surface-muted);
}

.rv-loss {
	color: var(--danger);
	font-weight: 600;
}

.rv-guide {
	margin: 0;
	padding-left: 20px;
	line-height: 1.8;
}

/* 台帳・決済の一覧 */
.rv-kind {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	color: var(--text-on-accent);
	font-size: var(--fs-xs);
	white-space: nowrap;
}

/* 色の決まっていない種類 (抽選・返金など) */
.rv-kind:not([class*="rv-tone--"]) {
	background: var(--surface-muted);
	color: var(--text);
	box-shadow: inset 0 0 0 1px var(--border);
}

.rv-plus {
	color: var(--success);
	font-weight: 600;
}

.rv-minus {
	color: var(--danger);
	font-weight: 600;
}

.rv-memo-cell {
	min-width: 160px;
	max-width: 280px;
}

.rv-memo summary {
	cursor: pointer;
	list-style: none;
}

.rv-memo summary::-webkit-details-marker {
	display: none;
}

.rv-memo__text {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	white-space: pre-wrap;
	font-size: var(--fs-sm);
}

.rv-memo__add {
	color: var(--text-subtle);
	font-size: var(--fs-xs);
}

.rv-memo__add:hover {
	color: var(--accent-text);
}

.rv-memo__form {
	display: grid;
	gap: 6px;
	margin-top: 6px;
}

.rv-memo__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: var(--fs-xs);
}

.rv-back {
	margin: 0 0 12px;
	font-size: var(--fs-sm);
}

.rv-detail {
	display: grid;
	grid-template-columns: 160px minmax(0, 1fr);
	gap: 12px 16px;
	margin: 0;
}

.rv-detail dt {
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

.rv-detail dd {
	margin: 0;
}

@media (max-width: 600px) {
	.rv-detail {
		grid-template-columns: minmax(0, 1fr);
		gap: 2px;
	}

	.rv-detail dd {
		margin-bottom: 10px;
	}
}

.rv-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.rv-inline-form {
	margin: 0;
}

.rv-wrap {
	min-width: 180px;
	white-space: normal;
}

.rv-pre {
	white-space: pre-wrap;
}

/* クーポン */
.rv-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.rv-code-input {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	text-transform: uppercase;
}

.rv-fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.rv-form-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
}

.rv-form-row--top {
	margin-top: 14px;
}

/* クーポンの「自動付与の条件」: 付けるコインのすぐ下の箱。作る画面は、入れた時だけ条件の欄を出す */
.rv-auto-grant {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface-muted);
}

.rv-auto-grant > legend {
	float: left;
	width: 100%;
	padding: 0;
}

.rv-auto-grant .field__hint {
	margin: 0;
}

.rv-only-auto-grant {
	display: grid;
	gap: 16px;
	padding-top: 12px;
	border-top: 1px solid var(--border);
}

[data-auto-grant]:not(:has(input[name="autoGrant"]:checked))
	.rv-only-auto-grant {
	display: none;
}

/* 長い表 (配った人など): 箱の中で送り、見出しは上に残す */
.rv-scroll-table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: var(--surface-muted);
}

.rv-triggers,
.rv-usage {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rv-trigger {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.rv-trigger__main {
	min-width: 0;
	flex: 1 1 280px;
}

/* ===== お知らせ (/notices) ===== */

/* タグの札 (アプリと同じ色。--notice-tag に色を入れる) */
.notice-tag {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--notice-tag) 14%, transparent);
	color: var(--notice-tag);
	font-size: var(--fs-2xs);
	font-weight: 700;
	line-height: 1.6;
	white-space: nowrap;
}

.notice-cell {
	min-width: 220px;
}

.notice-tag-chips {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	vertical-align: middle;
}

.notice-cell .notice-tag-chips {
	margin-right: 8px;
}

.notice-cell__link {
	display: block;
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.notice-notify {
	white-space: nowrap;
}

/* 送る前の確かめで理由を出した欄は、説明を隠す */
.notice-form .field--invalid > .field__hint {
	display: none;
}

/* タグ (複数選べる。選んだものはタグの色で塗る) */
.notice-tag-picks {
	margin: 0;
	padding: 0;
	border: 0;
}

.notice-tag-picks__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.notice-tag-pick {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border: 1px solid var(--border-strong);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-muted);
	font-size: var(--fs-sm);
	font-weight: 600;
	cursor: pointer;
	user-select: none;
}

.notice-tag-pick input {
	width: 14px;
	height: 14px;
	margin: 0;
	accent-color: var(--notice-tag);
}

.notice-tag-pick:has(input:checked) {
	border-color: var(--notice-tag);
	background: color-mix(in srgb, var(--notice-tag) 14%, transparent);
	color: var(--notice-tag);
}

.notice-tag-pick:has(input:focus-visible) {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.notice-tag-picks--invalid .notice-tag-pick {
	border-color: var(--danger-border);
}

/* 選んだリンク先・対象の欄だけ出す */
.notice-form__content,
.notice-form__all,
.notice-form__conditions,
.notice-form__users {
	display: none;
	margin-top: 10px;
}

.notice-form__link:has(input[value="content"]:checked) .notice-form__content,
.notice-form__audience:has(input[value="all"]:checked) .notice-form__all,
.notice-form__audience:has(input[value="conditions"]:checked)
	.notice-form__conditions,
.notice-form__audience:has(input[value="users"]:checked) .notice-form__users {
	display: block;
}

.notice-form__notify {
	max-width: 260px;
}

.notice-form__actions {
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.notice-form__actions .reply-editor__status {
	margin-right: auto;
}

.notice-users__search {
	position: relative;
	max-width: 480px;
}

.notice-users__candidates {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	right: 0;
	left: 0;
	max-height: 280px;
	margin: 0;
	padding: 4px;
	overflow-y: auto;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
	list-style: none;
}

.notice-users__candidate {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 8px 10px;
	border: 0;
	border-radius: 8px;
	background: none;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.notice-users__candidate:hover:not(:disabled) {
	background: var(--surface-muted);
}

.notice-users__candidate:disabled {
	cursor: default;
	opacity: 0.55;
}

.notice-users__empty {
	padding: 8px 10px;
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

.notice-users__table {
	max-height: 320px;
	margin-top: 8px;
	overflow-y: auto;
}

.notice-users__table:has(tbody:empty) {
	display: none;
}

/* タグの画面 */
.notice-tag-form {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px 24px;
}

.notice-tag-fields {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 16px 24px;
}

.notice-tag-fields .field {
	margin: 0;
}

.notice-tag-fields .field__input {
	width: 220px;
}

/* 入力欄と同じ高さに揃える */
.notice-color,
.notice-tag-fields__preview {
	display: flex;
	align-items: center;
	min-height: 42px;
}

.notice-color {
	gap: 6px;
}

.notice-color__swatch {
	width: 24px;
	height: 24px;
	padding: 0;
	border: 2px solid var(--surface);
	border-radius: 50%;
	background: var(--notice-tag);
	box-shadow: 0 0 0 1px rgb(0 0 0 / 12%);
	cursor: pointer;
	transition: box-shadow 0.12s ease;
}

.notice-color__swatch[aria-pressed="true"] {
	box-shadow: 0 0 0 2px var(--notice-tag);
}

.notice-color__input {
	width: 32px;
	height: 28px;
	margin-left: 6px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: none;
	cursor: pointer;
}

.notice-tag-fields__preview .notice-tag {
	font-size: var(--fs-xs);
}

.notice-tag-row__count {
	margin-right: auto;
	font-size: var(--fs-xs);
}

/* 直す欄は行の下に出す (持ち手には重ねない) */
.notice-tag-edit {
	margin: -4px 0 8px 30px;
	padding: 16px;
	border: 1px solid var(--border);
	border-top: 0;
	border-radius: 0 0 var(--radius) var(--radius);
	background: var(--surface-muted);
}

.notice-tag-edit[hidden] {
	display: none;
}

.notice-tag-edit__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
}

.notice-tag-edit__delete {
	margin-left: auto;
}

/* ===== 一覧の作り: 部品の上書き (元の部品より後に置く) ===== */

.metric--loss .metric__value {
	color: var(--danger);
}

/* 「まで」の欄のカレンダーは右に揃えて、画面の外に出さない */
.filter-bar__range > .date-input:last-child .calendar {
	right: 0;
	left: auto;
}

.filter-bar__range .date-input {
	width: 10.5rem;
}

.filter-bar .multi-select__summary {
	min-width: 10rem;
	max-width: 16rem;
}

.asset-row .cell-sub {
	white-space: nowrap;
}

/* 選んだ条件の札は帯のすぐ下 */
.panel > .condition-chips {
	margin: 0;
	padding: 10px 16px;
	border-bottom: 1px solid var(--border);
	background: var(--surface-muted);
}

/* 狭い幅では 1 行に 1 つ。範囲の 2 つの欄は分け合う */
@media (max-width: 600px) {
	.filter-bar__item {
		flex: 1 1 100%;
	}

	.filter-bar__item .multi-select {
		flex: 1;
	}

	.filter-bar .multi-select__summary {
		max-width: none;
	}

	.filter-bar__range .field__input,
	.filter-bar__range .date-input {
		flex: 1;
		width: auto;
		min-width: 0;
	}
}

/* ===== 配送 (全員の配送待ち) ===== */
.ship-card {
	display: flex;
	align-items: center;
	gap: 12px;
	color: inherit;
	text-decoration: none;
}

.ship-card--large {
	align-items: flex-start;
	gap: 16px;
}

.ship-card--large p {
	margin: 0 0 6px;
}

.ship-thumb {
	flex: none;
	width: 40px;
	height: 56px;
	object-fit: cover;
	border-radius: 4px;
	background: var(--surface-muted);
	border: 1px solid var(--border);
}

.ship-thumb--large {
	width: 120px;
	height: 168px;
}

.ship-flow {
	display: grid;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ship-step__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 14px 20px;
	border-bottom: 1px solid var(--border);
	font-size: var(--fs-md);
}

.ship-step__num {
	display: inline-grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
	font-size: var(--fs-sm);
}

.ship-step__body {
	padding: 16px 20px;
}

.ship-address {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 6px 16px;
	margin: 0 0 8px;
}

.ship-address dt {
	color: var(--text-muted);
}

.ship-address dd {
	margin: 0;
}

.ship-form {
	display: grid;
	gap: 8px;
	max-width: 420px;
}

/* ===== メンテナンス (アプリのバージョン) ===== */

/* iOS / Android のカードを横に並べる。狭い幅では縦に積む */
.mt-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
	gap: 20px;
	align-items: start;
}

.mt-card__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
}

.mt-card__tags {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* 今の状態の札。表の中の札より少し大きく、一目で読めるように */
.mt-tag {
	padding: 3px 10px;
	border-radius: var(--radius-pill);
	font-size: var(--fs-xs);
	font-weight: 600;
}

.mt-card__meta {
	flex-basis: 100%;
	color: var(--text-subtle);
	font-size: var(--fs-xs);
}

/* カードの中の操作 (強制アップデート / メンテナンス)。区切り線で分ける */
.mt-section {
	padding: 20px;
}

.mt-section + .mt-section {
	border-top: 1px solid var(--border);
}

/* メンテナンス中は、その段を危険の色で囲む */
.mt-section--active {
	background: var(--danger-soft);
	border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.mt-section__head {
	margin-bottom: 14px;
}

.mt-section__title {
	font-size: var(--fs-md);
	font-weight: 600;
}

.mt-section__note {
	margin-top: 2px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
}

.mt-section--active .mt-section__note {
	color: var(--danger);
	font-weight: 600;
}

/* 入力の右にアプリの画面。幅が足りなければ下に回す */
.mt-section__layout {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 20px;
	align-items: flex-start;
}

.mt-section__fields {
	display: flex;
	flex: 1 1 260px;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

.mt-section__actions {
	margin-top: 2px;
}

.mt-version {
	max-width: 10rem;
	font-variant-numeric: tabular-nums;
}

/* アプリの画面のプレビュー (アプリと同じ大きさの文字を直に書く) */
.mt-preview {
	flex: 0 0 190px;
	margin: 0 auto;
}

.mt-preview__caption {
	margin-bottom: 6px;
	color: var(--text-subtle);
	font-size: var(--fs-2xs);
	text-align: center;
}

.mt-preview__screen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 300px;
	padding: 20px 14px;
	text-align: center;
}

.mt-preview__icon {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #f1ecff;
	color: #6d50c8;
	font-size: 22px;
	font-weight: 700;
}

.mt-preview__screen--maintenance .mt-preview__icon {
	background: #fff1e0;
	color: #b45309;
}

.mt-preview__title {
	margin: 4px 0 0;
	font-size: 14px;
	white-space: nowrap;
	font-weight: 700;
}

.mt-preview__text {
	margin: 0;
	color: #4a4a57;
	font-size: 12px;
	line-height: 1.6;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.mt-preview__until {
	margin: 0;
	padding: 3px 8px;
	border-radius: 999px;
	background: #f3f3f7;
	color: #4a4a57;
	font-size: 11px;
	white-space: nowrap;
}

.mt-preview__cta {
	margin-top: 8px;
	padding: 8px 16px;
	border-radius: 999px;
	background: linear-gradient(135deg, #ff5e8a, #ff3d71 50%, #9b4dff);
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
}

/* オリパの条件: まとめて引く回数 */
.draw-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
}
.draw-options__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
}

/* 詳細の編集: 見出し・文章の角丸の背景 */
.bk-has-bg {
	background: var(--bk-bg);
	border-radius: 12px;
	padding: 10px 14px;
}
.bk-colorbtn__a--bg {
	font-size: 11px;
}

/* 見出し・文章の角丸の背景 (CMS の「背」) */
.cb--bg {
	background: var(--cb-bg);
	border-radius: 12px;
	padding: 10px 14px;
}
.draw-options__item.is-fixed {
	color: var(--text-muted, #6b6b7b);
}

/* カテゴリの「すべて」(固定の行) */
.master-row--fixed {
	background: var(--surface-muted);
	border-style: dashed;
}
.master-row__handle--fixed {
	cursor: default;
	letter-spacing: 0;
}

/* 1 つだけ選ぶプルダウン (public/single-select.js。../tcg_core と同じ)。見た目は「いくつでも選べる欄」に揃える。
   本物の select は見えないまま欄の位置に残し (値と必須の確認はそちら)、上にボタンと候補の一覧を重ねる */
.single-select {
	position: relative;
	display: inline-block;
	vertical-align: middle;
}

.single-select--md {
	display: block;
	width: 100%;
}

.single-select__native {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	pointer-events: none;
}

.single-select__trigger {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 9rem;
	text-align: left;
	cursor: pointer;
}

.single-select__trigger.field__input {
	height: var(--input-height);
	line-height: 1.6;
}

.single-select__trigger.filter-form__input {
	line-height: 30px;
}

.single-select__trigger:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.single-select__text {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 「選んでください」「すべての…」など、まだ選んでいない時の文言 */
.single-select__trigger--blank .single-select__text {
	color: var(--text-muted);
}

.single-select__trigger::after {
	content: "";
	flex: none;
	width: 6px;
	height: 6px;
	border-right: 1.5px solid var(--text-muted);
	border-bottom: 1.5px solid var(--text-muted);
	transform: translateY(-2px) rotate(45deg);
}

.single-select--open .single-select__trigger {
	border-color: var(--accent);
}

.single-select__trigger--invalid {
	border-color: var(--danger);
}

.single-select__panel {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 25;
	min-width: 100%;
	max-height: 320px;
	padding: 6px;
	overflow-y: auto;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-md);
}

/* 下に入らない時は上に開く */
.single-select--up .single-select__panel {
	top: auto;
	bottom: calc(100% + 4px);
}

.single-select__option {
	padding: 6px 10px;
	border-radius: 6px;
	font-size: var(--fs-sm);
	white-space: nowrap;
	cursor: pointer;
}

.single-select__option--nested {
	padding-left: 20px;
}

.single-select__option--blank {
	color: var(--text-muted);
}

.single-select__option:hover,
.single-select__option:focus {
	background: var(--accent-soft);
	outline: none;
}

.single-select__option[aria-selected="true"] {
	color: var(--accent);
	font-weight: 600;
}

.single-select__option[aria-disabled="true"] {
	color: var(--text-subtle);
	cursor: not-allowed;
}

.single-select__group {
	padding: 8px 10px 4px;
	color: var(--text-muted);
	font-size: var(--fs-xs);
	font-weight: 600;
}

/* 開いた一覧は枠の外まで出す (枠の下の方の欄で切れないように) */
.panel:has(.single-select--open),
.popover__panel:has(.single-select--open),
.status-step__panel:has(.single-select--open) {
	overflow: visible;
}

/* 道具の列の選ぶ欄 (文字・画像の大きさ、賞の並べ方)。single-select.js で他の画面と同じ形にし、道具の高さに合わせて小さく */
.bk-toolbar .single-select {
	width: auto;
}
.bk-toolbar .bk-select,
.bk-toolbar .bk-select.single-select__trigger {
	width: auto;
	min-width: 92px;
	height: 30px;
	/* 矢印は欄の右の端 (single-select の ::after)。左右の余白をそろえる */
	padding: 0 10px;
	font-size: var(--fs-xs);
	line-height: 28px;
}
.bk-toolbar .single-select__panel {
	min-width: 140px;
	max-height: 320px;
	overflow-y: auto;
}

/* お問い合わせ: ユーザーがアプリから付けた画像 */
.inquiry-message__images {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0 0;
}
.inquiry-message__images img {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--color-border, #e5e7eb);
}

/* ===== お問い合わせ (全員分) ===== */
.inquiry-inbox__user {
	color: inherit;
	text-decoration: none;
}
.inquiry-inbox__excerpt {
	max-width: 28rem;
	white-space: normal;
	word-break: break-word;
}

/* ===== 練習用オリパ (マスタ。08) ===== */
.practice-side__label {
	margin: 0 0 8px;
	font-size: var(--fs-sm);
	font-weight: 700;
	color: var(--text-muted);
}

/* アプリの一覧のタイルの形 (右上に「体験版」のタスキ) */
.practice-preview {
	overflow: hidden;
	border-radius: 12px;
	background: var(--surface);
	box-shadow: 0 6px 14px rgba(16, 40, 28, 0.15);
}

.practice-preview__image {
	position: relative;
	aspect-ratio: 2 / 1;
	overflow: hidden;
	background: var(--border);
}

.practice-preview__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.practice-sash {
	position: absolute;
	top: 14px;
	right: -34px;
	width: 130px;
	padding: 3px 0;
	transform: rotate(45deg);
	background: #fc1c28;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	color: #ffffff;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-align: center;
}

.practice-preview__body {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
}

.practice-preview__title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.practice-preview__price {
	color: #fc1c28;
	font-weight: 800;
}

.practice-checklist {
	display: grid;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--fs-sm);
	color: var(--text-subtle);
}

.practice-checklist li {
	display: flex;
	gap: 6px;
}

.practice-checklist li.is-ok {
	color: var(--text);
}

.practice-checklist li.is-ok span {
	color: var(--success, #1f8a4c);
	font-weight: 800;
}

.practice-items__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.practice-item {
	gap: 14px;
	align-items: center;
}

.practice-item__image {
	flex: none;
	width: 56px;
	aspect-ratio: 63 / 88;
	border-radius: 6px;
	object-fit: cover;
	background: var(--surface-muted);
}

.practice-item__image--none {
	display: grid;
	place-items: center;
	font-size: var(--fs-xs, 11px);
	color: var(--text-subtle);
}

.practice-item__text {
	display: grid;
	flex: 1;
	gap: 4px;
	min-width: 0;
}

.practice-item__name {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-weight: 700;
}

.practice-item__points {
	color: var(--text-muted);
	font-size: var(--fs-sm);
	font-variant-numeric: tabular-nums;
}

.practice-item__actions {
	display: flex;
	gap: 8px;
}

.practice-dialog {
	width: min(640px, 92vw);
}

.practice-dialog__body {
	padding: 16px;
}

.practice-form__grid {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

.practice-form__fields {
	display: grid;
	gap: 16px;
}

@media (max-width: 640px) {
	.practice-form__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
