a {
	color: #006;
	text-decoration: none;
	text-decoration: underline;
}

html,
body {
	margin: 0;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	overscroll-behavior-x: contain;
}

body {
	overflow-x: hidden;
}

html,
body {
	margin: 0;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	overscroll-behavior-x: contain;
}

body {
	overflow-x: hidden;
}

a:visited {
	color: inherit;
	text-decoration: underline;
}

.wrap {
	max-width: 960px;
	margin: 0 auto;
	padding: 16px;
	outline: none;
}

.stage,
.article-block,
.article-detail,
.article-panel {
	max-width: 100%;
	box-sizing: border-box;
}

.article-block {
	width: 100%;
}

.article-panel {
	width: 100%;
	overflow: hidden;
}

.article-panel,
.article-detail,
.article-content {
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.article-content {
	word-break: break-word;
}

.article-content img,
.article-content video,
.article-content iframe {
	max-width: 100%;
	height: auto;
}

.article-content table,
.article-content pre,
.article-content code,
.article-content .dbg-wide,
.article-content .dbg-table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

.stage,
.article-block,
.article-detail,
.article-panel {
	max-width: 100%;
	box-sizing: border-box;
}

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

.action-bar {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	margin-bottom: 12px;
}

.action-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	/* 中央スペースを確保するため折返しを抑制 */
	flex-wrap: nowrap;
}

.action-center {
	flex: 1 1 auto;
	text-align: center;
	min-width: 0;
}

/* Ensure copy button sits inline with the label */
.action-center #copy-canonical {
	vertical-align: middle;
	margin-left: 6px;
}

.action-center #top-aid-info {
	font-size: 12px;
	color: #666;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: inline-block;
	max-width: 100%;
	vertical-align: middle;
	padding: 0 4px;
}

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

.action-group.action-left {
	flex: 0 0 auto;
	min-width: 0;
	gap: 8px;
}

.action-group.action-right {
	flex: 0 0 auto;
	min-width: 0;
}

.icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid #ccc;
	border-radius: 6px;
	background: #f5f5f5;
	color: #333;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}

.icon-button:hover {
	background: #e6e6e6;
}

.icon-button:disabled {
	opacity: .45;
	cursor: not-allowed;
	pointer-events: none;
}

.icon-button.is-hidden {
	display: none;
}

.form {
	margin-bottom: 0;
}

.search-scope-options {
	display: flex;
	gap: 6px;
	margin-bottom: 4px;
	flex-wrap: wrap;
}

.search-scope-options label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
	font-size: 12px;
	line-height: 1.1;
}


.search-wrapper {
	display: none;
	width: 100%;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.search-wrapper.is-visible {
	display: flex;
}

.search-form {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
}

.search-form .search-scope-options {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 0;
}

.search-form .search-scope-options label {
	font-size: 12px;
	line-height: 1.1;
}

.search-form #search-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	box-sizing: border-box;
}

.search-form .search-submit {
	flex: 0 0 auto;
}

.search-wrapper .search-form input[type="text"] {
	width: 100%;
	height: 44px;
	box-sizing: border-box;
}

.search-result-info {
	flex: 1 0 100%;
	margin-left: calc(44px + 8px);
	font-size: 13px;
	color: #555;
	line-height: 1.4;
}

.search-result-info.is-hidden {
	display: none;
}

.form input[type="text"] {
	width: 20em;
}

.search-form .search-submit {
	padding: 0 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	background: #f5f5f5;
	cursor: pointer;
	height: 44px;
	/* align with icon buttons and input */
	box-sizing: border-box;
}

.form.is-hidden {
	display: none;
}

.stage {
	min-height: 50vh;
}

.hint {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 12px;
	text-align: center;
	opacity: .35;
	font-size: 12px;
	pointer-events: none;
}

.article-block {
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 14px;
	background: #fff;
	display: grid;
	gap: 12px;
}

.article-panel {
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 12px;
	background: #fafafa;
	cursor: pointer;
	transform-origin: top left;
	transition: transform .4s ease;
	transition: transform .4s ease, border-color .2s ease, box-shadow .2s ease;
}

.article-panel.is-transitioning {
	border-color: #644;
	box-shadow: 0 8px 24px rgba(255, 152, 0, 0.35);
}

.article-panel-title {
	font-weight: bold;
	margin: 0 0 8px;
}

.article-panel.child.empty {
	cursor: default;
}

.article-panel .article-descendants {
	margin-top: 12px;
	min-height: 1px;
}

.article-panel .article-descendants .descendant-block {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.article-panel .article-descendants .grandchild {
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 10px;
	background: #fff;
	margin: 0;
}

.article-panel .article-descendants .grandchild-empty,
.article-descendants-status {
	margin: 8px 0 0;
	font-size: 13px;
	color: #666;
}

.stage.stage-detail {
	padding: 0;
}

.article-detail {
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 16px;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-height: 40vh;
}

.detail-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	justify-content: space-between;
}

.detail-toolbar .detail-status {
	font-size: 13px;
	color: #644;
}

.detail-toolbar .detail-label {
	margin-left: auto;
	font-weight: bold;
	text-align: right;
	white-space: nowrap;
	max-width: 60%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.detail-body {
	flex: 1 1 auto;
}

.detail-block {
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 12px;
	background: #fafafa;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 200px;
}

.detail-block-title {
	font-weight: bold;
}

.detail-block-content {
	border: 1px dotted #666;
	border-radius: 6px;
	background: #fff;
	padding: 12px;
	color: #666;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.detail-descendants {
	border: 1px solid #ccc;
	border-radius: 6px;
	background: #fff;
	padding: 12px;
}

.detail-controls {
	display: none;
}

.detail-controls button {
	flex: 1 1 50%;
	padding: 8px 0;
	border: 1px solid #ccc;
	border-radius: 6px;
	background: #f7f7f7;
	cursor: pointer;
}

.detail-controls button:disabled {
	opacity: 0.4;
	cursor: default;
}

.detail-transition-clone {
	position: fixed;
	z-index: 999;
	transform-origin: top left;
	max-width: 100vw;
	box-sizing: border-box;
	transition: transform .4s ease, border-radius .4s ease, opacity .4s ease;
	pointer-events: none;
	background: #fff;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
	opacity: 1;
	overflow: hidden;
	border: 2px solid #644;
	border-radius: 12px;
}

.detail-transition-clone .article-panel {
	width: 100%;
	height: 100%;
}

#app {
	touch-action: pan-y;
}

/* 横ジェスチャーは自前、縦スクロールはブラウザ */
.fade {
	animation: fade .18s ease;
}

@keyframes fade {
	from {
		opacity: .3;
	}

	to {
		opacity: 1;
	}
}

div#part-ad {
	text-align: center;
}
