/* 網頁登入後的三格（收到的名片｜聊聊｜我的）與掃碼頁共用的元件（docs/mockups/web-card「網頁跟 App 一樣」）。
   色票、字級、圓角只用 styles.css 的 brand token。 */

/* ---------- 分頁：手機在底部（同 App），電腦是左側欄（同一個 .app-tabbar 換排法） ---------- */
body.app .footer {
	display: none;
}
body.app .rp-stage {
	padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
.app-tabbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 50;
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	min-height: 64px;
	padding-bottom: env(safe-area-inset-bottom);
	border-top: 1px solid var(--border);
	background: var(--surface);
}
.app-tabbar a {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	color: var(--text-muted);
	text-decoration: none;
	font: 500 12px/1 var(--font);
}
.app-tabbar a[aria-current] {
	color: var(--text);
}
.app-tabbar .icon {
	width: 24px;
	height: 24px;
}
/* 「關於」只在電腦的側欄 */
.app-tabbar .app-tab-about {
	display: none;
}
.app-badge {
	position: absolute;
	top: 8px;
	left: calc(50% + 8px);
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 50%;
	background: var(--fresh);
	color: var(--on-fresh);
	font: 700 12px/16px var(--font);
	font-style: normal;
	text-align: center;
}
.app-badge[hidden] {
	display: none;
}
/* 電腦：側欄貼左、在頂列下面；768 起是窄的（圖示＋小字），1100 起展開成一列一格 */
@media (min-width: 768px) {
	body.app {
		--side-w: 80px;
	}
	body.app .rp-stage {
		padding-bottom: 80px;
		padding-left: var(--side-w);
	}
	.app-tabbar {
		top: var(--nav-h);
		right: auto;
		width: var(--side-w);
		display: flex;
		flex-direction: column;
		gap: 4px;
		min-height: 0;
		padding: 12px 8px;
		border-top: 0;
		border-right: 1px solid var(--border);
		background: var(--bg);
		overflow-y: auto;
		/* 側欄不跟著活動頁的上下列收起 */
		transform: none !important;
		transition: top 0.22s ease-in-out;
	}
	/* 活動頁往下滑頂列收起時，側欄往上補滿，不留一塊空白 */
	body.chrome-hidden .app-tabbar {
		top: 0;
	}
	.app-tabbar a {
		flex: none;
		min-height: 60px;
		border-radius: var(--radius-control);
	}
	.app-tabbar a:hover {
		background: var(--hover);
	}
	.app-tabbar a[aria-current] {
		background: var(--selected);
	}
	.app-tabbar .app-tab-about {
		display: flex;
		margin-top: auto;
	}
	/* 左下角「設定」在「關於」上面，只有登入後出現 */
	.app-tabbar .app-tab-settings + .app-tab-about {
		margin-top: 0;
	}
	html:not(.signed-in) .app-tabbar .app-tab-settings {
		display: none;
	}
	html:not(.signed-in) .app-tabbar .app-tab-settings + .app-tab-about {
		margin-top: auto;
	}
}
@media (prefers-reduced-motion: reduce) {
	.app-tabbar {
		transition: none;
	}
}
@media (min-width: 1100px) {
	body.app {
		--side-w: 232px;
	}
	.app-tabbar {
		padding: 16px 12px;
	}
	.app-tabbar a {
		flex-direction: row;
		justify-content: flex-start;
		gap: 12px;
		min-height: 48px;
		padding: 0 12px;
		font: 500 16px/1 var(--font);
	}
	.app-tabbar .app-badge {
		position: static;
		margin-left: auto;
	}
}

/* ---------- 名片一列（記下來了、一起存下）：照片、姓名、卡的標題、第二行（作品・身分） ---------- */
.app-enc {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-control);
	color: inherit;
	text-align: left;
	text-decoration: none;
}
.app-enc img,
.app-enc .app-ph {
	flex: none;
	width: 56px;
	height: 70px;
	border-radius: var(--radius-photo);
	object-fit: cover;
}
.app-enc-text {
	flex: 1;
	min-width: 0;
}
.app-enc-text b {
	display: block;
	font: 700 17px/1.3 var(--font);
}
.app-enc-text span {
	display: block;
	font: 400 14px/1.4 var(--font);
	color: var(--text-muted);
}
.app-enc-text .app-enc-sign {
	color: var(--text);
}
.app-go {
	flex: none;
	width: 20px;
	height: 20px;
	color: var(--text-muted);
}
.app-ph {
	display: grid;
	place-items: center;
	background: var(--raised);
	color: var(--text-muted);
	font: 700 22px/1 var(--font);
}

