/*
 * MySignal 通知 — styled after the notification-history demo on mysignal.jp.
 * Tokens mirror the site (single indigo accent). Dark values are set with a
 * media query rather than light-dark() so iOS 16.4–17.4 are covered.
 */

:root {
	color-scheme: light dark;
	--bg: #f5f6fa;
	--grid: rgb(15 23 42 / 0.05);
	--surface: #ffffff;
	--surface-2: #f6f7fa;
	--surface-glass: rgb(255 255 255 / 0.82);
	--text: #14151a;
	--text-2: #4b5060;
	--muted: #8a8f9c;
	--border: #e3e5ec;
	--border-subtle: #eef0f4;
	--brand: #4f46e5;
	--brand-hover: #4338ca;
	--on-brand: #ffffff;
	--danger: #dc2626;
	--shadow-window: 0 24px 60px -32px rgb(15 23 42 / 0.35);
	--shadow-float: 0 16px 40px -16px rgb(15 23 42 / 0.35);

	--font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", "Yu Gothic UI", sans-serif;
	--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
	--radius: 16px;
	--gutter: 16px;
	--appbar-h: 56px;
	--ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0a0b10;
		--grid: rgb(255 255 255 / 0.04);
		--surface: #121319;
		--surface-2: #181920;
		--surface-glass: rgb(18 19 25 / 0.8);
		--text: #ededed;
		--text-2: #a4a6ae;
		--muted: #6f717a;
		--border: #2a2b33;
		--border-subtle: #1f2027;
		--brand: #8b8dff;
		--brand-hover: #a5a7ff;
		--on-brand: #0b0b1a;
		--danger: #f87171;
		--shadow-window: 0 40px 80px -30px rgb(0 0 0 / 0.8);
		--shadow-float: 0 20px 40px -16px rgb(0 0 0 / 0.8);
	}
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
}

body {
	margin: 0;
	min-height: 100dvh;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.6;
	overflow-wrap: anywhere;
	line-break: strict;
}

/* Brand glow + grid, as behind the hero demo. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(70% 45% at 88% -5%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 70%),
		radial-gradient(50% 35% at 0% 0%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%),
		linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0 / 48px 48px,
		linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0 / 48px 48px;
	-webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 85%);
	mask-image: linear-gradient(to bottom, #000 30%, transparent 85%);
}

[hidden] {
	display: none !important;
}

button {
	font: inherit;
	color: inherit;
}

a {
	color: var(--brand);
}

:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
}

.sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.icon {
	width: 20px;
	height: 20px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon-sm {
	width: 16px;
	height: 16px;
}

.icon-xs {
	width: 12px;
	height: 12px;
}

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

/* App bar */
.appbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: calc(var(--appbar-h) + env(safe-area-inset-top));
	padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
	background: color-mix(in srgb, var(--bg) 78%, transparent);
	-webkit-backdrop-filter: saturate(1.6) blur(14px);
	backdrop-filter: saturate(1.6) blur(14px);
	border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.brand {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	margin-right: auto;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.brand-mark {
	width: 26px;
	height: 23px;
	flex: none;
	filter: drop-shadow(0 2px 3px rgb(37 99 235 / 0.35));
}

.brand-name {
	font-size: 17px;
}

.brand-sub {
	padding: 1px 7px;
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	color: var(--text-2);
}

.live {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 4px 10px;
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.1em;
	color: var(--muted);
	background: var(--surface-glass);
}

.live[data-state="live"] {
	color: var(--text);
}

.pulse {
	position: relative;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--muted);
	flex: none;
}

.live[data-state="live"] .pulse {
	background: var(--brand);
}

.live[data-state="live"] .pulse::after {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid var(--brand);
	opacity: 0;
	animation: pulse 2s ease-out infinite;
}

.live[data-state="offline"] .pulse {
	background: var(--danger);
}

@keyframes pulse {
	0% {
		transform: scale(0.5);
		opacity: 0.9;
	}
	100% {
		transform: scale(1.6);
		opacity: 0;
	}
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	flex: none;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--text-2);
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease;
}

.icon-btn:hover,
.icon-btn[aria-expanded="true"] {
	background: color-mix(in srgb, var(--text) 7%, transparent);
	color: var(--text);
}

.icon-btn-sm {
	width: 32px;
	height: 32px;
	border-radius: 9px;
}

