/* Medical Alpha Shindan - v1.0.0 */
:root {
	--mas-color: #2DB4A8;
}

/* ---------- Generic SVG icon ---------- */
.mas-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
	line-height: 0;
}
.mas-icon svg {
	display: block;
	width: 1em;
	height: 1em;
	color: currentColor;
}

/* ---------- Floating Button ---------- */
.mas-fab {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 14px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--mas-color);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0,0,0,0.2), 0 2px 6px rgba(0,0,0,0.12);
	transition: transform .2s ease, box-shadow .2s ease;
	font-family: inherit;
}
.mas-fab:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(0,0,0,0.25), 0 4px 10px rgba(0,0,0,0.15);
}
.mas-fab__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	line-height: 0;
}
.mas-fab__icon svg {
	width: 20px;
	height: 20px;
}
.mas-fab__label {
	white-space: nowrap;
}

/* パルスアニメーション */
.mas-fab::before {
	content: '';
	position: absolute;
	inset: -4px;
	border-radius: inherit;
	background: var(--mas-color);
	opacity: .35;
	z-index: -1;
	animation: mas-pulse 2s infinite;
}
@keyframes mas-pulse {
	0%   { transform: scale(1);   opacity: .35; }
	70%  { transform: scale(1.15); opacity: 0; }
	100% { transform: scale(1.15); opacity: 0; }
}

@media (max-width: 480px) {
	.mas-fab { padding: 12px 16px; font-size: 13px; right: 16px; bottom: 16px; }
	.mas-fab__icon { font-size: 18px; }
}