/* 「小澄那邊也有你的名片了」 */
.app-both {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	font: 500 16px/1.4 var(--font);
}
.app-both .icon {
	color: var(--success);
}

/* 場次、時間 */
.app-kv {
	width: 100%;
	margin: 0;
	border-top: 1px solid var(--border);
}
.app-kv > div,
.app-kv > button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 48px;
	padding: 0;
	border: 0;
	border-bottom: 1px solid var(--border);
	background: none;
	color: var(--text);
	font: 400 16px/1.4 var(--font);
	text-align: left;
}
.app-kv > button {
	cursor: pointer;
}
.app-kv dt,
.app-kv .app-kv-k {
	flex: none;
	width: 48px;
	color: var(--text-muted);
}
.app-kv dd,
.app-kv .app-kv-v {
	flex: 1;
	min-width: 0;
	margin: 0;
}
.app-pick {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0 12px;
	border: 1px dashed var(--input-border);
	border-radius: var(--radius-control);
	color: var(--text-muted);
}

/* 你的名片（掃碼頁）／你給小澄的名片（記下來了） */
.app-mine {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	text-align: left;
}
.app-mine img,
.app-mine .app-ph {
	flex: none;
	width: 40px;
	height: 50px;
	border-radius: var(--radius-photo);
	object-fit: cover;
	font-size: 17px;
}
.app-mine-text {
	flex: 1;
	min-width: 0;
}
.app-mine-text small {
	display: block;
	font: 400 14px/1.4 var(--font);
	color: var(--text-muted);
}
.app-mine-text b {
	display: block;
	font: 700 16px/1.3 var(--font);
	overflow-wrap: anywhere;
}
.app-mine .rp-textbtn {
	flex: none;
}

.app-h {
	margin: 0;
	font: 700 17px/1.4 var(--font);
}
.app-lead {
	margin: 4px 0 0;
	font: 400 14px/1.5 var(--font);
	color: var(--text-muted);
}
.app-stack {
	display: grid;
	gap: 12px;
	width: 100%;
}
.app-or {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	color: var(--text-muted);
	font: 400 14px/1 var(--font);
}
.app-or::before,
.app-or::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--border);
}
.app-stamp {
	display: inline-block;
	margin-left: 8px;
	padding: 0 4px;
	border-radius: var(--radius-stamp);
	background: var(--raised);
	color: var(--text);
	font: 700 12px/18px var(--font);
	font-style: normal;
	vertical-align: 2px;
}
.app-new {
	background: var(--fresh);
	color: var(--on-fresh);
}

/* ---------- 面板（一起存下、選擇場次、⋯） ---------- */
.app-sheet-body {
	display: grid;
	gap: 16px;
}
.app-sheet-actions {
	display: grid;
	gap: 12px;
}
/* 存到相簿：面板裡的一行狀態 */
.sv-status {
	margin: 0;
	color: var(--text-muted);
	font: 400 15px/1.5 var(--font);
	text-align: center;
	font-variant-numeric: tabular-nums;
}
.app-chk-list {
	display: grid;
}
.app-chk {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 76px;
	border-top: 1px solid var(--border);
	cursor: pointer;
}
.app-chk:first-child {
	border-top: 0;
}
.app-chk input {
	flex: none;
	width: 22px;
	height: 22px;
	accent-color: var(--primary);
}
.app-chk img,
.app-chk-ph {
	flex: none;
	width: 48px;
	height: 60px;
	border-radius: var(--radius-photo);
	object-fit: cover;
	background: var(--border);
}
.app-chk-text b {
	display: block;
	font: 700 16px/1.3 var(--font);
}
.app-chk-text span {
	display: block;
	font: 400 14px/1.4 var(--font);
	color: var(--text-muted);
}
.app-acts {
	display: grid;
}
.app-act {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	padding: 0;
	border: 0;
	border-top: 1px solid var(--border);
	background: none;
	color: var(--text);
	font: 500 16px/1.3 var(--font);
	text-align: left;
	cursor: pointer;
}
.app-act:first-child {
	border-top: 0;
}
.app-act.is-danger {
	color: var(--error);
}

