/* murlog default theme
   デフォルトテーマ。--mur-* トークンを借用し SPA と体験を統一する。
   全セレクタ body.public スコープ。SPA に影響しない。 */

/* ─── Tokens / トークン ─── */

body.public {
	--mur-ink: #1d1d1f;
	--mur-paper: #ffffff;
	--mur-surface: #f5f5f7;
	--mur-accent: #3a7ca5;
	--mur-accent-soft: #eef4f8;
	--mur-muted: #86868b;
	--mur-border: #d2d2d7;
	--mur-danger: #dc2626;
	--mur-on-accent: #ffffff;
	--mur-shadow: rgba(0, 0, 0, 0.08);
	--mur-overlay: rgba(0, 0, 0, 0.6);
	--mur-badge-pending-bg: #edf2f7;
	--mur-badge-pending: #4a5568;
	--mur-badge-running-bg: #ebf8ff;
	--mur-badge-running: #2b6cb0;
	--mur-badge-done-bg: #f0fff4;
	--mur-badge-done: #276749;
	--mur-badge-failed-bg: #fff5f5;
	--mur-badge-failed: #c53030;
	--mur-row-failed-bg: rgba(229, 62, 62, 0.05);
	--mur-radius-sm: 3px;
	--mur-radius: 6px;
	--mur-text-xs: 0.6875rem;
	--mur-text-sm: 0.75rem;
	--mur-text-md: 0.875rem;
	--mur-text-base: 1rem;
	--mur-text-lg: 1.25rem;
	--mur-text-xl: 1.5rem;
}

@media (prefers-color-scheme: dark) {
	body.public {
		--mur-ink: #e5e5e7;
		--mur-paper: #161618;
		--mur-surface: #1c1c1e;
		--mur-accent: #5aaddb;
		--mur-accent-soft: #1a2a36;
		--mur-muted: #7c7c80;
		--mur-border: #303034;
		--mur-danger: #ef4444;
		--mur-on-accent: #ffffff;
		--mur-shadow: rgba(0, 0, 0, 0.3);
		--mur-overlay: rgba(0, 0, 0, 0.6);
		--mur-badge-pending-bg: #2d3748;
		--mur-badge-pending: #a0aec0;
		--mur-badge-running-bg: #1a365d;
		--mur-badge-running: #63b3ed;
		--mur-badge-done-bg: #1c4532;
		--mur-badge-done: #68d391;
		--mur-badge-failed-bg: #3b1111;
		--mur-badge-failed: #fc8181;
		--mur-row-failed-bg: rgba(252, 129, 129, 0.08);
	}
}