/* Layout */
.main {
	display: grid;
	gap: 14px;
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
	padding: 16px max(var(--gutter), env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom))
		max(var(--gutter), env(safe-area-inset-left));
}

.panel {
	padding: 28px 22px;
	border: 1px solid var(--border);
	border-radius: 20px;
	background: var(--surface);
	box-shadow: var(--shadow-window);
}

.panel-center {
	display: grid;
	justify-items: center;
	gap: 14px;
	padding: 56px 22px;
	text-align: center;
}

.onboarding {
	display: grid;
	gap: 14px;
}

.kicker {
	margin: 0;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.12em;
	color: var(--brand);
}

.title {
	margin: 0;
	font-size: clamp(22px, 6.4vw, 28px);
	line-height: 1.3;
	letter-spacing: -0.01em;
	font-weight: 800;
	font-feature-settings: "palt";
}

.lead {
	margin: 0;
	color: var(--text-2);
	line-height: 1.8;
}

.note,
.hint {
	margin: 0;
	font-size: 12.5px;
	color: var(--muted);
	line-height: 1.7;
}

.note {
	display: flex;
	gap: 6px;
	align-items: flex-start;
}

.note .icon {
	margin-top: 3px;
}

.hero-mark {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	border-radius: 18px;
	background: color-mix(in srgb, var(--brand) 12%, var(--surface));
	border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}

.hero-mark svg {
	width: 36px;
	height: 32px;
	filter: drop-shadow(0 3px 6px rgb(37 99 235 / 0.35));
}

.hero-mark-muted {
	background: var(--surface-2);
	border-color: var(--border);
	color: var(--text-2);
}

.hero-mark-muted .icon {
	width: 28px;
	height: 28px;
	filter: none;
}

.steps {
	display: grid;
	gap: 10px;
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.steps li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface-2);
	counter-increment: step;
}

.steps li::before {
	content: counter(step);
	font-family: var(--mono);
	font-size: 12px;
	font-weight: 700;
	color: var(--muted);
}

.step-icon {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	flex: none;
	border-radius: 10px;
	background: var(--surface);
	border: 1px solid var(--border);
	color: #0a84ff;
}

.step-icon-brand svg {
	width: 22px;
	height: 20px;
}

.install-arrow {
	position: fixed;
	left: 50%;
	bottom: calc(10px + env(safe-area-inset-bottom));
	z-index: 30;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-left: -22px;
	border-radius: 50%;
	background: var(--brand);
	color: var(--on-brand);
	box-shadow: var(--shadow-float);
	animation: nudge 1.6s var(--ease) infinite;
}

@keyframes nudge {
	50% {
		transform: translateY(6px);
	}
}

.howto {
	display: grid;
	gap: 4px;
	margin: 0;
	padding: 14px 16px;
	border-radius: 14px;
	background: var(--surface-2);
	font-size: 13.5px;
}

.howto dt {
	margin-top: 6px;
	font-weight: 700;
}

.howto dt:first-child {
	margin-top: 0;
}

.howto dd {
	margin: 0;
	color: var(--text-2);
}

.bullets {
	margin: 0;
	padding-left: 1.2em;
	color: var(--text-2);
	display: grid;
	gap: 6px;
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: 14px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition:
		background 150ms ease,
		border-color 150ms ease,
		transform 150ms var(--ease),
		opacity 150ms ease;
	-webkit-user-select: none;
	user-select: none;
}

.btn:active {
	transform: scale(0.98);
}

.btn:disabled {
	opacity: 0.55;
	cursor: progress;
}

.btn-block {
	width: 100%;
}

.btn-sm {
	min-height: 36px;
	padding: 0 14px;
	border-radius: 10px;
	font-size: 13.5px;
}

.btn-primary {
	background: var(--brand);
	color: var(--on-brand);
	box-shadow: 0 10px 28px -10px color-mix(in srgb, var(--brand) 75%, transparent);
}

.btn-primary:hover {
	background: var(--brand-hover);
}

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

.btn-ghost:hover {
	border-color: var(--text-2);
}

.btn-soft {
	background: color-mix(in srgb, var(--brand) 12%, transparent);
	color: var(--brand);
}

.btn-soft.is-done {
	background: color-mix(in srgb, var(--brand) 20%, transparent);
}

.btn-danger-ghost {
	border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
	background: transparent;
	color: var(--danger);
}

/* Notices */
.notices {
	display: grid;
	gap: 10px;
}

.notices:empty {
	display: none;
}