/* ---------- 頁面：標題、搜尋、清單 ---------- */
.app-page {
	display: grid;
	gap: 16px;
}
/* 長按、右鍵：那一張浮在暗幕上面，選單貼著它 */
.app-dim {
	position: fixed;
	inset: 0;
	z-index: 110;
	background: var(--scrim);
}
.app-lift {
	position: fixed !important;
	z-index: 115;
	margin: 0;
	background: var(--surface);
	box-shadow: var(--shadow-high) !important;
	pointer-events: none;
}
.app-title {
	margin: 0;
	font: 700 28px/1.3 var(--heading);
}
.app-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 44px;
}
.app-bar a,
.app-bar button {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--text);
	font: 500 16px/1 var(--font);
	text-decoration: none;
	cursor: pointer;
}
.app-bar .icon {
	width: 24px;
	height: 24px;
}
.app-search {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--input-border);
	border-radius: var(--radius-control);
	background: var(--surface);
	color: var(--text-muted);
}
.app-search input {
	flex: 1;
	min-width: 0;
	height: 42px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--text);
	font: 400 16px/1 var(--font);
	outline: none;
}
.app-search:focus-within {
	outline: 2px solid var(--focus);
	outline-offset: -1px;
}
.app-list {
	overflow: hidden;
	border-radius: var(--radius-photo);
	background: var(--surface);
}
.app-empty {
	margin: 0;
	padding: 32px 16px;
	color: var(--text-muted);
	font: 400 16px/1.5 var(--font);
	text-align: center;
}
.app-signedout {
	gap: 24px;
}

/* ---------- 選擇場次（W2-6） ---------- */
.app-sec {
	margin: 8px 0 0;
	font: 700 14px/1.4 var(--font);
	color: var(--text-muted);
}
.app-opts {
	display: grid;
	max-height: 60svh;
	overflow-y: auto;
}
.app-opt {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 56px;
	padding: 8px 0;
	border: 0;
	border-top: 1px solid var(--border);
	background: none;
	color: var(--text);
	text-align: left;
	cursor: pointer;
}
.app-opt-text {
	flex: 1;
	min-width: 0;
}
.app-opt-text b {
	display: block;
	font: 500 16px/1.3 var(--font);
}
.app-opt-text span {
	font: 400 14px/1.3 var(--font);
	color: var(--text-muted);
}
.app-opt .icon {
	width: 20px;
	height: 20px;
}
.app-opts .app-act .icon {
	width: 20px;
	height: 20px;
}
/* 活動選單貼著按鈕往下（event-picker.js 的 anchor，docs/mockups/empty-day-new-card-20261121）：沒有標題列，
   新增活動的表單才有；手機、電腦都一樣，不從底部升起 */
.rp-sheet.app-drop {
	position: fixed;
	inset: auto;
	top: var(--drop-top);
	left: var(--drop-left);
	width: var(--drop-width);
	max-width: none;
	max-height: calc(100svh - var(--drop-top) - 16px);
	margin: 0;
}
.rp-sheet.app-drop.is-closing {
	inset: auto;
	/* inset 會把 top／left 一起清掉：關掉的那 0.12 秒要留在原地淡出，不能跳到左下角（11/24 實測） */
	top: var(--drop-top);
	left: var(--drop-left);
	height: auto;
	margin: 0;
}
.rp-sheet.app-drop > .rp-sheet-panel {
	padding: 12px 12px 12px;
	border-radius: var(--radius-control);
}
.rp-sheet.app-drop:not(.is-form) .rp-sheet-head {
	display: none;
}
.rp-sheet.app-drop .app-opts {
	max-height: calc(100svh - var(--drop-top) - 120px);
}
@media (prefers-reduced-motion: no-preference) {
	.rp-sheet.app-drop[open] > .rp-sheet-panel {
		animation: app-drop-in 0.16s var(--ease-out);
	}
	.rp-sheet.app-drop.is-closing > .rp-sheet-panel {
		animation: app-drop-out 0.12s var(--ease-in) forwards;
	}
	@keyframes app-drop-in {
		from {
			opacity: 0;
			transform: translateY(-6px);
		}
	}
	@keyframes app-drop-out {
		to {
			opacity: 0;
			transform: translateY(-6px);
		}
	}
}

