/* Personal Business Hub – Manager app. Mobile first, premium & simple. */
:root {
	--pbh-primary: #0f2341;
	--pbh-accent: #c9a24b;
}
.pbhm-body [hidden] { display: none !important; }
.pbhm-body {
	--ink: #13203a;
	--muted: #6b7690;
	--line: #e7eaf0;
	--bg: #f4f6f9;
	--card: #fff;
	--ok: #13803f;
	--okbg: #e6f6ec;
	--bad: #c0392b;
	--badbg: #fdecec;
	--warn: #a86a00;
	--warnbg: #fff4dc;
	--info: #2457a6;
	--infobg: #e8f0fc;
	--r: 16px;
	--sh: 0 4px 18px rgba(15, 35, 65, .06);
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}
.pbhm-body *, .pbhm-body *::before, .pbhm-body *::after { box-sizing: border-box; }
.pbhm-body a { color: inherit; text-decoration: none; }
.pbhm-body h1, .pbhm-body h2, .pbhm-body h3, .pbhm-body h4 { margin: 0; line-height: 1.25; }
.pbhm-body p { margin: 0 0 .6em; }
:where(.pbhm-body) button { font-family: inherit; font-size: inherit; line-height: inherit; color: inherit; }
.m-noscroll { overflow: hidden; }
.m-ico { width: 20px; height: 20px; flex: none; }
.m-grow { flex: 1; min-width: 0; }
.m-muted { color: var(--muted); }
.m-small { font-size: .82rem; }
.m-center { text-align: center; }
.m-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; letter-spacing: .02em; }
.m-danger { color: var(--bad) !important; }
.m-pre { white-space: pre-wrap; }
.m-print-only { display: none; }