.notice {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface);
	font-size: 13.5px;
	line-height: 1.55;
	animation: rise 320ms var(--ease);
}

.notice-accent {
	border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
	background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

.notice-warn {
	border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

.notice > .icon {
	color: var(--brand);
}

.notice-warn > .icon {
	color: var(--danger);
}

.notice-text {
	flex: 1;
	min-width: 0;
}

.notice .btn {
	flex: none;
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

/* Pairing card */
.pair {
	display: grid;
	gap: 12px;
	padding: 16px;
	border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
	border-radius: var(--radius);
	background:
		radial-gradient(80% 120% at 100% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%),
		var(--surface);
	animation: rise 360ms var(--ease);
}

.pair-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: -4px -6px -4px 0;
}

.pair-title {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-weight: 800;
}

.pair-title .icon {
	color: var(--brand);
	stroke-width: 3;
}

.pair-steps {
	display: grid;
	gap: 6px;
	margin: 0;
	padding-left: 1.3em;
	font-size: 13.5px;
	color: var(--text-2);
	line-height: 1.7;
}

.pair-steps strong {
	color: var(--text);
}

.pair-code {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 14px 14px 18px;
	border: 1px dashed color-mix(in srgb, var(--brand) 50%, var(--border));
	border-radius: 14px;
	background: var(--surface-2);
}

.pair-code-value {
	flex: 1;
	min-width: 0;
	font-family: var(--mono);
	font-size: clamp(22px, 7vw, 32px);
	font-weight: 800;
	letter-spacing: 0.06em;
	white-space: nowrap;
	color: var(--text);
	font-variant-numeric: tabular-nums;
	-webkit-user-select: all;
	user-select: all;
}

.pair-code.is-expired .pair-code-value {
	color: var(--muted);
	text-decoration: line-through;
}

.pair-code-side {
	display: grid;
	justify-items: end;
	gap: 6px;
}

.pair-expiry {
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.pair-code.is-expired .pair-expiry {
	color: var(--danger);
}

.btn-text {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	justify-self: start;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--brand);
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
}

.pair-linked {
	display: grid;
	gap: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--border-subtle);
}

.pair-linked-title {
	margin: 0;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	color: var(--muted);
}

.links {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.links:empty {
	display: none;
}

.link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 10px 10px 12px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	animation: rise 260ms var(--ease);
}

.link > .icon {
	color: var(--brand);
}

.link-body {
	display: grid;
	flex: 1;
	min-width: 0;
}

.link-name {
	font-weight: 700;
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.link-meta {
	font-size: 11.5px;
	color: var(--muted);
}

.field-row {
	display: flex;
	gap: 8px;
}

.input {
	flex: 1;
	min-width: 0;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface-2);
	color: var(--text);
	font: inherit;
	font-size: 16px;
}

.input:focus {
	outline: none;
	border-color: var(--brand);
}

/* History window (the hero demo, mobile-first) */
.window {
	position: relative;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-window);
	overflow: hidden;
}

.window-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 8px 8px 14px;
	border-bottom: 1px solid var(--border);
}

.dots {
	display: inline-flex;
	gap: 6px;
	margin-right: 4px;
}

.dots i {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--border);
}

.window-title {
	flex: 1;
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--text-2);
}

.count {
	margin-left: 4px;
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 600;
	color: var(--muted);
}

.bar-action {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex: none;
	height: 30px;
	padding: 0 9px;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: var(--surface-2);
	color: var(--text-2);
	font-size: 11.5px;
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background 150ms ease,
		border-color 150ms ease,
		color 150ms ease,
		transform 150ms var(--ease);
}

.bar-action:hover {
	border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
	background: color-mix(in srgb, var(--danger) 8%, var(--surface));
	color: var(--danger);
}

.bar-action:active {
	transform: scale(0.96);
}

.bar-action:disabled {
	opacity: 0.5;
	cursor: progress;
}

@media (max-width: 379px) {
	.window-bar .dots {
		display: none;
	}
}

.search {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 10px 12px 0;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface-2);
	color: var(--muted);
}

.search input {
	flex: 1;
	min-width: 0;
	height: 40px;
	border: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
	font-size: 16px; /* no zoom on iOS */
	outline: none;
}

.search:focus-within {
	border-color: var(--brand);
}

.chips {
	display: flex;
	gap: 6px;
	padding: 10px 12px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar {
	display: none;
}

.chips:empty {
	display: none;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: none;
	min-height: 32px;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-2);
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
}