/* 掃碼頁（W2-1）：手機上名片照片小一點，「先不登入，只留暱稱」留在第一屏 */
@media (max-width: 480px) {
	.app-scan .rp-look.xl {
		width: 128px;
	}
}

/* 掃碼頁剛註冊的「你的名片」（登入層第 2／2 步）：4:5 照片框置中＋柔光（虛線、上傳中同「我的」的 .me-thumb），點了選照片 */
.app-card-step {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 20px;
	padding-block: 24px;
	text-align: center;
}
.app-card-step-foot {
	justify-items: center;
}
.app-card-step-foot .rp-error {
	justify-self: stretch;
}
.rp-look.app-first-photo {
	width: 200px;
	height: auto;
	padding: 0;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
.rp-look.app-first-photo:disabled {
	cursor: default;
}

/* 掃碼頁「登入後傳照片／傳訊息」面板 */
.app-login-sheet {
	text-align: center;
}
.app-login-sheet .rp-lead {
	margin: 0;
}
.app-login-sheet .rp-textbtn {
	align-self: center;
}

/* toast：寬度照內容（left: 50% 時窄螢幕會被擠成兩行、「復原」直排），手機放在底部分頁列上面 */
body.app .rp-toast {
	width: max-content;
}
@media (max-width: 767px) {
	body.app .rp-toast {
		bottom: calc(80px + env(safe-area-inset-bottom));
	}
}

/* 名片大照片（舊連結頁、名片頁）：照片填滿 .rp-look 的 4:5 框 */
.rp-look {
	overflow: hidden;
}
.rp-look > img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------- 原圖與修圖（docs/mockups/original-upload、docs/mockups/edited-photos） ---------- */
/* 二選一的小切換：全部｜修圖、原圖｜壓縮、新的一版｜另一種修法 */
.oe-seg {
	display: inline-flex;
	gap: 2px;
	padding: 2px;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-control);
	flex: none;
}
.oe-seg button {
	min-height: 32px;
	padding: 0 12px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--text-muted);
	font: 600 13px/1 var(--font);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	cursor: pointer;
}
.oe-seg button[aria-checked='true'] {
	background: var(--primary);
	color: var(--on-primary);
}
.oe-seg button:disabled {
	opacity: 0.5;
	cursor: default;
}
.oe-seg button:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 1px;
}
@media (pointer: coarse) {
	.oe-seg button {
		min-height: 40px;
		padding: 0 14px;
	}
}
/* 牆上的「修」「修 2」 */
.oe-badge {
	position: absolute;
	top: 4px;
	left: 4px;
	padding: 1px 6px;
	border-radius: var(--radius-stamp);
	background: rgba(27, 26, 34, 0.72);
	color: #fff9f3;
	font: 700 11px/1.5 var(--font);
	pointer-events: none;
}
.ch-tile.is-pick .oe-badge {
	left: auto;
	right: 4px;
	top: auto;
	bottom: 4px;
}

