.mkb {
	--ink: #1b1714; --muted: #6b625b; --paper: #f6f2ec; --card: #fff; --line: #e6dfd6;
	--accent: #c8102e; --accent-soft: #fbe7ea; --ok: #1f7a4d; --warn: #965800; --bad: #b3261e; --dark: #14110f; --tap: 52px;
	color: var(--ink);
}
body.mkb { margin: 0; background: var(--paper); font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif; -webkit-text-size-adjust: 100%; }
.mkb *, .mkb *::before { box-sizing: border-box; }
.mkb button, .mkb input, .mkb select, .mkb textarea { font: inherit; color: inherit; }
.mkb button { cursor: pointer; touch-action: manipulation; }
.mkb button:disabled { opacity: .45; cursor: default; }
.mkb h1, .mkb h2, .mkb h3 { margin: 0; line-height: 1.2; }
.mkb .muted { color: var(--muted); }
.mkb .small { font-size: 14px; }
.mkb .th { display: block; font-size: max(.78em, 12px); font-weight: 400; }
.mkb .top { background: var(--dark); color: #fff; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.mkb .top span { font-size: 14px; opacity: .7; }
body.mkb-book { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.mkb-book .page { flex: 1; width: 100%; }
.mkb .foot { padding: 12px 16px calc(24px + env(safe-area-inset-bottom, 0px)); text-align: center; }
.mkb .foot img { display: inline-block; max-width: 180px; max-height: 96px; width: auto; height: auto; }
.mkb .page { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; display: grid; gap: 14px; }
.mkb .card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; min-width: 0; }
.mkb .primary, .mkb .ghost, .mkb .choice { min-height: var(--tap); padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600; }
.mkb .primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.mkb a.primary { display: inline-block; line-height: 34px; text-decoration: none; }
.mkb .ghost.danger { color: var(--bad); }
.mkb .choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.mkb .choice { text-align: center; }
.mkb .choice small { display: block; font-weight: 400; color: var(--muted); }
.mkb .choice[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.mkb .choice[aria-pressed="true"] small { color: inherit; }
.mkb .cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mkb .cal-nav .ghost { min-height: 44px; min-width: 52px; font-size: 22px; line-height: 1; }
.mkb .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.mkb .cal small { color: var(--muted); font-size: 13px; padding: 2px 0; }
.mkb .day { min-height: 44px; padding: 0 1px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; font-size: 15px; line-height: 1.1; }
.mkb .day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.mkb .day:disabled { background: transparent; border-color: transparent; color: var(--muted); }
.mkb .dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.mkb .dates .choice { flex: 0 0 74px; padding: 6px 4px; }
.mkb label.field { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
.mkb .field input, .mkb .field select, .mkb .field textarea { width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 400; font-size: 17px; }
.mkb .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.mkb .check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.mkb .check input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; }
.mkb .error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fde7e5; color: var(--bad); font-weight: 600; }
.mkb .notice-box { padding: 10px 12px; border-radius: 10px; background: #fff4e0; color: var(--warn); font-size: 15px; }
.mkb .hp { position: absolute; left: -9999px; }
.mkb .done .big { font-size: 20px; font-weight: 700; margin: 0; }
.mkb .done p { margin: 0; }

.mkb .ref { display: grid; gap: 2px; text-align: center; padding: 14px 10px; border: 2px dashed var(--accent); border-radius: 14px; background: var(--accent-soft); }
.mkb .ref span, .mkb .ref small { font-size: 14px; color: var(--muted); }
.mkb .ref strong { font-size: 30px; letter-spacing: .08em; color: var(--accent); font-variant-numeric: tabular-nums; }
.mkb .facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 16px; }
.mkb .facts dt { color: var(--muted); }
.mkb .facts dd { margin: 0; font-weight: 600; min-width: 0; }
.mkb .verify { display: flex; gap: 6px; align-items: center; }
.mkb .verify input { min-height: var(--tap); border-radius: 12px; border: 0; padding: 0 10px; width: 150px; text-transform: uppercase; color: var(--ink); background: #fff; }
.mkb .verdict { font-size: 22px; font-weight: 800; padding: 10px 12px; border-radius: 12px; }
.mkb .verdict.ok { background: #e8f4ee; color: var(--ok); }
.mkb .verdict.bad { background: #fde7e5; color: var(--bad); }
.mkb .verdict.warn { background: #fff4e0; color: var(--warn); }
/* Reception */
#mkb-live { position: fixed; left: 0; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 99990; display: grid; justify-items: start; gap: 4px; padding: 0 12px; pointer-events: none; max-width: calc(100% - 150px); } /* Bottom left: never over the page's buttons; the sound button is bottom right. */
#mkb-live:empty { display: none; }
#mkb-live:has(.live-sound) { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); max-width: 100%; } /* Above the sound button while that is shown. */
#mkb-live button { pointer-events: auto; min-height: 36px; max-width: 100%; padding: 6px 12px; border: 0; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; text-align: left; color: #fff; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mkb-live .live-alert { background: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.3); } /* Small: tap it to open that day; it then disappears. */
#mkb-live .live-sound { min-height: 44px; background: var(--warn); width: auto; position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 4px 16px rgba(0,0,0,.3); } /* Bottom corner: never covers the page's own buttons. */
#mkb-live small { opacity: .85; }
#mkb-desk { max-width: 1100px; margin: 0 auto; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; } /* minmax: nothing can make the page wider than the phone. */
.mkb.in-admin { margin: 12px 0; padding: 0; max-width: none; }
.mkb .bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--dark); color: #fff; border-radius: 14px; padding: 10px 12px; }
.mkb .bar .ghost { color: var(--ink); }
.mkb .bar .sheet-link { display: inline-flex; flex-direction: column; justify-content: center; text-decoration: none; text-align: center; }
.mkb .bar input[type=date] { min-height: var(--tap); border-radius: 12px; border: 0; padding: 0 10px; color: var(--ink); background: #fff; min-width: 0; max-width: 100%; font-size: 16px; } /* Safari: date fields have a wide built-in size. */
.mkb .bar .grow { flex: 1; min-width: 120px; font-size: 14px; opacity: .85; }
.mkb .bar h1 { color: #fff; font-size: 18px; flex-basis: 100%; }
.mkb .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; align-items: start; }
.mkb .slot { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.mkb .slot:first-of-type { border-top: 0; padding-top: 0; }
.mkb .slot-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mkb .slot-head strong { font-size: 20px; }
.mkb .pill { padding: 2px 10px; border-radius: 99px; font-size: 14px; font-weight: 600; background: #e8f4ee; color: var(--ok); }
.mkb .pill.none { background: #eee9e2; color: var(--muted); }
.mkb .pill.over { background: #fde7e5; color: var(--bad); }
.mkb .pill.wait { background: #fff4e0; color: var(--warn); }
.mkb .tune { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; font-size: 14px; }
.mkb .tune button { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 700; }
.mkb .tune input { width: 76px; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; font-size: 16px; } /* 16px: iPhone doesn't zoom in on tap. */
.mkb .bk { width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; min-height: 52px; }
.mkb .bk b { flex: 1 1 140px; }
.mkb .add { justify-self: start; min-height: 44px; font-size: 15px; }
.mkb dialog { border: 0; border-radius: 16px; padding: 16px; width: min(520px, calc(100vw - 24px)); max-height: 90vh; overflow: auto; }
.mkb dialog::backdrop { background: rgba(0,0,0,.5); }
.mkb dialog form { display: grid; gap: 10px; }
.mkb .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mkb .actions .primary { flex: 1; }
.mkb .log { white-space: pre-wrap; font-size: 13px; color: var(--muted); margin: 0; }
/* Week schedule: 7 columns on a tablet or computer, one day under another on a phone. */
#mkb-desk.is-week { max-width: 1500px; }
.mkb .wlegend { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: flex-start; }
.mkb .wlegend > span { display: inline-flex; gap: 6px; align-items: flex-start; }
.mkb .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
.mkb .wday { background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-width: 0; cursor: pointer; overflow: hidden; }
.mkb .wday:hover { border-color: var(--muted); }
.mkb .wday.today { border: 2px solid var(--accent); }
.mkb .wday.closed { background: #f1ece5; }
.mkb .whead { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 8px; text-align: left; display: grid; gap: 2px; min-height: var(--tap); }
.mkb .wday.today .whead { background: var(--accent-soft); }
.mkb .whead b { font-size: 16px; }
.mkb .whead span { font-size: 12px; color: var(--muted); }
.mkb .whead .pill { justify-self: start; font-size: 12px; padding: 0 8px; }
.mkb .wbody { padding: 6px 8px 8px; display: grid; gap: 3px; }
.mkb .wrow { display: flex; align-items: center; gap: 5px; font-size: 14px; font-variant-numeric: tabular-nums; }
.mkb .wrow.empty { color: var(--muted); }
.mkb .wrow.full .wc { color: var(--warn); font-weight: 700; }
.mkb .wrow.over .wc { color: var(--bad); font-weight: 700; }
.mkb .wt { font-weight: 600; }
.mkb .wc { margin-left: auto; }
.mkb .wm { font-size: 12px; color: var(--muted); }
.mkb .wk { display: inline-block; min-width: 18px; text-align: center; font-size: 12px; font-weight: 700; border-radius: 5px; padding: 0 3px; line-height: 17px; }
.mkb .wk.p { background: #e3eefb; color: #1d4f91; }
.mkb .wk.g { background: #e8f4ee; color: var(--ok); }
.mkb .wn { display: block; font-size: 13px; line-height: 1.3; padding: 6px 6px; min-height: 28px; margin-left: 6px; border-left: 3px solid var(--line); border-radius: 0 6px 6px 0; background: var(--paper); overflow-wrap: anywhere; }
.mkb .wn:hover { border-left-color: var(--accent); }
.mkb .wn.wait { border-left-color: var(--warn); }
@media (max-width: 900px) { /* Phone or tablet held upright: one day under another. */
	.mkb .week { grid-template-columns: 1fr; }
	.mkb .whead { grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
	.mkb .whead span { font-size: 13px; }
	.mkb .wn { font-size: 13px; }
}

@media (max-width: 560px) { /* Reception on a phone: a compact bar. */
	.mkb .bar { gap: 6px; padding: 8px; }
	.mkb .bar .ghost, .mkb .bar input[type=date], .mkb .verify input { min-height: 44px; }
	.mkb .bar .ghost { padding: 2px 10px; font-size: 15px; }
	/* Rows: ‹ Daily sheet … Refresh / date title / ‹ Back · Today · Next › / date picker / number check / live note. */
	.mkb .bar .sheet-link { order: 1; }
	.mkb .bar .logout-link { order: 1; }
	.mkb .bar #now { order: 2; margin-left: auto; }
	.mkb .bar h1 { order: 3; }
	.mkb .bar [data-go], .mkb .bar [data-view] { order: 4; flex: 1 1 0; min-width: 0; padding: 2px 4px; white-space: nowrap; }
	.mkb .bar [data-go] .th, .mkb .bar [data-view] .th { overflow: hidden; text-overflow: ellipsis; }
	.mkb .bar input[type=date] { order: 5; flex: 1 1 100%; min-width: 0; }
	.mkb .verify { order: 6; flex: 1 1 100%; min-width: 0; }
	.mkb .bar .grow { order: 7; flex-basis: 100%; }
	.mkb .verify input { flex: 1; width: auto; min-width: 0; }
	.mkb .bar h1 { font-size: 16px; }
	.mkb .bar .grow { font-size: 12px; }
}

/* Keyboard focus: always visible (WCAG 2.4.7). */
.mkb :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mkb input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 2px #fde7e5; }
.mkb-book .help { display: inline-flex; align-items: center; min-height: 44px; }
.mkb .field-err { display: block; margin-top: -6px; color: var(--bad); font-size: 14px; font-weight: 600; }
@media (max-width: 360px) { /* Small phones (iPhone SE 1st gen, older Android): the four day buttons still fit. */
	.mkb .bar [data-go], .mkb .bar [data-view] { flex: 1 1 40%; } /* Two buttons per row. */
}
.mkb fieldset.dep { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; margin: 0; display: grid; gap: 8px; background: #fff8ec; }
.mkb fieldset.dep legend { font-weight: 700; padding: 0 6px; }
.mkb fieldset.dep select { min-height: 44px; font-size: 16px; }
/* "Book my place" / "Continue to payment": green and raised so it clearly reads as the button to press (owner, 2026-11-08). White on #18794A = 5.3:1. */
body.mkb-book #f-send {
	min-height: 56px; font-size: 18px; font-weight: 700; letter-spacing: .01em; color: #fff;
	background: linear-gradient(180deg, #23955f 0%, #18794a 100%); border: 1px solid #11603a; border-radius: 14px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 4px 0 #0e4f30, 0 8px 18px rgba(24, 121, 74, .35);
	transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
	-webkit-tap-highlight-color: transparent;
}
body.mkb-book #f-send:hover { filter: brightness(1.06); }
body.mkb-book #f-send:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 0 #0e4f30, 0 3px 8px rgba(24, 121, 74, .3); }
body.mkb-book #f-send:disabled { filter: grayscale(.4); opacity: .7; transform: none; }
body.mkb-book #f-send:focus-visible { outline: 3px solid #0e4f30; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { body.mkb-book #f-send { transition: none; } }
/* Safari (iPhone) ignores the height of a normal <select>: draw it ourselves so it is as tall and easy to tap as the other fields. */
.mkb .field select, .mkb fieldset.dep select {
	-webkit-appearance: none; appearance: none; padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b625b' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 14px center; background-color: #fff;
}