.chip span {
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 600;
	color: var(--muted);
}

.chip[aria-pressed="true"] {
	border-color: var(--brand);
	background: color-mix(in srgb, var(--brand) 12%, var(--surface));
	color: var(--brand);
}

.chip[aria-pressed="true"] span {
	color: inherit;
}

.feed-head {
	display: none;
}

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

.feed-item {
	position: relative;
	border-top: 1px solid var(--border-subtle);
	transition: background 1.2s ease;
}

.feed-item:first-child {
	border-top: 0;
}

.feed-item.is-new {
	animation: feed-in 520ms var(--ease);
	background: color-mix(in srgb, var(--brand) 12%, transparent);
}

@keyframes feed-in {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
}

.feed-line {
	display: flex;
	align-items: stretch;
}

.feed-row {
	display: grid;
	flex: 1;
	min-width: 0;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"meta age"
		"title price"
		"title avg";
	column-gap: 12px;
	row-gap: 2px;
	width: 100%;
	padding: 12px 14px;
	border: 0;
	background: transparent;
	text-align: left;
	cursor: pointer;
}

.feed-item.has-url .feed-row {
	padding-right: 8px;
}

.feed-row:active {
	background: color-mix(in srgb, var(--text) 4%, transparent);
}

.feed-open {
	display: grid;
	place-items: center;
	flex: none;
	width: 48px;
	padding-right: 8px;
	color: var(--brand);
	text-decoration: none;
	cursor: pointer;
}

.feed-open:focus-visible {
	outline: none;
}

.feed-open-badge {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border));
	border-radius: 10px;
	background: color-mix(in srgb, var(--brand) 8%, var(--surface-2));
	transition:
		background 150ms ease,
		border-color 150ms ease,
		transform 150ms var(--ease);
}

.feed-open:hover .feed-open-badge {
	background: color-mix(in srgb, var(--brand) 16%, var(--surface-2));
	border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
}

.feed-open:active .feed-open-badge {
	transform: scale(0.92);
}

.feed-open:focus-visible .feed-open-badge {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
}

.feed-item.has-thumb .feed-row {
	grid-template-columns: 52px minmax(0, 1fr) auto;
	grid-template-areas:
		"thumb meta age"
		"thumb title price"
		"thumb title avg";
}

.feed-thumb {
	grid-area: thumb;
	align-self: start;
	width: 52px;
	height: 52px;
	margin-top: 2px;
	border-radius: 10px;
	object-fit: cover;
	background: var(--surface-2);
	border: 1px solid var(--border-subtle);
}

.feed-meta {
	grid-area: meta;
	display: flex;
	align-items: baseline;
	gap: 6px;
	min-width: 0;
	white-space: nowrap;
}

.feed-service {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.02em;
	color: var(--brand);
}

.feed-kw {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	font-family: var(--mono);
	font-size: 11px;
	color: var(--muted);
}

.feed-title {
	grid-area: title;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
}

.feed-price {
	grid-area: price;
	align-self: start;
	text-align: right;
	font-size: 14px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.feed-avg {
	grid-area: avg;
	align-self: start;
	text-align: right;
	font-size: 11px;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.feed-avg b {
	margin-left: 4px;
	color: var(--brand);
	font-weight: 800;
}

.feed-age {
	grid-area: age;
	text-align: right;
	font-size: 11.5px;
	color: var(--text-2);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.feed-item.is-unread .feed-row::before {
	content: "";
	position: absolute;
	left: 5px;
	top: 20px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--brand);
}

.tag {
	padding: 0 6px;
	border-radius: 5px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	font-size: 10px;
	font-weight: 700;
	color: var(--text-2);
	white-space: nowrap;
}

.tag-warn {
	border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
	color: var(--danger);
}

.feed-detail {
	display: grid;
	gap: 12px;
	padding: 0 14px 14px;
	animation: rise 220ms var(--ease);
}

.feed-gallery-wrap {
	display: grid;
	gap: 6px;
	min-width: 0;
}

.feed-gallery-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 11.5px;
	color: var(--muted);
}

.feed-gallery-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 700;
	color: var(--text-2);
}

.feed-gallery-count {
	padding: 0 6px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface-2);
	font-family: var(--mono);
	font-size: 10.5px;
	font-weight: 700;
	color: var(--text-2);
}

.feed-gallery-stage {
	position: relative;
	min-width: 0;
}