/* 加照片對話框（docs/mockups/add-photos-dup）：新版本｜新照片｜已在相簿三區，底部「取消｜加入 N 張」固定 */
.oe-sheet {
	border-radius: var(--radius-sheet);
}
@media (max-width: 600px) {
	.oe-sheet {
		border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
	}
}
.oe-sheet .app-sheet-body {
	gap: 24px;
}
.oe-part {
	display: grid;
	gap: 8px;
}
.oe-sech {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 32px;
}
.oe-sech .ch-textbtn {
	margin-right: -8px;
	padding: 0 8px;
	font-size: 13px;
	font-weight: 600;
}
.oe-sec {
	margin: 0;
	color: var(--text-muted);
	font-size: 13px;
	font-weight: 700;
}
/* 小縮圖：做好才放圖，之前是底色 */
.oe-pic {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: var(--radius-stamp);
	background: var(--border);
}
.oe-pic img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.oe-old small {
	position: absolute;
	inset: auto 0 0;
	padding: 6px 0 1px;
	background: linear-gradient(transparent, rgba(27, 26, 34, 0.7));
	color: #fff;
	font: 700 10px/1.3 var(--font);
	font-variant-numeric: tabular-nums;
	text-align: center;
}
/* 縮圖格：點一下切換加／不加。加＝右上角打勾；不加＝變淡 */
.oe-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 4px;
}
.oe-tile {
	position: relative;
	padding: 0;
	border: 0;
	border-radius: var(--radius-stamp);
	background: none;
	cursor: pointer;
	transition: opacity 0.16s;
}
.oe-tile::after {
	content: '';
	position: absolute;
	top: 4px;
	right: 4px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--primary);
	box-shadow: 0 0 0 1.5px var(--raised);
	transition:
		opacity 0.16s,
		transform 0.16s;
}
.oe-tile::before {
	content: '';
	position: absolute;
	z-index: 1;
	top: 9px;
	right: 9px;
	width: 8px;
	height: 4px;
	border: solid var(--on-primary);
	border-width: 0 0 1.8px 1.8px;
	transform: rotate(-45deg);
	transition: opacity 0.16s;
}
.oe-tile[aria-pressed='false'] {
	opacity: 0.38;
}
.oe-tile[aria-pressed='false']::before {
	opacity: 0;
}
.oe-tile[aria-pressed='false']::after {
	opacity: 0;
	transform: scale(0.6);
}
.oe-more {
	aspect-ratio: 4 / 5;
	padding: 0;
	border: 0;
	border-radius: var(--radius-stamp);
	background: var(--border);
	color: var(--text);
	font: 700 13px/1 var(--font);
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}
.oe-grid.is-folded .oe-tile:nth-child(n + 12) {
	display: none;
}
/* 新版本：這張 → 疊到哪張；右邊 新版本｜新照片｜不加 */
.oe-vers {
	display: grid;
	gap: 8px;
}
.oe-ver {
	display: grid;
	grid-template-columns: 44px 14px 44px minmax(0, 1fr);
	align-items: center;
	gap: 8px;
}
.oe-um-arr {
	color: var(--text-muted);
	text-align: center;
}
.oe-ver .oe-pic,
.oe-ver .oe-um-arr {
	transition: opacity 0.16s;
}
.oe-ver[data-as='new'] .oe-old,
.oe-ver[data-as='new'] .oe-um-arr,
.oe-ver[data-as='skip'] .oe-pic,
.oe-ver[data-as='skip'] .oe-um-arr {
	opacity: 0.25;
}
.oe-seg3 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
}
.oe-seg3 button {
	min-height: 40px;
	padding: 0 4px;
}
.oe-tile:focus-visible,
.oe-more:focus-visible,
.oe-opt:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	.oe-tile,
	.oe-tile::before,
	.oe-tile::after,
	.oe-ver .oe-pic,
	.oe-ver .oe-um-arr {
		transition: none;
	}
}
.oe-opts {
	display: grid;
	gap: 8px;
}
.oe-opt {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 56px;
	padding: 10px 12px;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-control);
	background: var(--surface);
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.oe-opt i {
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	flex: none;
	border: 1.5px solid var(--input-border);
	border-radius: 50%;
}
.oe-opt[aria-checked='true'] {
	border-color: var(--text);
}
.oe-opt[aria-checked='true'] i {
	border-color: var(--text);
}
.oe-opt[aria-checked='true'] i::after {
	content: '';
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--text);
}
.oe-opt span {
	display: grid;
	line-height: 1.3;
}
.oe-opt small {
	color: var(--text-muted);
	font-size: 12px;
	font-weight: 500;
}
.oe-free {
	margin: 0;
	color: var(--text-muted);
	font-size: 12px;
}
/* 固定在面板底部：內容再長也不用捲到最下面才按得到 */
.oe-acts {
	position: sticky;
	bottom: 0;
	z-index: 2;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin: 0 -24px -24px;
	padding: 12px 24px 24px;
	border-top: 1px solid var(--border);
	background: var(--raised);
}
@media (max-width: 600px) {
	.oe-acts {
		margin-bottom: calc(-1 * max(24px, env(safe-area-inset-bottom)));
		padding-bottom: max(24px, env(safe-area-inset-bottom));
	}
}
.oe-acts .btn:disabled {
	background: var(--border);
	color: var(--text-disabled);
	cursor: default;
}
/* /send 底部：原圖｜壓縮、空間剩 */
.bs-quality {
	margin-left: auto;
}
.bs-foot .oe-free {
	white-space: nowrap;
}
@media (max-width: 767px) {
	.bs-quality {
		margin-left: 0;
	}
}

