/* AP LLMO admin — layout aligned with Shopify app (2-col home, setup + aside) */

.ap-llmo-code {
	display: block;
	overflow-x: auto;
	padding: 12px 14px;
	margin: 0.5rem 0 1rem;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 12px;
	line-height: 1.45;
}

.ap-llmo-redirect-urls {
	margin: 0.75rem 0 1rem;
}

.ap-llmo-redirect-urls code {
	word-break: break-all;
}

.ap-llmo-wrap {
	max-width: 1200px;
}

.ap-llmo-nav {
	margin: 1rem 0 1.5rem;
	padding: 0;
	border-bottom: 1px solid #c3c4c7;
}

.ap-llmo-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ap-llmo-nav__link {
	display: inline-block;
	padding: 0.6rem 1rem;
	margin-bottom: -1px;
	text-decoration: none;
	color: #50575e;
	border: 1px solid transparent;
	border-radius: 4px 4px 0 0;
}

.ap-llmo-nav__link:hover {
	color: #2271b1;
}

.ap-llmo-nav__link.is-active {
	color: #1d2327;
	background: #fff;
	border-color: #c3c4c7;
	border-bottom-color: #fff;
	font-weight: 600;
}

.ap-llmo-grid {
	display: grid;
	grid-template-columns: 1fr minmax(260px, 320px);
	gap: 2rem;
	align-items: start;
}

@media (max-width: 900px) {
	.ap-llmo-grid {
		grid-template-columns: 1fr;
	}
}

.ap-llmo-setup-grid {
	display: grid;
	grid-template-columns: 1fr minmax(280px, 380px);
	gap: 2rem;
	align-items: start;
}

@media (max-width: 900px) {
	.ap-llmo-setup-grid {
		grid-template-columns: 1fr;
	}
}

.ap-llmo-setup-aside {
	position: sticky;
	top: 2rem;
}