.feed-gallery {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scroll-padding-inline: 2px;
	-webkit-overflow-scrolling: touch;
	padding: 2px 2px 6px;
	scrollbar-width: thin;
	scrollbar-color: var(--border) transparent;
}

@media (pointer: coarse) {
	.feed-gallery {
		scrollbar-width: none;
	}

	.feed-gallery::-webkit-scrollbar {
		display: none;
	}
}

.feed-gallery-item {
	position: relative;
	flex: none;
	width: 88px;
	height: 88px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface-2);
	overflow: hidden;
	cursor: zoom-in;
	scroll-snap-align: start;
	transition:
		border-color 160ms ease,
		transform 160ms var(--ease);
}

.feed-gallery-item:hover {
	border-color: var(--brand);
}

.feed-gallery-item:active {
	transform: scale(0.96);
}

.feed-gallery-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 240ms var(--ease);
}

.feed-gallery-item:hover .feed-gallery-img {
	transform: scale(1.05);
}

.feed-gallery-zoom {
	position: absolute;
	right: 5px;
	bottom: 5px;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 7px;
	background: rgb(15 23 42 / 0.58);
	color: #fff;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	opacity: 0.78;
	pointer-events: none;
	transition:
		opacity 150ms ease,
		transform 150ms var(--ease);
}

.feed-gallery-item:hover .feed-gallery-zoom {
	opacity: 1;
	transform: scale(1.06);
}

.gallery-nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: var(--surface-glass);
	color: var(--text);
	box-shadow: 0 4px 12px rgb(0 0 0 / 0.16);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	cursor: pointer;
	opacity: 0.92;
	transition:
		opacity 150ms ease,
		transform 150ms var(--ease);
}

.gallery-nav:hover {
	opacity: 1;
	transform: translateY(-50%) scale(1.06);
}

.gallery-nav-prev {
	left: 4px;
}

.gallery-nav-next {
	right: 4px;
}

@media (pointer: coarse) {
	.gallery-nav {
		display: none;
	}
}

.feed-body {
	margin: 0;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--surface-2);
	font-size: 13.5px;
	line-height: 1.7;
	white-space: pre-wrap;
	color: var(--text);
}

.feed-body a {
	word-break: break-all;
}

.feed-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}

.feed-facts .tag {
	padding: 2px 8px;
	font-size: 11.5px;
}

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

.feed-actions .btn-primary {
	flex: 1;
}

.feed-time {
	font-size: 11.5px;
	color: var(--muted);
}

.feed-item.is-open {
	background: color-mix(in srgb, var(--text) 2.5%, transparent);
}

.feed-item.is-removing {
	opacity: 0;
	transform: translateX(-12px);
	transition:
		opacity 200ms ease,
		transform 200ms ease;
}

.empty {
	display: grid;
	justify-items: center;
	gap: 8px;
	padding: 44px 24px 36px;
	text-align: center;
}

.empty-mark {
	width: 54px;
	height: 48px;
	margin-bottom: 6px;
	opacity: 0.9;
	filter: drop-shadow(0 6px 14px rgb(37 99 235 / 0.35));
}

.empty-title {
	margin: 0;
	font-weight: 800;
}

.empty-text {
	margin: 0 0 8px;
	max-width: 26em;
	font-size: 13.5px;
	color: var(--text-2);
}

.feed-more {
	display: grid;
	place-items: center;
	padding: 12px;
	border-top: 1px solid var(--border-subtle);
}

.retention {
	margin: 0;
	padding: 10px 14px 12px;
	border-top: 1px solid var(--border-subtle);
	font-size: 11px;
	color: var(--muted);
	text-align: right;
}

.retention:empty {
	display: none;
}

/* Pull to refresh */
.ptr {
	display: grid;
	place-items: center;
	height: 0;
	overflow: hidden;
	transition: height 200ms var(--ease);
}

.ptr.is-pulling {
	transition: none;
}

.ptr.is-refreshing {
	height: 44px;
}