/* ---------- 新增／編輯活動：整天開關＋開始／結束（docs/mockups/activity-calendar-20261121 第五段） ---------- */
.ev-box {
	display: grid;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-control);
	background: var(--surface);
}
.ev-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 52px;
	font: 600 16px/1.3 var(--font);
}
.ev-row + .ev-row,
.ev-row + .ev-wheel,
.ev-wheel + .ev-row {
	border-top: 1px solid var(--border);
}
.ev-when {
	display: flex;
	gap: 8px;
	min-width: 0;
}
.ev-chip {
	min-height: 36px;
	padding: 0 10px;
	border: 0;
	border-radius: var(--radius-photo);
	background: color-mix(in srgb, var(--text) 8%, var(--surface));
	color: var(--text);
	font: 400 15px/36px var(--font);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	cursor: pointer;
}
.ev-chip:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}
.ev-time[aria-expanded="true"] {
	background: var(--primary);
	color: var(--on-primary);
}
.ev-time[hidden],
.ev-wheel[hidden] {
	display: none;
}
.ev-wheel {
	padding: 4px 0;
}
.ev-wheel-cols {
	grid-template-columns: 1fr 1fr;
	max-width: 200px;
	margin: 0 auto;
}
/* 開關（同 App PiMeToggleStyle）：關＝淡底＋次要色圓點靠左；開＝主色底（亮色墨色、深色暖白）＋反白圓點靠右。
   2026-12-02：原本圓點一律白色，深色模式開著（暖白底）看不出開關 */
.ev-switch {
	position: relative;
	flex: none;
	width: 50px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 15px;
	background: var(--perf);
	cursor: pointer;
	transition: background 0.16s;
}
.ev-switch i {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--text-muted);
	transition: transform 0.16s var(--ease-out), background 0.16s;
}
.ev-switch[aria-checked="true"] {
	background: var(--primary);
}
.ev-switch[aria-checked="true"] i {
	background: var(--on-primary);
	transform: translateX(20px);
}
.ev-switch:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	.ev-switch,
	.ev-switch i {
		transition: none;
	}
}

.ev-ticket {position: relative; flex: none; display: grid; min-width: 3rem; justify-items: center; align-content: center; border: 1.5px solid var(--border); border-radius: 12px; transform-origin: 50% -6px; padding: .25rem .4rem; font-variant-numeric: tabular-nums; line-height: 1.1; background: var(--surface); color: var(--text)}
.ev-ticket b {font-size: 1.32rem}
.ev-ticket small {font-size: .7rem}
/* 日期小票上面的晨光桃吊環；滑過整張卡時像吊牌晃一下 */
.ev-ticket::before {content: ''; position: absolute; top: -5px; left: 50%; width: 18px; height: 8px; margin-left: -9px; border-radius: 4px; background: var(--brand)}
@keyframes soft-swing {20% {transform: rotate(9deg)} 45% {transform: rotate(-6deg)} 70% {transform: rotate(3deg)} 100% {transform: rotate(0)}}