/* ---------- Modal ---------- */
.mas-modal[hidden] { display: none; }
.mas-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	animation: mas-fade .25s ease;
}
.mas-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(2px);
}
.mas-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: 90vh;
	background: #fff;
	border-radius: 20px 20px 0 0;
	box-shadow: 0 -8px 40px rgba(0,0,0,0.25);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	animation: mas-slideup .3s ease;
}
@media (min-width: 560px) {
	.mas-modal { align-items: center; }
	.mas-modal__dialog { border-radius: 20px; margin: 20px; }
}
.mas-modal__close {
	position: absolute;
	top: 8px;
	right: 10px;
	background: transparent;
	border: 0;
	font-size: 28px;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	z-index: 2;
}
.mas-modal__close:hover {
	background: #f1f5f9;
	color: #0f172a;
}
.mas-modal__body {
	padding: 28px 20px 20px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

body.mas-lock { overflow: hidden; }

@keyframes mas-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes mas-slideup {
	from { transform: translateY(30px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

/* ---------- Screen / Common ---------- */
.mas-screen {
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
	color: #0f172a;
	font-size: 15px;
	line-height: 1.6;
}
.mas-inline {
	max-width: 480px;
	margin: 20px auto;
	padding: 24px;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.mas-inline-trigger {
	display: inline-block;
	padding: 14px 24px;
	background: var(--mas-color);
	color: #fff;
	border: 0;
	border-radius: 999px;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
}

/* ---------- Hero / Welcome ---------- */
.mas-hero {
	text-align: center;
	padding: 12px 0 20px;
}
.mas-hero__icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--mas-color);
	background: color-mix(in srgb, var(--mas-color) 12%, #fff);
	border-radius: 50%;
}
.mas-hero__icon .mas-icon svg {
	width: 28px;
	height: 28px;
}
.mas-hero__title {
	margin: 0 0 8px;
	font-size: 22px;
	font-weight: 800;
	color: #0f172a;
}
.mas-hero__lead {
	margin: 0;
	font-size: 14px;
	color: #475569;
}
.mas-note {
	margin: 16px 0 0;
	font-size: 12px;
	color: #94a3b8;
	text-align: center;
}

/* ---------- Progress Bar ---------- */
.mas-progress {
	width: 100%;
	height: 6px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 20px;
}
.mas-progress__bar {
	height: 100%;
	background: var(--mas-color);
	transition: width .3s ease;
}

/* ---------- Bot Bubble ---------- */
.mas-bubble {
	display: flex;
	gap: 10px;
	margin-bottom: 18px;
}
.mas-bubble__avatar {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--mas-color);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 700;
}
.mas-bubble__text {
	flex: 1;
	padding: 10px 14px;
	background: #f1f5f9;
	border-radius: 4px 14px 14px 14px;
	font-size: 15px;
	font-weight: 600;
	color: #0f172a;
	line-height: 1.5;
}

/* ---------- Options ---------- */
.mas-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.mas-options--grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
.mas-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	background: #fff;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	color: #0f172a;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	transition: all .15s ease;
}
.mas-option:hover {
	border-color: var(--mas-color);
	background: color-mix(in srgb, var(--mas-color) 5%, #fff);
	transform: translateY(-1px);
}
.mas-option--card {
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 20px 12px;
	min-height: 100px;
}
.mas-option__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--mas-color);
	line-height: 0;
}
.mas-option__icon .mas-icon svg {
	width: 24px;
	height: 24px;
}
.mas-option--card .mas-option__icon {
	width: 44px;
	height: 44px;
	margin-bottom: 8px;
	background: color-mix(in srgb, var(--mas-color) 10%, #fff);
	border-radius: 50%;
}
.mas-option--card .mas-option__icon .mas-icon svg {
	width: 22px;
	height: 22px;
}
.mas-option__label {
	display: block;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
}
.mas-option__desc {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	font-weight: 500;
	color: #64748b;
	line-height: 1.4;
}
.mas-option--card .mas-option__label {
	font-size: 13px;
}

/* ---------- Back Button ---------- */
.mas-back {
	display: inline-block;
	margin-bottom: 12px;
	padding: 4px 10px 4px 4px;
	background: transparent;
	border: 0;
	color: #64748b;
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
}
.mas-back:hover {
	color: var(--mas-color);
}

/* ---------- Button ---------- */
.mas-btn {
	display: inline-block;
	padding: 14px 20px;
	border: 2px solid transparent;
	border-radius: 999px;
	font-weight: 700;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	font-family: inherit;
	transition: all .15s ease;
}
.mas-btn--block {
	display: block;
	width: 100%;
}
.mas-btn--primary {
	background: var(--mas-color);
	color: #fff;
	border-color: var(--mas-color);
}
.mas-btn--primary:hover {
	filter: brightness(1.05);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.mas-btn--outline {
	background: #fff;
	color: var(--mas-color);
	border-color: var(--mas-color);
}
.mas-btn--outline:hover {
	background: color-mix(in srgb, var(--mas-color) 8%, #fff);
}
.mas-btn--ghost {
	background: transparent;
	color: #64748b;
	border-color: transparent;
	font-weight: 500;
	font-size: 13px;
	padding: 10px;
}
.mas-btn--ghost:hover {
	color: var(--mas-color);
}
.mas-btn + .mas-btn {
	margin-top: 10px;
}
.mas-btn--with-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.mas-btn--with-icon.mas-btn--block {
	display: flex;
}
.mas-btn--with-icon .mas-icon svg {
	width: 18px;
	height: 18px;
}

/* ---------- Result Screen ---------- */
.mas-result__badge {
	display: inline-block;
	padding: 4px 12px;
	background: var(--mas-color);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	border-radius: 999px;
	margin-bottom: 10px;
}
.mas-result__tagline {
	margin: 0 0 6px;
	font-size: 13px;
	color: #64748b;
}
.mas-result__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	font-size: 20px;
	font-weight: 800;
	color: #0f172a;
	line-height: 1.3;
}
.mas-result__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: var(--mas-color);
	background: color-mix(in srgb, var(--mas-color) 12%, #fff);
	border-radius: 8px;
}
.mas-result__icon .mas-icon svg {
	width: 20px;
	height: 20px;
}
.mas-result__card {
	padding: 16px;
	margin-bottom: 20px;
	background: color-mix(in srgb, var(--mas-color) 6%, #fff);
	border: 1px solid color-mix(in srgb, var(--mas-color) 25%, transparent);
	border-radius: 12px;
}
.mas-result__clinic {
	font-size: 14px;
	font-weight: 800;
	color: var(--mas-color);
	margin-bottom: 6px;
}
.mas-result__detail {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.6;
	color: #334155;
}
.mas-result__features {
	margin: 0;
	padding: 0 0 0 4px;
	list-style: none;
}
.mas-result__features li {
	position: relative;
	padding: 3px 0 3px 22px;
	font-size: 13px;
	color: #334155;
}
.mas-result__features li::before {
	content: '✓';
	position: absolute;
	left: 0;
	top: 3px;
	color: var(--mas-color);
	font-weight: 800;
}
.mas-result__ctas {
	margin-bottom: 12px;
}

/* ---------- Clinic List (for AGA/ED/etc.) ---------- */
.mas-clinic-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 20px;
}
.mas-clinic {
	position: relative;
	padding: 18px 16px 16px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.mas-clinic--top {
	border: 2px solid var(--mas-color);
	box-shadow: 0 8px 24px rgba(45,180,168,0.18);
	padding-top: 28px;
}
.mas-clinic__badge {
	position: absolute;
	top: -10px;
	left: 12px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	background: var(--mas-color);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	border-radius: 999px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.mas-clinic__badge .mas-icon svg {
	width: 13px;
	height: 13px;
}
.mas-clinic__rank {
	display: inline-block;
	padding: 2px 8px;
	background: #f1f5f9;
	color: #64748b;
	font-size: 11px;
	font-weight: 700;
	border-radius: 4px;
	margin-bottom: 6px;
}
.mas-clinic--top .mas-clinic__rank {
	background: color-mix(in srgb, var(--mas-color) 15%, #fff);
	color: var(--mas-color);
}
.mas-clinic__name {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 800;
	color: #0f172a;
	line-height: 1.3;
}
.mas-clinic__tagline {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--mas-color);
	line-height: 1.4;
}
.mas-clinic__price {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 8px 10px;
	margin-bottom: 10px;
	background: #f8fafc;
	border-radius: 8px;
}
.mas-clinic__price-label {
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
}
.mas-clinic__price-value {
	font-size: 16px;
	font-weight: 800;
	color: #0f172a;
}
/* 詳細情報ブロック（料金 + 診察料 / 送料 / 診療時間） */
.mas-clinic__info {
	margin-bottom: 12px;
}
.mas-clinic__info-row {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 10px 12px;
	background: #f8fafc;
	border-radius: 8px 8px 0 0;
}
.mas-clinic__info-row--price {
	background: color-mix(in srgb, var(--mas-color) 10%, #fff);
	border-bottom: 1px solid color-mix(in srgb, var(--mas-color) 25%, transparent);
}
.mas-clinic__info-label {
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
	letter-spacing: .02em;
}
.mas-clinic__info-row--price .mas-clinic__info-label {
	color: var(--mas-color);
}
.mas-clinic__info-value {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 1px;
}
.mas-clinic__info-row--price .mas-clinic__info-value {
	flex-direction: column;
}
.mas-clinic__info-main {
	font-size: 18px;
	font-weight: 800;
	color: #0f172a;
	letter-spacing: .01em;
	line-height: 1.2;
}
.mas-clinic__info-note {
	font-size: 11px;
	font-weight: 500;
	color: #64748b;
	line-height: 1.4;
	margin-top: 2px;
}
.mas-clinic__info-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
	background: #e2e8f0;
	border-radius: 0 0 8px 8px;
	overflow: hidden;
}
.mas-clinic__info-cell {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 10px;
	background: #f8fafc;
}
.mas-clinic__info-cell--full {
	grid-column: 1 / -1;
}
.mas-clinic__info-cell .mas-clinic__info-value {
	font-size: 12px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.4;
}
.mas-clinic .mas-result__features {
	margin-bottom: 12px;
}
.mas-clinic .mas-btn {
	padding: 11px 16px;
	font-size: 14px;
}

/* color-mix fallback for older browsers */
@supports not (background: color-mix(in srgb, red 5%, white)) {
	.mas-hero__icon { background: #E6F7F5; }
	.mas-option:hover { background: #F0FBFA; }
	.mas-btn--outline:hover { background: #F0FBFA; }
	.mas-result__card { background: #F0FBFA; border-color: #B3E5E0; }
}