body.public {
	/* ─── Reset + base / リセット + 基盤 ─── */

	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family:
		-apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans",
		"Noto Sans JP", system-ui, sans-serif;
	background: var(--mur-surface);
	color: var(--mur-ink);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;

	& *,
	& *::before,
	& *::after {
		margin: 0;
		padding: 0;
		box-sizing: inherit;
	}

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

	& a:hover {
		text-decoration: underline;
	}

	/* ─── Header / ヘッダー ─── */

	.header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: var(--mur-paper);
		border-bottom: 1px solid var(--mur-border);
		padding: 12px 16px;
		position: sticky;
		top: 0;
		z-index: 10;
	}

	.header-brand {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		text-decoration: none;
		color: var(--mur-ink);
		font-weight: 600;
		font-size: var(--mur-text-md);
	}

	.header .dot-menu-btn {
		color: var(--mur-ink);
	}

	/* ─── Page title / ページタイトル ─── */

	.page-title {
		font-size: var(--mur-text-base);
		font-weight: 600;
		margin-bottom: 16px;
		padding-bottom: 12px;
		border-bottom: 1px solid var(--mur-border);
	}

	/* ─── Tabs / タブ ─── */

	.tabs {
		display: flex;
		margin-bottom: 16px;
		border: 1px solid var(--mur-border);
		border-radius: var(--mur-radius);
		overflow: hidden;
	}

	.tab {
		flex: 1;
		text-align: center;
		padding: 12px 0;
		font-size: var(--mur-text-md);
		font-weight: 500;
		color: var(--mur-muted);
		text-decoration: none;
		background: var(--mur-paper);
		border-right: 1px solid var(--mur-border);
		transition: background 0.15s;
	}

	.tab:last-child {
		border-right: none;
	}

	.tab:hover {
		background: var(--mur-surface);
		text-decoration: none;
	}

	.tab.active {
		color: var(--mur-ink);
		font-weight: 600;
		border-bottom: 2px solid var(--mur-accent);
	}

	.tab-badge {
		display: inline-block;
		width: 7px;
		height: 7px;
		margin-left: 2px;
		border-radius: 50%;
		background: var(--mur-accent);
		vertical-align: sub;
		font-size: 0;
		line-height: 0;
	}

	/* ─── Layout / レイアウト ─── */

	.screen {
		max-width: 720px;
		margin: 16px auto;
		padding: 0 16px;
	}

	.screen-wide {
		max-width: 100%;
	}

	/* ─── Card / カード ─── */

	.card {
		background: var(--mur-paper);
		border: 1px solid var(--mur-border);
		border-radius: var(--mur-radius);
		padding: 16px;
		margin-bottom: 12px;
	}

	/* ─── Form / フォーム ─── */

	.input-group {
		margin-bottom: 12px;
	}

	.input-group label {
		display: block;
		font-size: var(--mur-text-md);
		font-weight: 600;
		margin-bottom: 4px;
	}

	.input,
	.input-group input,
	.input-group textarea,
	.input-group select {
		width: 100%;
		padding: 8px 12px;
		border: 1px solid var(--mur-border);
		border-radius: var(--mur-radius);
		font-size: var(--mur-text-base);
		font-family: inherit;
		background: var(--mur-paper);
		color: var(--mur-ink);
		transition: border-color 0.15s;
	}

	.input:focus,
	.input-group input:focus,
	.input-group textarea:focus,
	.input-group select:focus {
		outline: none;
		border-color: var(--mur-accent);
	}

	/* ─── Buttons / ボタン ─── */

	.btn {
		display: inline-block;
		padding: 8px 20px;
		border: 1px solid transparent;
		border-radius: var(--mur-radius);
		cursor: pointer;
		font-size: var(--mur-text-base);
		font-family: inherit;
		font-weight: 500;
		transition:
			background 0.15s,
			border-color 0.15s,
			color 0.15s;
	}

	.btn-sm {
		padding: 4px 12px;
		font-size: var(--mur-text-sm);
	}

	.btn-primary {
		background: none;
		border: 1px solid var(--mur-accent);
		color: var(--mur-ink);
	}

	.btn-primary:hover {
		background: var(--mur-accent-soft);
	}

	.btn-primary:disabled {
		opacity: 0.5;
		cursor: not-allowed;
	}

	.btn-outline {
		background: none;
		border: 1px solid var(--mur-border);
		color: var(--mur-ink);
	}

	.btn-outline:hover {
		border-color: var(--mur-muted);
	}

	.btn-active {
		background: var(--mur-accent-soft);
		border: 1px solid var(--mur-accent);
		color: var(--mur-accent);
	}

	.btn-active:hover {
		opacity: 0.8;
	}

	/* ─── Dot menu / ドットメニュー ─── */

	.dot-menu {
		position: relative;
	}

	.dot-menu-btn {
		background: none;
		border: none;
		cursor: pointer;
		color: var(--mur-muted);
		padding: 2px;
		border-radius: var(--mur-radius-sm);
		display: flex;
		align-items: center;
		line-height: 1;
	}

	.dot-menu-btn:hover {
		color: var(--mur-ink);
		background: var(--mur-border);
	}

	.dot-menu-dropdown {
		display: none;
		position: absolute;
		right: 0;
		top: 100%;
		margin-top: 4px;
		min-width: 140px;
		background: var(--mur-paper);
		border: 1px solid var(--mur-border);
		border-radius: var(--mur-radius);
		box-shadow: 0 4px 12px var(--mur-shadow);
		overflow: hidden;
		z-index: 20;
	}

	.dot-menu.open .dot-menu-dropdown {
		display: block;
	}

	.dot-menu-dropdown a {
		display: block;
		padding: 8px 16px;
		font-size: var(--mur-text-md);
		color: var(--mur-ink);
		text-decoration: none;
	}

	.dot-menu-dropdown a:hover {
		background: var(--mur-surface);
		text-decoration: none;
	}

	.dot-menu-danger {
		color: var(--mur-danger);
	}

	.dot-menu-follow {
		display: none;
	}

	/* ─── Post header / 投稿ヘッダー ─── */

	.post-header {
		display: flex;
		justify-content: space-between;
		align-items: flex-start;
		margin-bottom: 12px;
	}

	.post-header time {
		color: var(--mur-muted);
		font-size: var(--mur-text-sm);
		white-space: nowrap;
	}

	.post-author {
		display: flex;
		align-items: center;
		gap: 12px;
	}

	.post-avatar {
		border-radius: 50%;
		flex-shrink: 0;
	}

	.post-author-name {
		font-weight: 600;
		font-size: var(--mur-text-md);
		color: var(--mur-ink);
		text-decoration: none;
	}

	.post-author-name:hover {
		text-decoration: underline;
	}

	.handle {
		display: block;
		font-size: var(--mur-text-sm);
		color: var(--mur-muted);
	}

	.post-label {
		font-size: var(--mur-text-sm);
		color: var(--mur-muted);
		margin-bottom: 8px;
	}

	/* ─── Compact post (thread context) / コンパクト投稿（スレッドコンテキスト） ─── */

	.post-compact {
		padding: 10px 16px;
		opacity: 0.85;
	}
	.post-compact .post-content {
		font-size: var(--mur-text-sm);
		line-height: 1.5;
		margin-bottom: 0;
	}
	.post-compact-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 4px;
		font-size: var(--mur-text-sm);
	}
	.post-compact-author {
		font-weight: 600;
		color: var(--mur-ink);
	}

	/* ─── Post content / 投稿本文 ─── */

	.post-content {
		font-size: var(--mur-text-base);
		line-height: 1.7;
		margin-bottom: 8px;
		overflow-wrap: break-word;
		word-break: break-word;
	}

	/* ─── Post stats / 投稿統計 ─── */

	.post-stats {
		display: flex;
		justify-content: space-between;
		margin-top: 12px;
		font-size: var(--mur-text-md);
		color: var(--mur-muted);
	}

	.post-stat {
		display: inline-flex;
		align-items: center;
		gap: 4px;
		cursor: pointer;
		background: none;
		border: none;
		padding: 0;
		color: var(--mur-muted);
		font: inherit;
	}

	.post-stat:hover {
		color: var(--mur-ink);
	}

	.post-stat svg {
		width: 16px;
		height: 16px;
		fill: none;
		stroke: currentColor;
		stroke-width: 2;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.post-stat-action:hover {
		color: var(--mur-accent);
	}

	.post-stat.active {
		color: var(--mur-accent);
	}

	/* ─── Link preview / リンクプレビュー ─── */

	.link-preview {
		display: flex;
		border: 1px solid var(--mur-border);
		border-radius: var(--mur-radius);
		overflow: hidden;
		margin-top: 8px;
		text-decoration: none;
		color: inherit;
		transition: border-color 0.15s;
	}

	.link-preview:hover {
		border-color: var(--mur-muted);
	}

	.link-preview-image {
		width: 120px;
		min-height: 80px;
		object-fit: cover;
		flex-shrink: 0;
	}

	.link-preview-body {
		padding: 8px 12px;
		min-width: 0;
		overflow: hidden;
	}

	.link-preview-title {
		font-weight: 600;
		font-size: var(--mur-text-md);
		line-height: 1.3;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.link-preview-desc {
		font-size: var(--mur-text-sm);
		color: var(--mur-muted);
		margin-top: 2px;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.link-preview-site {
		font-size: var(--mur-text-xs);
		color: var(--mur-muted);
		margin-top: 4px;
	}

	/* ─── Post media / 投稿画像 ─── */

	.post-media {
		display: grid;
		gap: 4px;
		margin: 8px 0;
		border-radius: var(--mur-radius);
		overflow: hidden;
	}

	.post-media a {
		display: block;
		overflow: hidden;
	}
	.post-media img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}
	.post-media-1 {
		grid-template-columns: 1fr;
	}
	.post-media-1 a {
		aspect-ratio: 16 / 9;
	}
	.post-media-2 {
		grid-template-columns: 1fr 1fr;
	}
	.post-media-2 a {
		aspect-ratio: 4 / 3;
	}
	.post-media-3 {
		grid-template-columns: 1fr 1fr;
	}
	.post-media-3 a:first-child {
		grid-row: 1 / 3;
		aspect-ratio: auto;
	}
	.post-media-3 a:not(:first-child) {
		aspect-ratio: 4 / 3;
	}
	.post-media-4 {
		grid-template-columns: 1fr 1fr;
	}
	.post-media-4 a {
		aspect-ratio: 4 / 3;
	}

	.post-header a:has(time) {
		color: var(--mur-muted);
	}

	/* ─── CW (Content Warning) / 閲覧注意 ─── */

	.post-cw summary {
		cursor: pointer;
		font-weight: 600;
		padding: 4px 0;
		color: var(--mur-muted);
	}

	.cw-summary {
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 6px 0;
		font-size: var(--mur-text-base);
		color: var(--mur-ink);
	}

	.cw-summary span {
		font-weight: 500;
	}

	/* ─── Compose / 投稿フォーム ─── */

	.compose textarea {
		width: 100%;
		padding: 8px 12px;
		border: 1px solid var(--mur-border);
		border-radius: var(--mur-radius);
		font-size: var(--mur-text-base);
		font-family: inherit;
		background: var(--mur-paper);
		color: var(--mur-ink);
		height: 100px;
		resize: vertical;
		transition: border-color 0.15s;
	}

	.compose textarea:focus {
		outline: none;
		border-color: var(--mur-accent);
	}

	.compose-footer {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 8px;
	}

	.compose-actions {
		display: flex;
		gap: 6px;
		align-items: center;
	}

	.char-count {
		font-size: var(--mur-text-sm);
		color: var(--mur-muted);
	}

	.char-count.over {
		color: var(--mur-danger);
		font-weight: 600;
	}

	.reply-context {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 6px 12px;
		margin-bottom: 8px;
		background: var(--mur-accent-soft);
		border-radius: var(--mur-radius);
		font-size: var(--mur-text-md);
	}

	.cw-input {
		width: 100%;
		padding: 6px 12px;
		border: 1px solid var(--mur-accent);
		border-radius: var(--mur-radius);
		font-size: var(--mur-text-md);
		font-family: inherit;
		background: var(--mur-paper);
		color: var(--mur-ink);
		margin-bottom: 6px;
	}

	.cw-input:focus {
		outline: none;
		border-color: var(--mur-accent);
	}

	.attachment-previews {
		display: flex;
		gap: 6px;
		margin-top: 8px;
		flex-wrap: wrap;
	}

	.attachment-preview {
		position: relative;
		width: 80px;
		height: 80px;
		border-radius: var(--mur-radius);
		overflow: hidden;
	}

	.attachment-preview img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.attachment-remove {
		position: absolute;
		top: 2px;
		right: 2px;
		width: 20px;
		height: 20px;
		border: none;
		border-radius: 50%;
		background: var(--mur-overlay);
		color: var(--mur-on-accent);
		font-size: var(--mur-text-sm);
		line-height: 1;
		cursor: pointer;
		padding: 0;
	}

	/* ─── User card (follow/block) / ユーザーカード ─── */

	.user-card {
		display: flex;
		justify-content: space-between;
		align-items: flex-start;
		gap: 12px;
		padding: 12px 0;
		border-bottom: 1px solid var(--mur-border);
	}

	.user-card:last-child {
		border-bottom: none;
	}

	.user-card-main {
		display: flex;
		align-items: flex-start;
		gap: 12px;
		flex: 1;
		min-width: 0;
	}

	.user-card-info {
		flex: 1;
		min-width: 0;
	}

	.user-card-info .post-author-name {
		display: block;
	}

	.user-card-info .handle {
		display: block;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.user-card-actions {
		flex-shrink: 0;
	}

	.domain-icon {
		width: 40px;
		height: 40px;
		border-radius: 50%;
		background: var(--mur-surface);
		display: flex;
		align-items: center;
		justify-content: center;
		color: var(--mur-muted);
		flex-shrink: 0;
	}

	.lookup-result {
		margin-top: 16px;
		padding-top: 16px;
		border-top: 1px solid var(--mur-border);
		display: flex;
		align-items: flex-start;
		gap: 12px;
	}

	.lookup-info {
		flex: 1;
		min-width: 0;
	}

	.lookup-bio {
		margin-top: 4px;
		font-size: var(--mur-text-md);
		color: var(--mur-muted);
		line-height: 1.5;
		overflow-wrap: break-word;
	}

	/* ─── Notifications / 通知 ─── */

	.notif {
		opacity: 0.6;
	}

	.notif-unread {
		opacity: 1;
	}

	.notif-header {
		display: flex;
		align-items: flex-start;
		gap: 12px;
	}

	.notif-icon {
		color: var(--mur-muted);
		padding-top: 2px;
		flex-shrink: 0;
	}

	.notif-body {
		flex: 1;
		min-width: 0;
	}

	.notif-actor {
		font-size: var(--mur-text-base);
	}

	.notif-preview {
		margin-top: 8px;
		margin-left: 62px;
		padding: 8px 12px;
		background: var(--mur-surface);
		border-radius: var(--mur-radius);
		font-size: var(--mur-text-md);
		line-height: 1.6;
		color: var(--mur-muted);
	}

	/* ─── Settings / 設定 ─── */

	.settings-avatar-img {
		width: 80px;
		height: 80px;
		border-radius: 50%;
		object-fit: cover;
	}

	.placeholder {
		background: var(--mur-surface);
		border: 1px dashed var(--mur-border);
	}

	.settings-avatar-placeholder {
		width: 80px;
		height: 80px;
		border-radius: 50%;
	}

	.settings-header-preview {
		width: 100%;
		height: 120px;
		border-radius: var(--mur-radius);
		overflow: hidden;
	}

	.settings-header-img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.settings-header-placeholder {
		width: 100%;
		height: 100%;
	}

	.custom-field-row {
		display: flex;
		gap: 6px;
		margin-bottom: 6px;
		align-items: center;
	}

	.custom-field-row input {
		flex: 1;
	}

	.settings-upload-actions {
		margin-top: 8px;
		display: flex;
		gap: 8px;
	}

	.settings-avatar-row {
		display: flex;
		align-items: flex-end;
		gap: 12px;
	}

	.settings-field-add {
		margin-top: 4px;
	}

	.settings-qr-placeholder {
		width: 200px;
		height: 200px;
		background: var(--mur-surface);
		border: 1px solid var(--mur-border);
		margin: 12px 0;
	}

	.settings-secret {
		font-size: var(--mur-text-xs);
		word-break: break-all;
		margin-bottom: 8px;
	}

	.card-section-actions {
		margin-top: 16px;
	}

	.card-section-desc {
		margin-bottom: 8px;
	}

	/* ─── Queue / キュー ─── */

	.queue-stats {
		display: flex;
		gap: 16px;
		justify-content: center;
	}

	.queue-stat-item {
		text-align: center;
	}

	.queue-stat-count {
		display: block;
		font-size: var(--mur-text-xl);
		font-weight: 700;
	}

	.queue-stat-failed {
		color: var(--mur-danger);
	}

	.queue-stat-label {
		font-size: var(--mur-text-sm);
		color: var(--mur-muted);
	}

	.queue-table {
		width: 100%;
		border-collapse: collapse;
		font-size: var(--mur-text-md);
	}

	.queue-table th,
	.queue-table td {
		padding: 8px 12px;
		text-align: left;
		border-bottom: 1px solid var(--mur-border);
	}

	.queue-table th {
		font-weight: 600;
		font-size: var(--mur-text-xs);
		text-transform: uppercase;
		color: var(--mur-muted);
	}

	.queue-table tbody tr {
		cursor: pointer;
		transition: background 0.15s;
	}

	.queue-table tbody tr:hover {
		background: var(--mur-surface);
	}

	.row-failed {
		background: var(--mur-row-failed-bg);
	}

	.error-cell {
		max-width: 200px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		font-size: var(--mur-text-sm);
		color: var(--mur-danger);
	}

	.badge {
		display: inline-block;
		padding: 2px 6px;
		border-radius: var(--mur-radius-sm);
		font-size: var(--mur-text-xs);
		font-weight: 600;
	}

	.badge-pending {
		background: var(--mur-badge-pending-bg);
		color: var(--mur-badge-pending);
	}
	.badge-running {
		background: var(--mur-badge-running-bg);
		color: var(--mur-badge-running);
	}
	.badge-done {
		background: var(--mur-badge-done-bg);
		color: var(--mur-badge-done);
	}
	.badge-failed,
	.badge-dead {
		background: var(--mur-badge-failed-bg);
		color: var(--mur-badge-failed);
	}

	/* ─── Login / ログイン ─── */

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

	.login svg {
		margin-bottom: 12px;
	}

	.login h1 {
		font-size: var(--mur-text-xl);
		font-weight: 700;
		letter-spacing: -0.025em;
		margin-bottom: 24px;
	}

	.login form {
		width: 100%;
		max-width: 320px;
	}

	.login .input {
		margin-bottom: 12px;
	}

	.login button {
		width: 100%;
	}

	/* ─── Card sections / カード内セクション ─── */

	.card-section {
		padding: 16px;
	}

	.card-section + .card-section {
		border-top: 1px solid var(--mur-border);
	}

	.card-section-title {
		font-size: var(--mur-text-md);
		font-weight: 600;
		margin-bottom: 12px;
	}

	/* ─── Thread / スレッド ─── */

	.thread-ancestors,
	.thread-descendants {
		margin-bottom: 2px;
	}

	.thread-link {
		display: block;
		color: inherit;
		text-decoration: none;
	}

	.thread-link:hover {
		text-decoration: none;
	}

	.thread-link .card {
		transition: background 0.15s;
	}

	.thread-link:hover .card {
		background: var(--mur-surface);
	}

	.thread-target {
		border-color: var(--mur-accent);
		border-width: 2px;
	}

	.thread-post {
		opacity: 0.85;
	}

	/* ─── Utilities / ユーティリティ ─── */

	.meta {
		font-size: var(--mur-text-sm);
		color: var(--mur-muted);
	}

	.error {
		color: var(--mur-danger);
		font-size: var(--mur-text-md);
		margin-top: 8px;
	}

	.empty {
		color: var(--mur-muted);
		padding: 24px 0;
	}

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

	/* ─── Profile / プロフィール ─── */

	.profile-header img {
		width: 100%;
		height: 180px;
		object-fit: cover;
		display: block;
	}

	.profile-body {
		padding: 20px;
	}

	/* Overlap avatar onto header image when present.
     ヘッダー画像がある場合のみアバターを重ねる。 */
	.profile-header + .profile-body {
		padding-top: 0;
		margin-top: -60px;
	}

	.profile-identity {
		display: flex;
		align-items: flex-end;
		gap: 12px;
		flex-wrap: wrap;
	}

	.avatar {
		border-radius: 50%;
		flex-shrink: 0;
		border: 3px solid var(--mur-paper);
		background: var(--mur-paper);
		width: 120px;
		height: 120px;
	}

	.profile-name {
		flex: 1;
		min-width: 0;
	}

	.profile-identity h1 {
		font-size: var(--mur-text-lg);
		line-height: 1.3;
	}

	.profile-actions {
		display: flex;
		align-items: center;
		gap: 8px;
		margin-left: auto;
		margin-bottom: 4px;
		flex-shrink: 0;
	}

	.profile-follow-btn {
		display: inline-flex;
		align-items: center;
		padding: 6px 20px;
		border: 1px solid var(--mur-accent);
		border-radius: 9999px;
		color: var(--mur-accent);
		font-size: var(--mur-text-sm);
		font-weight: 500;
		text-decoration: none;
		white-space: nowrap;
	}

	.profile-follow-btn:hover {
		background: var(--mur-accent);
		color: var(--mur-on-accent);
		text-decoration: none;
	}

	.bio {
		margin-top: 16px;
		line-height: 1.8;
		font-size: var(--mur-text-md);
		overflow-wrap: break-word;
	}

	.bio p + p {
		margin-top: 8px;
	}

	.profile-fields {
		margin-top: 16px;
		display: grid;
		grid-template-columns: auto 1fr;
		border: 1px solid var(--mur-border);
		border-radius: var(--mur-radius);
		overflow: hidden;
		font-size: var(--mur-text-md);
	}

	.profile-field {
		display: contents;
	}

	.profile-field dt {
		white-space: nowrap;
		padding: 8px 12px;
		font-weight: 500;
		color: var(--mur-muted);
		background: var(--mur-surface);
		border-bottom: 1px solid var(--mur-border);
	}

	.profile-field dd {
		padding: 8px 12px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		border-bottom: 1px solid var(--mur-border);
	}

	.profile-field:last-child dt,
	.profile-field:last-child dd {
		border-bottom: none;
	}

	.profile-stats {
		margin-top: 16px;
		display: flex;
		gap: 16px;
		font-size: var(--mur-text-md);
		color: var(--mur-muted);
	}

	.profile-stats strong {
		color: var(--mur-ink);
	}

	.profile-stat-link {
		color: var(--mur-ink);
		text-decoration: none;
		font-weight: 600;
	}

	.profile-stat-link:hover {
		text-decoration: underline;
	}

	/* ─── Overlay + Dialog / オーバーレイ + ダイアログ ─── */

	.overlay {
		position: fixed;
		inset: 0;
		background: var(--mur-overlay);
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 100;
	}

	.dialog {
		background: var(--mur-paper);
		border-radius: var(--mur-radius);
		width: 90%;
		max-width: 520px;
		max-height: 80vh;
		display: flex;
		flex-direction: column;
		box-shadow: 0 8px 32px var(--mur-shadow);
	}

	.dialog-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 16px;
		border-bottom: 1px solid var(--mur-border);
	}

	.dialog-title {
		font-size: var(--mur-text-lg);
		font-weight: 600;
		margin: 0;
	}

	.dialog-close {
		background: none;
		border: none;
		font-size: var(--mur-text-xl);
		color: var(--mur-muted);
		cursor: pointer;
		padding: 0 4px;
		line-height: 1;
	}

	.dialog-close:hover {
		color: var(--mur-ink);
	}

	.dialog-body {
		padding: 16px;
		overflow-y: auto;
	}

	.dialog-footer {
		display: flex;
		justify-content: flex-end;
		gap: 8px;
		padding: 12px 16px;
		border-top: 1px solid var(--mur-border);
	}

	/* ─── Job detail / ジョブ詳細 ─── */

	.job-detail {
		display: grid;
		grid-template-columns: auto 1fr;
		gap: 0;
		font-size: var(--mur-text-md);
	}

	.job-detail dt {
		padding: 8px 12px 8px 0;
		color: var(--mur-muted);
		white-space: nowrap;
		font-weight: 500;
	}

	.job-detail dd {
		padding: 8px 0;
		min-width: 0;
		overflow-wrap: break-word;
	}

	.job-detail dt,
	.job-detail dd {
		border-bottom: 1px solid var(--mur-border);
	}

	.job-detail dt:last-of-type,
	.job-detail dd:last-of-type {
		border-bottom: none;
	}

	.job-detail-error {
		color: var(--mur-danger);
		overflow-wrap: break-word;
	}

	.job-detail-payload {
		margin: 0;
		padding: 8px;
		background: var(--mur-surface);
		border-radius: var(--mur-radius);
		font-size: var(--mur-text-sm);
		overflow-x: auto;
		white-space: pre-wrap;
		word-break: break-all;
	}

	/* ─── Mobile / モバイル ─── */

	@media (max-width: 640px) {
		.screen {
			padding: 0;
			margin: 0;
		}
		.card,
		.tabs {
			border-radius: 0;
			border: none;
			border-bottom: 1px solid var(--mur-border);
			margin-bottom: 0;
		}
		.queue-desktop {
			display: none;
		}
		.dialog {
			width: 100%;
			max-width: none;
			max-height: 100vh;
			border-radius: 0;
		}
	}

	@media (max-width: 480px) {
		.profile-header + .profile-body {
			margin-top: 0;
		}
		.profile-header {
			margin-bottom: 0;
		}
		.avatar {
			width: 72px;
			height: 72px;
			margin-top: -56px;
		}
		.profile-identity {
			flex-wrap: wrap;
			gap: 8px;
		}
		.profile-name h1 {
			font-size: var(--mur-text-base);
		}
		.profile-follow-btn {
			display: none;
		}
		.dot-menu-follow {
			display: block;
		}
		.profile-actions {
			margin-left: auto;
			margin-bottom: 0;
		}
	}
}

/* ─── Loading spinner (global, works in both spa and public) ─── */
/* ─── ローディングスピナー (グローバル、spa/public 両対応) ─── */

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

.loading-spinner {
	animation: spin 0.8s linear infinite;
	opacity: 0.5;
}

/* ─── Lightbox (global, works in both spa and public) ─── */
/* ─── ライトボックス (グローバル、spa/public 両対応) ─── */

.lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	cursor: pointer;
	padding: 24px;
}

.lightbox-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
	cursor: default;
}