/* Same transparent 4:5 card artwork as the iPhone card editor. */
.card-frame-art {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: grid;
	align-items: end;
	justify-items: center;
	pointer-events: none;
	user-select: none;
	background: var(--frame-image) center / 100% 100% no-repeat;
	container-type: inline-size;
}
.card-frame-art[data-frame="founding"] {
	--frame-image: url("../assets/card-frames/founding.svg");
	--frame-ink: #4a2e1c;
	--frame-plate: #e8c287;
}
.card-frame-art[data-frame="events"] {
	--frame-image: url("../assets/card-frames/events.svg");
	--frame-ink: #73291f;
	--frame-plate: #ffdbb0;
}
.card-frame-art[data-frame="encounters"] {
	--frame-image: url("../assets/card-frames/encounters.svg");
	--frame-ink: #1f4d4a;
	--frame-plate: #bfdbc4;
}
.card-frame-art > span {
	color: var(--frame-ink);
	background: var(--frame-plate);
	padding: .15em .8em;
	margin-bottom: .6cqi;
	border: 1px solid;
	border-radius: 2px;
	font: 700 clamp(10px, 3.75cqi, 16px)/1.35 var(--font);
	letter-spacing: .08em;
}
.card-frame-art[data-frame="founding"] > span { font-family: serif; }
.card-frame-art[data-frame="encounters"] > span { border-radius: 1em; }
.card-frame-picker { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.card-frame-picker legend { margin-bottom: 4px; font: 600 15px/1.4 var(--font); }
.card-frame-picker > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 4px; }
.card-frame-picker label { position: relative; display: grid; align-items: center; min-height: 44px; cursor: pointer; }
.card-frame-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.card-frame-picker label span {
	display: grid; place-items: center; min-height: 34px; padding: 0 3px;
	border: 1px solid var(--input-border); border-radius: 12px;
	font: 500 14px/1.35 var(--font); color: var(--text); background: var(--surface);
}
.card-frame-picker input:checked + span { color: var(--bg); background: var(--text); border-color: var(--text); }
.card-frame-picker input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.scan-card-photo { position: relative; display: inline-grid; flex: none; overflow: hidden; border-radius: var(--radius-photo); }
.scan-card-photo > img { display: block; }

.app-act > .scan-card-photo { width: 40px; height: 50px; }
.app-act > .scan-card-photo > img, .app-act > .scan-card-photo > .app-ph { width: 100%; height: 100%; object-fit: cover; }

.card-art-caption { position: absolute; z-index: 1; inset: auto 0 0; display: grid; gap: 2px; padding: 34px 12px 10px; background: linear-gradient(transparent, rgb(0 0 0 / .78)); color: white; text-align: left; pointer-events: none; }
.card-art-caption b { font: 700 18px/1.3 var(--font); }
.card-art-caption small { font: 500 13px/1.4 var(--font); }
:where(.mc-art, .ec-photo):has(.card-frame-art) .card-art-caption { padding-bottom: max(27px, 7%); }

/* ---------- 內容出現（2026-11-30）：換成另一種畫面時淡入、往上浮一點；同一種畫面重畫（資料更新）不播。
   切換分頁本身沒有轉場動畫（使用者 11/30 指定移除）；分頁列在畫面出現前就放好（tabs-early.js），換頁不會晚一拍才出現 ---------- */