/* Desktop / tablet: the demo's three-column table. */
@media (min-width: 640px) {
	.feed-head {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 8rem 4.75rem;
		gap: 12px;
		padding: 8px 60px 8px 16px;
		border-top: 1px solid var(--border-subtle);
		border-bottom: 1px solid var(--border-subtle);
		font-size: 11px;
		letter-spacing: 0.06em;
		color: var(--muted);
	}

	.feed-head span:not(:first-child) {
		text-align: right;
	}

	.feed-row,
	.feed-item.has-thumb .feed-row {
		grid-template-columns: minmax(0, 1fr) 8rem 4.75rem;
		grid-template-areas:
			"meta price age"
			"title price age"
			"title avg age";
		align-items: center;
		padding: 12px 8px 12px 16px;
	}

	.feed-item.has-thumb .feed-row {
		grid-template-columns: 52px minmax(0, 1fr) 8rem 4.75rem;
		grid-template-areas:
			"thumb meta price age"
			"thumb title price age"
			"thumb title avg age";
	}

	.feed-open {
		width: 52px;
		padding-right: 10px;
	}

	.feed-item:not(.has-url) .feed-line {
		padding-right: 52px;
	}

	.feed-gallery-item {
		width: 96px;
		height: 96px;
	}

	.feed-price {
		align-self: end;
	}

	.feed-avg {
		align-self: start;
	}

	.feed-title {
		-webkit-line-clamp: 1;
	}

	.feed-detail {
		padding: 0 16px 16px;
	}
}

/* Toast (like the demo's "Discord に通知しました") */
.toast {
	position: fixed;
	left: 50%;
	bottom: calc(18px + env(safe-area-inset-bottom));
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: min(92vw, 420px);
	padding: 10px 16px 10px 10px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface);
	box-shadow: var(--shadow-float);
	font-size: 13.5px;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 12px);
	transition:
		opacity 220ms ease,
		transform 260ms var(--ease);
}

.toast.is-shown {
	opacity: 1;
	transform: translate(-50%, 0);
}

.toast-icon {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	flex: none;
	border-radius: 9px;
	background: var(--brand);
	color: var(--on-brand);
}

.toast-text {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Settings sheet */
.sheet {
	width: 100%;
	max-width: 560px;
	max-height: min(88dvh, 760px);
	margin: auto auto 0;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 22px 22px 0 0;
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow-float);
	overscroll-behavior: contain;
}

.sheet[open] {
	animation: sheet-in 320ms var(--ease);
}

.sheet::backdrop {
	background: rgb(0 0 0 / 0.45);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

@keyframes sheet-in {
	from {
		transform: translateY(24px);
		opacity: 0;
	}
}

@media (min-width: 640px) {
	.sheet {
		margin: auto;
		border-radius: 22px;
	}
}

.sheet-inner {
	display: grid;
	gap: 22px;
	padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
}

.sheet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-right: -8px;
}

.sheet-head h2 {
	margin: 0;
	font-size: 18px;
}

.sheet-section {
	display: grid;
	gap: 10px;
}

.sheet-section h3 {
	margin: 0;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	color: var(--muted);
}

.status-list {
	display: grid;
	margin: 0;
	border: 1px solid var(--border);
	border-radius: 14px;
	overflow: hidden;
}

.status-list div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px;
	border-top: 1px solid var(--border-subtle);
	font-size: 13.5px;
}

.status-list div:first-child {
	border-top: 0;
}

.status-list dt {
	color: var(--text-2);
}

.status-list dd {
	margin: 0;
	font-weight: 700;
	text-align: right;
}

.sheet-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	font-size: 13.5px;
}

.sheet-links a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-weight: 700;
	text-decoration: none;
}

.version {
	margin: 0;
	font-size: 11px;
	color: var(--muted);
}

.spinner {
	width: 28px;
	height: 28px;
	border: 3px solid color-mix(in srgb, var(--brand) 25%, transparent);
	border-top-color: var(--brand);
	border-radius: 50%;
	animation: spin 800ms linear infinite;
}