.pbhm-boot, .m-loading { padding: 60px 20px; text-align: center; color: var(--muted); }
.m-loading { display: flex; justify-content: center; gap: 6px; }
.m-loading span { width: 9px; height: 9px; border-radius: 50%; background: var(--pbh-accent); animation: mdot 1s infinite ease-in-out; }
.m-loading span:nth-child(2) { animation-delay: .15s; }
.m-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes mdot { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* Login gate */
.pbh-login { max-width: 400px; margin: 10vh auto; background: #fff; border-radius: 20px; padding: 28px 22px; box-shadow: var(--sh); border-top: 5px solid var(--pbh-accent); }
.pbh-login h1 { color: var(--pbh-primary); margin-bottom: 6px; font-size: 1.5rem; }
.pbh-login p { color: var(--muted); }
.pbh-login form p { margin-bottom: 14px; color: var(--ink); }
.pbh-login label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.pbh-login input[type=text], .pbh-login input[type=password] { width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; font-size: 16px; }
.pbh-login input[type=submit], .pbh-login .pbh-btn { width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--pbh-primary); color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pbh-login .login-remember label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.pbh-small { font-size: .85rem; }

/* App shell */
#pbhm-app { min-height: 100vh; }
.m-side { display: none; }
.m-main { padding-bottom: 84px; }
.m-bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 12px; padding-top: 8px; background: var(--pbh-primary); color: #fff; }
.m-bar-left, .m-bar-right { display: flex; align-items: center; gap: 6px; min-width: 40px; }
.m-bar-right { justify-content: flex-end; }
.m-title { flex: 1; font-size: 1.08rem; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-bar .m-iconbtn { color: #fff; }
.m-bar .m-iconbtn:hover { background: rgba(255,255,255,.12); }
.m-bar .m-btn { background: var(--pbh-accent); color: #1a1407; }
.m-content { max-width: 920px; margin: 0 auto; padding: 14px 14px 24px; overflow-x: clip; }

.m-tabs { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding: 4px 4px 6px; box-shadow: 0 -4px 20px rgba(15,35,65,.05); }
.m-tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 2px; font-size: .7rem; font-weight: 600; color: var(--muted); }
.m-tabs a .m-ico { width: 23px; height: 23px; }
.m-tabs a.is-active { color: var(--pbh-primary); }
.m-tabs a.is-active .m-ico { color: var(--pbh-accent); }
.m-tabs .m-tab-center .m-ico { width: 50px; height: 50px; padding: 13px; margin-top: -22px; border-radius: 50%; background: var(--pbh-accent); color: #1a1407 !important; box-shadow: 0 6px 18px rgba(201,162,75,.45); border: 4px solid #fff; }

/* Buttons */
.m-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--pbh-primary); color: #fff !important; font-weight: 700; cursor: pointer; white-space: nowrap; transition: transform .12s, opacity .12s; }
.m-btn:active { transform: scale(.97); }
.m-btn:disabled { opacity: .55; cursor: wait; }
.m-btn .m-ico { width: 18px; height: 18px; }
.m-btn--sm { min-height: 36px; padding: 0 12px; font-size: .86rem; border-radius: 10px; }
.m-btn--ghost { background: #fff; color: var(--pbh-primary) !important; border: 1.5px solid var(--line); }
.m-btn--text { background: transparent; color: var(--pbh-primary) !important; padding: 0 8px; }
.m-btn--gold { background: var(--pbh-accent); color: #1a1407 !important; }
.m-btn--danger { background: var(--bad); }
.m-btn--wa { background: #1faa59; }
.m-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; color: var(--ink); flex: none; }
.m-iconbtn:hover { background: var(--bg); }
.m-link { color: var(--pbh-primary) !important; font-weight: 700; font-size: .88rem; }

/* Badges & tags */
.m-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.m-badge--ok { background: var(--okbg); color: var(--ok); }
.m-badge--bad { background: var(--badbg); color: var(--bad); }
.m-badge--mute { background: #eef0f4; color: #5b6680; }
.m-badge--gold { background: var(--warnbg); color: var(--warn); }
.m-badge--info { background: var(--infobg); color: var(--info); }
.m-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #eef0f4; color: #4b5671; font-size: .72rem; font-weight: 600; }
.m-tag--warn { background: var(--warnbg); color: var(--warn); }
.m-tag--bad { background: var(--badbg); color: var(--bad); }
.m-dot { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .68rem; font-style: normal; align-items: center; justify-content: center; }

/* Cards & layout */
.m-card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; margin-bottom: 14px; }
.m-card h3 { font-size: 1rem; margin-bottom: 10px; }
.m-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.m-card-head h3 { margin: 0; }
.m-h3 { font-size: 1rem; margin: 18px 2px 10px; }
.m-eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 700; color: var(--pbh-accent); margin: 0 0 2px !important; }
.m-hello { margin: 4px 2px 12px; }
.m-hello h2 { font-size: 1.4rem; }
.m-empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.m-empty .m-btn { margin-top: 8px; }
.m-grid2 { display: grid; gap: 0 14px; }

.m-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.m-filters--dates input[type=date] { flex: 1 1 130px; min-height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; background: #fff; }
.m-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.m-chips--scroll { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
.m-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: .84rem; cursor: pointer; white-space: nowrap; color: var(--muted); }
.m-chip.is-active { background: var(--pbh-primary); border-color: var(--pbh-primary); color: #fff; }
.m-select-sm, .m-select-lg { min-height: 36px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; font-size: .88rem; background: #fff; max-width: 100%; }
.m-select-lg { width: 100%; min-height: 48px; font-size: 1rem; font-weight: 600; }
.m-search { position: relative; flex: 1 1 220px; }
.m-search .m-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; }
.m-search input { width: 100%; min-height: 44px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px 0 38px; font-size: 16px; background: #fff; }
.m-toolbar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }

/* Alerts */
.m-alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--infobg); color: var(--info); margin-bottom: 10px; font-size: .92rem; }
.m-alert a { text-decoration: underline; }
.m-alert--gold { background: var(--warnbg); color: var(--warn); }
.m-alert > span { flex: 1; }

/* KPIs */
.m-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.m-kpi { background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 2px; border-left: 4px solid var(--pbh-accent); }
.m-kpi strong { font-size: 1.55rem; font-weight: 800; color: var(--pbh-primary); line-height: 1.1; }
.m-kpi strong small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.m-kpi span { color: var(--muted); font-size: .82rem; font-weight: 600; }
.m-kpi em { font-style: normal; color: var(--ok); font-size: .76rem; font-weight: 600; }
.m-kpi--wide { grid-column: 1 / -1; background: linear-gradient(135deg, var(--pbh-primary), #1d3a66); border-left: 0; }
.m-kpi--wide strong { color: #fff; }
.m-kpi--wide span { color: rgba(255,255,255,.75); }
.m-kpi--wide em { color: var(--pbh-accent); }
.m-kpis--5 { grid-template-columns: repeat(3, 1fr); }
.m-kpis--5 .m-kpi { padding: 12px; }
.m-kpis--5 .m-kpi strong { font-size: 1.3rem; }

.m-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.m-quick-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; border-radius: var(--r); background: #fff; box-shadow: var(--sh); border: 0; cursor: pointer; font-weight: 700; font-size: .8rem; color: var(--pbh-primary); }
.m-quick-item .m-ico { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: #f4efe2; color: var(--warn); }
.m-quick-item span::before { content: "+ "; }

.m-progress { height: 6px; border-radius: 3px; background: #eef0f4; margin-top: 6px; overflow: hidden; }
.m-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--pbh-accent), #e3c57d); border-radius: 3px; }

/* Rows & lists */
.m-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
.m-row:last-child { border-bottom: 0; }
.m-row--btn { cursor: pointer; }
.m-row strong, .m-item strong { display: block; font-weight: 700; }
.m-row small, .m-item small { display: block; color: var(--muted); font-size: .82rem; }
.m-row > .m-ico, .m-item > .m-ico { color: #b8bfcd; }
.m-quote { margin-top: 4px; padding: 6px 10px; border-left: 3px solid var(--pbh-accent); background: #faf8f2; border-radius: 0 8px 8px 0; color: #4b5671 !important; }
.m-event-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.m-event-row:last-child { border-bottom: 0; }
.m-event-row small { display: block; color: var(--muted); font-size: .82rem; }
.m-date-box { width: 50px; height: 54px; border-radius: 12px; background: #f4efe2; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; color: var(--pbh-primary); }
.m-date-box b { font-size: 1.25rem; line-height: 1; }
.m-date-box span { font-size: .7rem; text-transform: uppercase; font-weight: 700; color: var(--warn); }

.m-list { display: grid; gap: 10px; }
.m-item { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: 12px; }
.m-item-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
a.m-item.m-item-main, button.m-item.m-item-main { padding: 12px; background: #fff; }
.m-item .m-badge { margin-top: 4px; }
.m-row-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 5px; font-size: .8rem; }
.m-row-meta .m-badge { margin: 0; }
.m-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; background: var(--bg); }
.m-thumb--ph { display: flex; align-items: center; justify-content: center; color: var(--pbh-accent); }
.m-order { display: flex; flex-direction: column; gap: 2px; }
.m-order button { width: 32px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font-size: .7rem; color: var(--muted); }
.m-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--pbh-primary), #2a4c80); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.m-avatar--lg { width: 58px; height: 58px; font-size: 1.4rem; border: 3px solid var(--pbh-accent); }
.m-right { text-align: right; }
.m-reg.is-cancelled { opacity: .6; }
.m-reg-btns, .m-fu-btns { display: flex; align-items: center; gap: 6px; }
.m-wa { color: #1faa59 !important; }
.m-stage { min-height: 36px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 8px; font: inherit; font-size: .82rem; font-weight: 700; background: #fff; max-width: 120px; }
.m-lead { align-items: flex-start; }

/* Menu */
.m-menu { background: #fff; border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 14px; overflow: hidden; }
.m-menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.m-menu-item:last-child { border-bottom: 0; }
.m-menu-item > .m-ico:first-child { width: 38px; height: 38px; padding: 8px; border-radius: 10px; background: #f4efe2; color: var(--warn); }
.m-menu-item > div { flex: 1; }
.m-menu-item small { display: block; color: var(--muted); font-size: .8rem; }
.m-menu-item > .m-ico:last-child { color: #c3c9d5; width: 18px; }

/* Forms */
.m-form { display: flex; flex-wrap: wrap; gap: 14px 12px; }
.m-form-heading { width: 100%; margin-top: 8px !important; padding-top: 12px; border-top: 1px solid var(--line); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--warn); }
.m-form-heading:first-child { border-top: 0; padding-top: 0; margin-top: 0 !important; }
.m-field { display: grid; gap: 6px; width: 100%; }
.m-field[hidden] { display: none; }
.m-field--half { width: calc(50% - 6px); }
.m-field > span { font-weight: 600; font-size: .86rem; }
.m-field b { color: var(--bad); }
.m-field small { color: var(--muted); font-size: .78rem; }
.m-field input, .m-field select, .m-field textarea, .m-notes, .m-fb-row input, .m-fb-row select, .m-fb-row textarea, .m-repeat-row input, .m-sheet input[type=file] {
	width: 100%; min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 16px; background: #fbfcfd; color: var(--ink);
}
.m-field input, .m-field select, .m-field textarea { min-width: 0; max-width: 100%; }
.m-field--half { min-width: 0; }
.m-field input[type=date], .m-field input[type=time], .m-field input[type=datetime-local] { -webkit-appearance: none; appearance: none; display: block; text-align: left; }
.m-field input[type=color] { padding: 4px; height: 46px; }
.m-field textarea, .m-notes { min-height: 80px; resize: vertical; }
.m-field input:focus, .m-field select:focus, .m-field textarea:focus, .m-notes:focus { outline: none; border-color: var(--pbh-accent); background: #fff; box-shadow: 0 0 0 3px rgba(201,162,75,.16); }
.m-field.has-error input, .m-field.has-error select, .m-field.has-error textarea, .m-field.has-error .m-picker { border-color: var(--bad); }
.m-field.has-error > span { color: var(--bad); }
.m-readonly { padding: 10px 0; color: var(--muted); }
.m-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.m-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.m-switch i { position: relative; width: 46px; height: 28px; border-radius: 14px; background: #d6dbe4; flex: none; transition: background .2s; }
.m-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.m-switch input:checked + i { background: var(--ok); }
.m-switch input:checked + i::after { transform: translateX(18px); }
.m-switch--sm i { width: 38px; height: 22px; }
.m-switch--sm i::after { width: 16px; height: 16px; }
.m-switch--sm input:checked + i::after { transform: translateX(16px); }
.m-radio { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; }

.m-image { display: flex; align-items: center; gap: 12px; }
.m-image-prev { width: 120px; height: 80px; border-radius: 12px; background: var(--bg); border: 1.5px dashed var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; color: var(--muted); font-size: .78rem; }
.m-image-prev img { width: 100%; height: 100%; object-fit: cover; }
.m-image--round .m-image-prev { width: 80px; border-radius: 50%; }
.m-image-btns { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.m-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m-gallery-item { position: relative; aspect-ratio: 1; }
.m-gallery-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.m-gallery-item button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.m-gallery-item button .m-ico { width: 14px; }
.m-gallery-add { aspect-ratio: 1; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; color: var(--muted); font-size: .76rem; }
.m-repeat { display: grid; gap: 8px; }
.m-repeat-row { display: grid; grid-template-columns: 1fr 1.3fr 40px; gap: 6px; }
.m-picker { border: 1.5px solid var(--line); border-radius: 12px; background: #fbfcfd; position: relative; }
.m-picker input { border: 0 !important; background: transparent !important; box-shadow: none !important; }
.m-picker-sel { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-weight: 700; }
.m-picker-sel button { border: 0; background: none; color: var(--pbh-primary); font-weight: 700; cursor: pointer; }
.m-picker-res button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: #fff; cursor: pointer; }
.m-picker-res small { display: block; color: var(--muted); }

.m-savebar { position: sticky; bottom: 76px; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 0 -4px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-radius: var(--r); box-shadow: 0 -2px 16px rgba(15,35,65,.08); }
.m-savebar--inline { position: static; box-shadow: none; padding: 10px 0 0; background: none; }
.m-card--form { padding: 18px 16px; }
.m-err { color: var(--bad); font-weight: 600; font-size: .88rem; margin-top: 8px; }
.m-err:empty { display: none; }

/* Modal / sheet */
.m-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.m-modal-bg { position: absolute; inset: 0; background: rgba(10, 18, 34, .5); opacity: 0; transition: opacity .2s; }
.m-sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; background: #fff; border-radius: 22px 22px 0 0; transform: translateY(30px); opacity: 0; transition: transform .22s, opacity .22s; }
.m-sheet--wide { max-width: 760px; }
.m-modal.is-in .m-modal-bg { opacity: 1; }
.m-modal.is-in .m-sheet { transform: none; opacity: 1; }
.m-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 18px; }
.m-sheet-head h3 { font-size: 1.08rem; }
.m-sheet-body { padding: 4px 18px 16px; overflow-y: auto; }
.m-sheet-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 18px 12px; border-top: 1px solid var(--line); }

.m-toast { position: fixed; left: 50%; top: 64px; z-index: 200; transform: translate(-50%, -12px); pointer-events: none; opacity: 0; transition: .25s; background: #13203a; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .9rem; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.m-toast.is-in { transform: translate(-50%, 0); opacity: 1; }
.m-toast--bad { background: var(--bad); }
.m-toast--warn { background: var(--warn); }

/* Event detail */
.m-event-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.m-event-head img { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; flex: none; }
.m-event-head h2 { font-size: 1.2rem; margin: 4px 0 2px; }
.m-tabbar { display: flex; gap: 4px; background: #fff; padding: 4px; border-radius: 14px; box-shadow: var(--sh); margin-bottom: 14px; }
.m-tabbar a { flex: 1; text-align: center; padding: 9px 6px; border-radius: 10px; font-weight: 700; font-size: .84rem; color: var(--muted); white-space: nowrap; }
.m-tabbar a.is-active { background: var(--pbh-primary); color: #fff; }
.m-tabbar--scroll { overflow-x: auto; scrollbar-width: none; }
.m-tabbar--scroll a { flex: none; padding: 9px 14px; }
.m-actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.m-action { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: .86rem; cursor: pointer; text-align: left; color: var(--pbh-primary); }
.m-action .m-ico { color: var(--pbh-accent); }
.m-action--gold { background: var(--pbh-accent); border-color: var(--pbh-accent); color: #1a1407; }
.m-action--gold .m-ico { color: #1a1407; }
.m-action.m-danger .m-ico { color: var(--bad); }
.m-dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; font-size: .9rem; }
.m-dl dt { color: var(--muted); }
.m-dl dd { margin: 0; word-break: break-word; }
.m-dl a { color: var(--info); }
.m-qr-card { text-align: center; }
.m-qr-img { width: 100%; max-width: 340px; border-radius: 16px; border: 1px solid var(--line); margin: 0 auto 12px; display: block; }
.m-copy { display: flex; gap: 6px; margin: 10px 0 14px; }
.m-copy input { flex: 1; min-width: 0; min-height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font-size: .82rem; color: var(--muted); }
.m-fixed-field { padding: 12px 14px; border-radius: 12px; background: var(--bg); margin-bottom: 8px; font-weight: 600; color: var(--muted); }
.m-fixed-field b { color: var(--bad); }
.m-fb-row { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; display: grid; gap: 8px; }
.m-fb-top { display: grid; grid-template-columns: 1fr 130px; gap: 8px; }
.m-fb-bot { display: flex; align-items: center; gap: 4px; }

/* Check-in */
.m-scan-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.m-scan-stats div { background: #fff; border-radius: 14px; padding: 10px; text-align: center; box-shadow: var(--sh); }
.m-scan-stats strong { display: block; font-size: 1.45rem; color: var(--pbh-primary); }
.m-scan-stats span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.m-scanner { position: relative; aspect-ratio: 1; max-width: 460px; margin: 0 auto 8px; border-radius: 22px; overflow: hidden; background: #0b1426; display: flex; align-items: center; justify-content: center; }
.m-scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.m-scanner.is-live video { opacity: 1; }
.m-scan-frame { position: absolute; inset: 18%; border: 3px solid rgba(201,162,75,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); pointer-events: none; opacity: 0; }
.m-scanner.is-live .m-scan-frame { opacity: 1; }
.m-scan-start { position: relative; z-index: 2; min-height: 54px; font-size: 1.02rem; }
.m-scanner.is-live .m-scan-start { position: absolute; bottom: 14px; min-height: 42px; background: rgba(255,255,255,.92); color: var(--ink) !important; }
.m-scan-result { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; color: #fff; animation: mpop .2s ease-out; }
.m-scan-result p { margin: 2px 0; }
.m-scan-result:not([hidden]) ~ .m-scan-start { visibility: hidden; }
.m-scan-result h3 { font-size: 1.5rem; margin: 8px 0 4px; }
.m-scan-result--ok { background: rgba(19,128,63,.94); }
.m-scan-result--warn { background: rgba(168,106,0,.94); }
.m-scan-result--bad { background: rgba(192,57,43,.94); }
.m-scan-ico .m-ico { width: 64px; height: 64px; padding: 12px; border-radius: 50%; background: rgba(255,255,255,.2); }
.m-scan-name { font-size: 1.3rem; font-weight: 800; }
@keyframes mpop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* CRM */
.m-cust-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.m-cust-head h2 { font-size: 1.3rem; }
.m-contact-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.m-act.is-done strong { color: var(--muted); }
.m-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; color: transparent; padding: 0; align-self: flex-start; }
.m-check .m-ico { width: 16px; }
.m-check.is-on { background: var(--ok); border-color: var(--ok); color: #fff; }

/* Tables & bars */
.m-table-wrap { overflow-x: auto; margin: 0 -4px; }
.m-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.m-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 6px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.m-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.m-table a { color: var(--info); font-weight: 600; }
.m-table .m-total td { font-weight: 800; border-top: 2px solid var(--line); }
.m-bars { display: grid; gap: 8px; }
.m-bar-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; font-size: .84rem; }
.m-bar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.m-bar-row div { height: 10px; background: #eef0f4; border-radius: 5px; overflow: hidden; }
.m-bar-row i { display: block; height: 100%; background: linear-gradient(90deg, var(--pbh-primary), #3a5f99); border-radius: 5px; }
.m-pager { display: flex; justify-content: center; gap: 10px; }

/* Embedded mode (shortcode) */
.pbhm-embed { border-radius: 16px; overflow: hidden; }
.pbhm-embed .m-tabs { position: sticky; }
.pbhm-embed .m-main { padding-bottom: 12px; }

/* Desktop */
@media (min-width: 900px) {
	#pbhm-app { display: grid; grid-template-columns: 250px 1fr; }
	.m-side { display: block; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--pbh-primary); color: #fff; padding: 18px 12px; }
	.m-side-brand { font-weight: 800; letter-spacing: .04em; padding: 6px 12px 18px; font-size: .95rem; }
	.m-side-brand small { display: block; color: var(--pbh-accent); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
	.m-side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,.75); font-weight: 600; font-size: .9rem; }
	.m-side a .m-ico { width: 19px; height: 19px; }
	.m-side a:hover { background: rgba(255,255,255,.08); color: #fff; }
	.m-side a.is-active { background: rgba(255,255,255,.12); color: #fff; }
	.m-side a.is-active .m-ico { color: var(--pbh-accent); }
	.m-side-sep { height: 1px; background: rgba(255,255,255,.1); margin: 10px 8px; }
	.m-tabs { display: none; }
	.m-main { padding-bottom: 0; min-width: 0; }
	.m-bar { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); padding: 10px 24px; }
	.m-bar .m-iconbtn { color: var(--ink); }
	.m-bar .m-iconbtn:hover { background: var(--bg); }
	.m-bar .m-btn { background: var(--pbh-primary); color: #fff; }
	.m-title { text-align: left; font-size: 1.2rem; }
	.m-content { padding: 22px 24px 40px; }
	.m-kpis { grid-template-columns: repeat(4, 1fr); }
	.m-kpis--5 { grid-template-columns: repeat(5, 1fr); }
	.m-kpi--wide { grid-column: span 2; }
	.m-grid2 { grid-template-columns: 1fr 1fr; }
	.m-actions-grid { grid-template-columns: repeat(3, 1fr); }
	.m-savebar { bottom: 12px; }
	.m-modal { align-items: center; }
	.m-sheet { border-radius: 20px; }
	.m-toast { top: 20px; }
	.pbhm-embed #pbhm-app { grid-template-columns: 1fr; }
	.pbhm-embed .m-side { display: none; }
	.pbhm-embed .m-tabs { display: grid; }
}

@media print {
	.m-side, .m-tabs, .m-bar, .m-noprint, .m-savebar, .m-toast { display: none !important; }
	.pbhm-body { background: #fff; }
	#pbhm-app { display: block; }
	.m-content { padding: 0; max-width: none; }
	.m-card, .m-kpi { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
	.m-print-only { display: block; }
	.m-grid2 { grid-template-columns: 1fr 1fr; display: grid; }
	.m-kpis { grid-template-columns: repeat(4, 1fr); }
}

/* Chats */
.m-tabs a, .m-side a { position: relative; }
.m-badge-dot { position: absolute; top: 2px; left: 54%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e0352b; color: #fff; font-size: .66rem; font-style: normal; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.m-side .m-badge-dot { position: static; margin-left: auto; border: 0; }
.m-alert--live { background: #e6f6ec; color: #13703f; }
.m-chat-row.is-waiting { box-shadow: 0 0 0 2px #1f8a52, var(--sh); }
.m-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-chat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.m-chat-head small { display: block; color: var(--muted); }
.m-chat-box { background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 260px; margin-bottom: 12px; }
.m-cmsg { max-width: 85%; align-self: flex-start; padding: 8px 12px 6px; border-radius: 4px 16px 16px 16px; background: var(--bg); font-size: .92rem; }
.m-cmsg b { display: block; font-size: .72rem; color: var(--muted); }
.m-cmsg p { margin: 2px 0 0; word-wrap: break-word; }
.m-cmsg time { display: block; text-align: right; font-size: .66rem; color: #9aa3b5; }
.m-cmsg--customer { background: #f4efe2; }
.m-cmsg--customer b { color: var(--warn); }
.m-cmsg--manager { align-self: flex-end; background: var(--pbh-primary); color: #fff; border-radius: 16px 4px 16px 16px; }
.m-cmsg--manager b, .m-cmsg--manager time { color: rgba(255,255,255,.65); }
.m-cmsg--bot { opacity: .85; }
.m-chat-reply { position: sticky; bottom: 76px; z-index: 20; display: flex; gap: 8px; align-items: flex-end; padding: 10px; background: rgba(255,255,255,.97); border-radius: var(--r); box-shadow: 0 -2px 16px rgba(15,35,65,.1); }
.m-chat-reply textarea { flex: 1; min-height: 46px; max-height: 140px; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; font: inherit; font-size: 16px; resize: none; }
@media (min-width: 900px) { .m-chat-reply { bottom: 12px; } }
.m-item, .m-item-main { min-width: 0; max-width: 100%; }
.m-item-main { overflow: hidden; }
.m-gallery-move { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; justify-content: space-between; }
.m-gallery-move span { width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; cursor: pointer; }
.m-gallery-move span:empty { visibility: hidden; }

/* Language switch */
.m-lang { display: inline-flex; padding: 3px; border-radius: 999px; background: #eef0f4; gap: 2px; flex: none; }
.m-lang button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .82rem; color: var(--muted); cursor: pointer; line-height: 1; }
.m-lang button.is-active { background: var(--pbh-primary); color: #fff; }
.m-lang--bar { background: rgba(255,255,255,.14); }
.m-lang--bar button { color: rgba(255,255,255,.8); padding: 6px 10px; }
.m-lang--bar button.is-active { background: #fff; color: var(--pbh-primary); }
.m-side-lang { padding: 6px 12px 10px; }
.m-side-lang .m-lang { background: rgba(255,255,255,.1); }
.m-side-lang .m-lang button { color: rgba(255,255,255,.75); }
.m-side-lang .m-lang button.is-active { background: #fff; color: var(--pbh-primary); }
.pbh-lang--login { position: absolute; top: 14px; right: 14px; }
.pbh-lang { display: inline-flex; padding: 3px; border-radius: 999px; background: #fff; box-shadow: var(--sh); gap: 2px; }
.pbh-lang a { padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .82rem; color: var(--muted); text-decoration: none; }
.pbh-lang a.is-active { background: var(--pbh-primary); color: #fff; }
@media (min-width: 900px) {
	.m-lang--bar { background: #eef0f4; }
	.m-lang--bar button { color: var(--muted); }
	.m-lang--bar button.is-active { background: var(--pbh-primary); color: #fff; }
}

/* ---------- Investment Survey ---------- */
.m-sv-nav { margin-bottom: 12px; }
.m-sv-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.m-sv-filters select { min-height: 40px; width: 100%; min-width: 0; }
.m-bars--wide .m-bar-row { grid-template-columns: minmax(90px, 40%) 1fr auto; }
.m-inline { display: inline !important; font-weight: 500; margin-left: 4px; }
.m-avatar--mute { background: #eef0f4 !important; color: var(--muted) !important; }
.m-tag--ok { background: var(--okbg, #e6f6ec); color: var(--ok, #13703f); }
.m-tag--wa { background: #e7f8ee; color: #128c4a; }
.m-code { display: inline-block; font: 600 .78rem/1.4 ui-monospace, Menlo, Consolas, monospace; background: #f1f3f7; color: #3c4557; padding: 2px 7px; border-radius: 6px; word-break: break-all; }
.m-btn-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.m-btn--block { width: 100%; justify-content: center; }
.m-form-foot { margin: 6px 0 20px; }
.m-sv-head { display: flex; align-items: center; gap: 12px; }
.m-sv-head strong { display: block; font-size: 1.05rem; }
.m-sv-head small { color: var(--muted); }
.m-answers { display: grid; gap: 10px; }
.m-answers > div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.m-answers > div:last-child { border-bottom: 0; padding-bottom: 0; }
.m-answers small { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 2px; }
.m-answers p { margin: 0; font-weight: 600; }
.m-sv-links { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.m-sv-links small { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 3px; }
.m-sv-links .m-btn { margin-left: 4px; vertical-align: middle; }
.m-sv-qhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 2px 8px; flex-wrap: wrap; }
.m-sv-qhead h3 { font-size: 1rem; margin: 0; }
.m-sv-qs { display: grid; gap: 8px; }
.m-sv-q { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: 10px 10px 10px 6px; border: 2px solid transparent; }
.m-sv-q.is-cond { margin-left: 18px; border-left: 3px solid var(--pbh-accent); }
.m-sv-q.is-off { opacity: .55; }
.m-sv-q.has-problem { border-color: var(--bad); }
.m-sv-q.is-drag { opacity: .4; }
.m-sv-q.is-over { border-color: var(--pbh-accent); border-style: dashed; }
.m-sv-drag { cursor: grab; color: #b8bfcd; font-size: 1.1rem; padding: 0 2px; user-select: none; }
.m-sv-qmain { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.m-sv-qmain strong { display: block; font-weight: 700; line-height: 1.3; }
.m-sv-qmain small { display: block; color: var(--muted); font-size: .8rem; }
.m-sv-num { flex: none; min-width: 34px; height: 26px; border-radius: 8px; background: var(--pbh-primary); color: #fff; font-weight: 700; font-size: .78rem; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.m-sv-cond { margin-top: 6px; font-size: .8rem; color: #8a6d1f; font-weight: 600; }
.m-sv-prob { margin-top: 6px; font-size: .8rem; color: var(--bad); font-weight: 600; }
.m-sv-add { width: 100%; justify-content: center; margin-top: 10px; border-style: dashed; }
.m-sv-more { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 90px; }
.m-sv-savebar { position: fixed; left: 50%; transform: translate(-50%, 140%); bottom: 78px; z-index: 40; display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--pbh-primary); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: transform .25s; font-weight: 600; white-space: nowrap; }
.m-sv-savebar.is-dirty { transform: translate(-50%, 0); visibility: visible; }
.m-sv-savebar:not(.is-dirty) { visibility: hidden; }
.m-sv-savebar .m-btn { background: var(--pbh-accent); }
@media (min-width: 900px) { .m-sv-savebar { bottom: 24px; left: calc(50% + 120px); } }
.m-sv-info .m-alert { margin-top: 6px; }
.m-sv-opts, .m-sv-conds { margin-top: 8px; }
.m-sv-opt { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fafbfc; }
.m-sv-opt-txt { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.m-sv-opt input[data-l], .m-sv-opt input[data-lz], .m-sv-rule select, .m-sv-rule input, .m-sv-opt select { min-height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font-size: 15px; background: #fff; min-width: 0; width: 100%; }
.m-sv-opt-flags { grid-column: 1 / 2; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .82rem; color: var(--muted); }
.m-sv-opt-flags select { width: auto; min-height: 34px; font-size: .82rem; }
.m-sv-opt-flags label { display: inline-flex; align-items: center; gap: 5px; }
.m-sv-opt-btns { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 4px; }
.m-sv-opt-btns button { width: 32px; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font-size: .7rem; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.m-sv-opt-btns .m-ico { width: 14px; }
.m-sv-rule { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.m-sv-prev { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 12px; }
.m-sv-prev li strong { display: block; }
.m-sv-prev-opts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.m-sv-prev-opts span { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; }
@media (max-width: 600px) {
	.m-sv-opt-txt { grid-template-columns: 1fr; }
	.m-sv-rule { grid-template-columns: 1fr 1fr auto; }
	.m-sv-rule select[data-rq] { grid-column: 1 / -1; }
	.m-sv-q.is-cond { margin-left: 10px; }
	.m-sv-drag { display: none; }
	.m-sv-savebar { left: 12px; right: 12px; transform: translateY(160%); justify-content: space-between; }
	.m-sv-savebar.is-dirty { transform: translateY(0); }
}

/* ---------- Investment Survey: layout (mobile first, then desktop) ---------- */
.m-sv-wide { display: none; }
.m-sv-filters label.m-sv-date { display: flex; align-items: center; gap: 6px; min-width: 0; }
.m-sv-filters label.m-sv-date span { font-size: .78rem; color: var(--muted); font-weight: 600; flex: none; }
.m-sv-filters label.m-sv-date input { flex: 1; min-width: 0; min-height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 8px; font: inherit; font-size: .88rem; background: #fff; }
.m-sv-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 2px 8px; min-height: 30px; }
.m-sv-table-wrap { display: none; }
.m-sv-hero strong { font-size: 2rem; }
.m-sv-cols { display: block; }
.m-sv-cols--build .m-sv-more { margin: 4px 0 16px; }
.m-sv-cols--build > .m-sv-col:last-child { padding-bottom: 90px; }
@media (min-width: 900px) {
	.m-content:has(.m-sv-wide) { max-width: 1240px; }
	/* Dashboard: total as a tall hero card, 6 KPIs beside it, charts in 3 columns */
	.m-sv-kpis { grid-template-columns: 1.2fr repeat(3, 1fr); }
	.m-sv-kpis .m-sv-hero { grid-column: 1; grid-row: span 2; justify-content: center; }
	.m-sv-kpis .m-sv-hero strong { font-size: 2.8rem; }
	.m-sv-charts { grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
	/* Responses: filters in a tidy grid, table instead of cards */
	.m-sv-filters { grid-template-columns: repeat(4, 1fr); gap: 10px; }
	.m-sv-mlist { display: none; }
	.m-sv-table-wrap { display: block; background: #fff; border-radius: var(--r); box-shadow: var(--sh); overflow-x: auto; }
	.m-sv-table { font-size: .84rem; }
	.m-sv-table th { padding: 12px; background: #f8f9fb; border-bottom: 1px solid var(--line); white-space: normal; line-height: 1.3; }
	.m-sv-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
	.m-sv-table tbody tr { cursor: pointer; transition: background .15s; }
	.m-sv-table tbody tr:hover { background: #f8f9fb; }
	.m-sv-table tbody tr:last-child td { border-bottom: 0; }
	.m-sv-table td a { color: var(--info); font-weight: 600; white-space: nowrap; }
	.m-sv-table td:first-child { white-space: nowrap; }
	.m-sv-cols .m-dl { grid-template-columns: 170px 1fr; }
	.m-sv-table td small { display: block; margin-top: 4px; white-space: nowrap; }
	/* Response detail + builder: two columns */
	.m-sv-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
	.m-sv-side { position: sticky; top: 76px; }
	.m-sv-cols--build { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
	.m-sv-cols--build .m-sv-qhead { margin-top: 0; }
	.m-sv-cols--build > .m-sv-col:last-child { padding-bottom: 40px; }
	.m-sv-side--left .m-sv-more { flex-direction: column; align-items: stretch; }
	.m-sv-side--left .m-sv-more .m-btn { justify-content: flex-start; }
	.m-sv-side--left .m-code { font-size: .72rem; }
	.m-sv-savebar { left: auto; right: 32px; transform: translateY(140%); }
	.m-sv-savebar.is-dirty { transform: translateY(0); }
	/* Settings: English and 中文 side by side */
	.m-sv-settings .m-form { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; align-items: start; }
	.m-sv-settings .m-form > .m-field--bool.m-pair { align-self: end; padding-bottom: 12px; }
	.m-sv-settings .m-form > * { grid-column: 1 / -1; }
	.m-sv-settings .m-form > .m-pair { grid-column: auto; }
	.m-sv-qform .m-form > .m-field--half { grid-column: auto; }
	.m-content:has(.m-sv-settings) .m-form-foot { max-width: 320px; margin-left: auto; }
}

.m-alert--survey { background: #f3effc; color: #5b3fa8; }
.m-sv-autolog { display: flex; align-items: center; gap: 6px; margin: -4px 2px 12px; }
.m-sv-autolog .m-ico { width: 15px; color: var(--ok, #13703f); flex: none; }
.m-sv-rep { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.m-sv-rep input[data-n], .m-sv-rep input[data-p], .m-sv-rep input[data-e] { min-height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font-size: 15px; background: #fff; min-width: 0; width: 100%; }
.m-sv-rep .m-switch span { font-size: .82rem; }
.m-sv-reps h3 { margin-bottom: 4px; }
.m-tag .m-ico { width: 12px; vertical-align: -2px; margin-right: 3px; }
@media (max-width: 700px) {
	.m-sv-rep { grid-template-columns: 1fr auto auto; grid-template-areas: "n a d" "p p p" "e e e"; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
	.m-sv-rep input[data-n] { grid-area: n; }
	.m-sv-rep input[data-p] { grid-area: p; }
	.m-sv-rep input[data-e] { grid-area: e; }
	.m-sv-rep .m-switch { grid-area: a; }
	.m-sv-rep [data-rdel] { grid-area: d; }
}

.m-sv-dates { display: flex; align-items: center; gap: 6px; min-width: 0; grid-column: 1 / -1; }
.m-sv-dates span { color: var(--muted); flex: none; }
.m-sv-dates input { flex: 1; min-width: 0; min-height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 8px; font: inherit; font-size: .85rem; background: #fff; }
@media (min-width: 900px) {
	.m-sv-dates { grid-column: auto; }
	.m-sv-dates--wide { grid-column: span 2; }
}
/* EPF calculator table editor */
.m-epf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 12px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.m-epf-row { display: grid; grid-template-columns: 64px 1fr 32px; gap: 6px; align-items: center; }
.m-epf-row input { min-height: 38px; border: 1.5px solid var(--line); border-radius: 9px; padding: 0 8px; font-size: 15px; min-width: 0; width: 100%; background: #fff; }
.m-epf-row input[data-a] { font-weight: 700; text-align: center; background: #f6f7f9; }
.m-epf-row .m-iconbtn { width: 32px; height: 32px; }
.m-card > .m-sv-links:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