.ap-llmo-card {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.25rem;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.ap-llmo-card--philosophy {
	border-left: 4px solid #2c6ecb;
	background: #f0f4fa;
}

.ap-llmo-card--visibility {
	border-left: 4px solid #9e9e9e;
}

.ap-llmo-card--plan {
	border-left: 3px solid #2271b1;
}

.ap-llmo-hero h1 {
	font-size: 1.75rem;
	margin-bottom: 0.75rem;
}

.ap-llmo-hero__lead {
	font-size: 1.0625rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
}

.ap-llmo-hero__sub {
	color: #50575e;
	font-size: 0.9375rem;
}

.ap-llmo-muted {
	color: #646970;
	font-size: 0.875rem;
}

.ap-llmo-file-list {
	margin: 0;
	padding-left: 1.25rem;
	line-height: 1.9;
}

.ap-llmo-field {
	display: block;
	margin-bottom: 1rem;
}

.ap-llmo-field span {
	display: block;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.ap-llmo-anchor-nav ul {
	margin: 0.5rem 0 0;
	padding-left: 1.25rem;
}

.ap-llmo-footer {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid #c3c4c7;
	font-size: 0.8125rem;
	color: #646970;
}

.ap-llmo-card--diagnosis {
	border-left: 4px solid #dba617;
}

.ap-llmo-diagnosis-list {
	margin: 0.5rem 0 0;
	padding-left: 1.25rem;
	line-height: 1.7;
}

.ap-llmo-field-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin: 0.25rem 0 0.5rem;
}

.ap-llmo-notice--success {
	margin: 0.25rem 0 0;
	padding: 0.25rem 0;
	color: #00a32a;
	font-size: 0.875rem;
}

.ap-llmo-details {
	padding: 0.75rem 1rem;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
}

.ap-llmo-details__summary {
	font-weight: 600;
	cursor: pointer;
}

.ap-llmo-fieldset {
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	padding: 0.75rem 1rem;
	margin: 1rem 0;
}

.ap-llmo-fieldset legend {
	padding: 0 0.25rem;
	font-weight: 600;
}

.ap-llmo-preview-card {
	border-left: 4px solid #2c6ecb;
	background: #f0f4fa;
}

.ap-llmo-preview-dl {
	display: grid;
	grid-template-columns: minmax(140px, auto) 1fr;
	gap: 0.35rem 1rem;
	margin: 0.75rem 0 0;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.ap-llmo-preview-dl dt {
	font-weight: 600;
	color: #1d2327;
}

.ap-llmo-preview-dl dd {
	margin: 0;
	color: #50575e;
}

.ap-llmo-preview-empty {
	color: #787c82;
	font-style: italic;
}

/* 重要項目（AIが優先して見る部分）を強調 */
.ap-llmo-preview-dt--priority,
.ap-llmo-preview-dd--priority {
	background: rgba(44, 110, 203, 0.06);
	border-left: 3px solid #2c6ecb;
	padding-left: 0.5rem;
	margin-left: -0.5rem;
	padding-right: 0.25rem;
}

.ap-llmo-preview-dt--priority {
	margin-bottom: 0;
}

.ap-llmo-preview-dd--priority {
	margin-top: 0.15rem;
	margin-bottom: 0.5rem;
}

.ap-llmo-preview-warn {
	color: #b36b00;
	background: rgba(219, 166, 23, 0.08);
	border-left: 3px solid #dba617;
	padding: 0.35rem 0 0.35rem 0.5rem;
	margin: 0.25rem 0;
}

.ap-llmo-preview-warn-icon {
	margin-right: 0.2em;
}

/* 組み立て文章プレビュー（段落表示） */
.ap-llmo-preview__body--prose {
	margin-top: 0.5rem;
	font-size: 0.9375rem;
	line-height: 1.6;
	max-width: 42em;
}

.ap-llmo-preview__body--prose p {
	margin: 0.4em 0;
}

.ap-llmo-preview__body--prose p:first-child {
	margin-top: 0;
}

.ap-llmo-setup-aside__preview {
	position: sticky;
	top: 2rem;
}

/* ローディングオーバーレイ（Setup の全ボタン操作時） */
.ap-llmo-loading-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	background: rgba(0, 0, 0, 0.45);
}

.ap-llmo-loading-overlay__text {
	margin: 0;
	max-width: 20rem;
	text-align: center;
	font-size: 0.95rem;
	color: #fff;
}

.ap-llmo-loading-overlay .ap-llmo-spinner {
	width: 44px;
	height: 44px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ap-llmo-spin 0.75s linear infinite;
}

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

/* API Key 未設定時の「AIで生成」ボタン（非活性） */
.ap-llmo-btn-ai:disabled,
button.ap-llmo-btn-ai[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* AI Visibility */
.ap-llmo-period-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin: 0 0 1.25rem;
	padding: 0;
}

.ap-llmo-period-tabs__link {
	display: inline-block;
	padding: 0.45rem 0.85rem;
	text-decoration: none;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #f6f7f7;
	color: #50575e;
}

.ap-llmo-period-tabs__link:hover {
	color: #2271b1;
	border-color: #2271b1;
}

.ap-llmo-period-tabs__link.is-active {
	background: #fff;
	border-color: #2271b1;
	color: #1d2327;
	font-weight: 600;
}

.ap-llmo-retention-note {
	margin: -0.35rem 0 1rem;
	max-width: 52rem;
}

.ap-llmo-export-csv {
	margin: 0 0 1.25rem;
}

.ap-llmo-stat-number {
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1.2;
	margin: 0.25rem 0 0.5rem;
}

.ap-llmo-table {
	margin-top: 0.5rem;
}

.ap-llmo-table--recent .ap-llmo-path-code {
	max-width: 280px;
	display: inline-block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	vertical-align: bottom;
}

.ap-llmo-visibility-summary {
	margin: 0.5rem 0 0;
	padding-left: 1.25rem;
}

/* docs/ai rows */
.ap-llmo-docs-ai-list {
	margin: 0.5rem 0 1rem;
}

.ap-llmo-docs-ai-row {
	margin-bottom: 1.5rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid #c3c4c7;
}

.ap-llmo-docs-ai-row:last-child {
	border-bottom: none;
}

.ap-llmo-label-inline {
	margin-right: 0.5rem;
}

.ap-llmo-card--dev-only {
	margin-top: 1.5rem;
	border-left: 4px solid #dba617;
}