.spinner-sm {
	width: 20px;
	height: 20px;
	border-width: 2.5px;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.noscript {
	margin: 24px;
	text-align: center;
}

/* Lightbox (original-size image viewer) */
.lightbox {
	position: fixed;
	inset: 0;
	width: 100vw;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgb(8 9 14 / 0.94);
	color: #f4f5f8;
	overflow: hidden;
}

.lightbox::backdrop {
	background: rgb(8 9 14 / 0.88);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

.lightbox[open] {
	animation: lb-in 200ms var(--ease);
}

@keyframes lb-in {
	from {
		opacity: 0;
	}
}

.lightbox-shell {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: 100%;
	height: 100%;
}

.lightbox-bar {
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 54px;
	padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
	background: linear-gradient(to bottom, rgb(0 0 0 / 0.58), transparent);
}

.lightbox-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
	font-family: var(--mono);
	font-size: 12px;
}

.lightbox-counter {
	font-weight: 700;
	color: #fff;
}

.lightbox-counter:empty {
	display: none;
}

.lightbox-size {
	padding: 2px 8px;
	border-radius: 999px;
	background: rgb(255 255 255 / 0.12);
	color: rgb(255 255 255 / 0.85);
	font-size: 11px;
}

.lightbox-size:empty {
	display: none;
}

.lightbox-title {
	flex: 1;
	min-width: 0;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: rgb(255 255 255 / 0.82);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lightbox-tools {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: none;
	margin-left: auto;
}

.lightbox-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 36px;
	padding: 0 12px;
	border: 1px solid rgb(255 255 255 / 0.18);
	border-radius: 999px;
	background: rgb(255 255 255 / 0.11);
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	transition: background 150ms ease;
}

.lightbox-btn:hover:not(:disabled) {
	background: rgb(255 255 255 / 0.22);
}

.lightbox-btn:disabled {
	opacity: 0.45;
	cursor: default;
}

.lightbox-icon-btn {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: rgb(255 255 255 / 0.11);
	color: #fff;
	text-decoration: none;
	cursor: pointer;
	transition: background 150ms ease;
}

.lightbox-icon-btn:hover {
	background: rgb(255 255 255 / 0.22);
}

.lightbox-body {
	position: relative;
	display: grid;
	min-height: 0;
}

.lightbox-stage {
	display: flex;
	width: 100%;
	height: 100%;
	padding: 12px;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.lightbox-stage[data-zoom="fit"] {
	overflow: hidden;
}

.lightbox-stage[data-zoom="actual"],
.lightbox-stage[data-zoom="double"] {
	cursor: grab;
}

.lightbox-stage.is-dragging {
	cursor: grabbing;
	-webkit-user-select: none;
	user-select: none;
}

.lightbox-frame {
	position: relative;
	display: grid;
	place-items: center;
	margin: auto;
	transition: transform 180ms var(--ease);
}

.lightbox-stage[data-zoom="fit"] .lightbox-frame {
	width: 100%;
	height: 100%;
}

.lightbox-img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgb(0 0 0 / 0.6);
	cursor: zoom-in;
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

.lightbox-stage[data-zoom="actual"] .lightbox-img,
.lightbox-stage[data-zoom="double"] .lightbox-img {
	max-width: none;
	max-height: none;
	border-radius: 0;
	cursor: zoom-out;
}

.lightbox-spinner {
	border-color: rgb(255 255 255 / 0.22);
	border-top-color: #fff;
}

.lightbox-error {
	display: grid;
	justify-items: center;
	gap: 8px;
	padding: 24px;
	color: rgb(255 255 255 / 0.78);
	font-size: 13.5px;
	text-align: center;
}

.lightbox-nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid rgb(255 255 255 / 0.16);
	border-radius: 50%;
	background: rgb(18 19 25 / 0.65);
	color: #fff;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	cursor: pointer;
	transition: background 150ms ease;
}

.lightbox-nav:hover {
	background: rgb(18 19 25 / 0.9);
}

.lightbox-nav-prev {
	left: max(12px, env(safe-area-inset-left));
}

.lightbox-nav-next {
	right: max(12px, env(safe-area-inset-right));
}

@media (max-width: 639px) {
	.lightbox-title {
		display: none;
	}

	.lightbox-nav {
		width: 36px;
		height: 36px;
		opacity: 0.85;
	}
}

.lightbox-strip {
	display: flex;
	align-items: center;
	gap: 8px;
	overflow-x: auto;
	padding: 10px max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
	background: linear-gradient(to top, rgb(0 0 0 / 0.68), transparent);
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.lightbox-strip::-webkit-scrollbar {
	display: none;
}

.lightbox-strip::before,
.lightbox-strip::after {
	content: "";
	margin: auto;
}

.lightbox-thumb {
	flex: none;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 9px;
	overflow: hidden;
	background: rgb(255 255 255 / 0.08);
	opacity: 0.56;
	cursor: pointer;
	transition:
		opacity 150ms ease,
		border-color 150ms ease,
		transform 150ms var(--ease);
}

.lightbox-thumb.is-active {
	opacity: 1;
	border-color: #fff;
	transform: scale(1.06);
}

.lightbox-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 1ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 1ms !important;
	}

	.live[data-state="live"] .pulse::after {
		display: none;
	}
}