@media (prefers-reduced-motion: no-preference) {
	.rp-view.rp-enter {
		animation: 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) backwards rp-enter;
	}
}
@keyframes rp-enter {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

/* ---------- 電腦版頂列（2026-11-30）：Logo 對齊側欄的圖示、右邊按鈕貼齊畫面右邊，不再跟著置中的 1200 寬容器跑 ---------- */
@media (min-width: 768px) {
	body.app .nav-inner {
		width: auto;
		margin: 0;
		padding: 0 24px 0 24px;
	}
}

/* ---------- 按下去的回饋（2026-11-30）：點得到的卡片、列、日期格按下時微微縮一下（100ms 內有反應），放開就回來 ---------- */
@media (prefers-reduced-motion: no-preference) {
	.ev-hero-main,
	.ev-upcoming,
	.ev-mini,
	.me-cards-item,
	.dn-date,
	.ch-row,
	.dn-member,
	.app-tabbar a {
		transition: transform 0.12s ease-out, background-color 0.15s ease-out;
	}
	.ev-hero-main:active,
	.ev-upcoming:active,
	.ch-row:active,
	.dn-member:active {
		transform: scale(0.99);
	}
	.ev-mini:active,
	.me-cards-item:active,
	.dn-date:active,
	.app-tabbar a:active {
		transform: scale(0.96);
	}
}

/* ---------- 圓潤可愛風（2026-12-03）：分頁按下會彈、選到的圖示彈一下；手機選到的那格上面一顆晨光桃小圓點 ---------- */
.app-tabbar a {
	transition: background-color 0.2s, transform 0.4s var(--spring);
}
.app-tabbar a:active {
	transform: scale(0.9);
}
.app-tabbar a[aria-current] .icon {
	animation: soft-pop 0.5s var(--spring);
}
@keyframes soft-pop {
	from {
		transform: scale(0.7);
	}
}
@media (max-width: 767px) {
	.app-tabbar a[aria-current]::before {
		content: '';
		position: absolute;
		top: 4px;
		left: 50%;
		width: 6px;
		height: 6px;
		margin-left: -3px;
		border-radius: 50%;
		background: var(--brand);
	}
}

/* ---------- 電腦版沒有頂列（2026-12-03，照 Threads）：Logo 在側欄最上面，深淺色與下載 App 在側欄下方 ---------- */
.app-tabbar .app-side-brand,
.app-tabbar .app-side-tools {
	display: none;
}
@media (min-width: 768px) {
	body.app {
		--nav-h: 0px;
	}
	body.app header.nav {
		display: none;
	}
	.app-tabbar {
		top: 0;
		padding-top: 16px;
	}
	.app-tabbar .app-side-brand {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		gap: 8px;
		min-height: 48px;
		margin-bottom: 12px;
		padding: 0;
		color: var(--text);
		background: none;
	}
	.app-tabbar .app-side-brand:hover {
		background: none;
	}
	.app-side-brand .logo-lockup {
		display: none;
	}
	.app-tabbar .app-side-tools {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 8px;
		margin-top: auto;
		padding-bottom: 8px;
	}
	/* 下面兩格（設定、關於）接在工具後面，不再自己推到底 */
	.app-tabbar .app-side-tools ~ .app-tab-about,
	html:not(.signed-in) .app-tabbar .app-side-tools ~ .app-tab-settings + .app-tab-about {
		margin-top: 0;
	}
	.app-tabbar .app-side-download {
		display: flex;
		flex-direction: row;
		justify-content: center;
		width: 40px;
		min-height: 40px;
		padding: 0;
		color: var(--text);
		font: 700 14px/1 var(--font);
	}
	.app-tabbar .app-side-download span {
		display: none;
	}
	.app-tabbar .app-side-download .icon {
		width: 20px;
		height: 20px;
	}
}
@media (min-width: 1100px) {
	.app-tabbar .app-side-brand {
		justify-content: flex-start;
		padding: 0 12px;
	}
	.app-side-brand .logo-lockup {
		display: block;
	}
	.app-tabbar .app-side-tools {
		flex-direction: row;
		padding: 0 0 8px;
	}
	.app-tabbar .app-side-download {
		flex: 1;
		width: auto;
		gap: 6px;
	}
	.app-tabbar .app-side-download span {
		display: inline;
	}
}

/* ---------- 手機網頁導下載（2026-12-03，照 Threads）：沒登入時頂列一排「登入」「開啟 App」 ---------- */
.nav-guest {
	display: none;
}
@media (max-width: 767px) {
	html.guest:not(.signed-in) body.app .nav-actions .theme-toggle,
	html.guest:not(.signed-in) body.app .nav-actions .nav-download {
		display: none;
	}
	html.guest:not(.signed-in) body.app .nav-actions {
		gap: 8px;
	}
	html.guest:not(.signed-in) body.app .nav-guest {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		height: 36px;
		padding: 0 14px;
		border-radius: 12px;
		font-size: 14px;
	}
	html.guest:not(.signed-in) body.app .nav-guest.btn-outline {
		border-color: var(--border);
		background: var(--surface);
	}
}

/* iPhone／iPad 的 Safari 頂端已經有原生橫幅（Smart App Banner）：網頁自己的下載、開啟 App 收起來，同一個畫面只有一個下載入口 */
html.ios-safari body.app .nav-download,
html.ios-safari body.app .app-side-download,
html.ios-safari body.app [data-open-app] {
	display: none !important;
}
