/* TLV Rezervacije v2 – themes are CSS variables on [data-theme]. Default = clay. */

.tlv2-wrap {
	--bg: #eef3f0;
	--surface: #ffffff;
	--ink: #14231f;
	--muted: #5f746c;
	--line: #dbe5df;
	--hour-line: #bfd0c7;
	--accent: #1f7a57;
	--accent-ink: #ffffff;
	--accent-soft: #dcebe3;
	--free: #ffffff;
	--free-hover: #dff1e7;
	--busy: #c3d6cb;
	--busy-ink: #1a332e;
	--mine: #1f7a57;
	--mine-ink: #ffffff;
	--block: #44504b;
	--block-ink: #ffffff;
	--past: #e6ede9;
	--danger: #b3261e;
	--head-bg: #1a332e;
	--head-ink: #ffffff;
	--head-soft: rgba(255, 255, 255, .72);
	--row: 40px;
	--timew: 52px;
	--radius: 14px;
}
.tlv2-wrap[data-theme="clay"] {
	--bg: #fbf6ef; --surface: #ffffff; --ink: #2a2119; --muted: #7a6b5d; --line: #eadfd0; --hour-line: #d8cab8;
	--accent: #b4532a; --accent-ink: #ffffff; --accent-soft: #f4e2d6;
	--free: #ffffff; --free-hover: #f6e6da; --busy: #e9d2c1; --busy-ink: #5a2d16;
	--mine: #1f5b43; --mine-ink: #ffffff; --block: #4a4038; --block-ink: #ffffff; --past: #f1ebe3;
	--head-bg: #7a3519;
}
.tlv2-wrap[data-theme="night"] {
	--bg: #131a17; --surface: #1b2420; --ink: #eaf2ec; --muted: #93a59a; --line: #2b3832; --hour-line: #3d4c44;
	--accent: #d8f34b; --accent-ink: #1a2300; --accent-soft: #2a3320;
	--free: #1b2420; --free-hover: #26342d; --busy: #34463c; --busy-ink: #e2ede6;
	--mine: #d8f34b; --mine-ink: #1a2300; --block: #5a5f55; --block-ink: #ffffff; --past: #161d1a;
	--danger: #ff8a80; --head-bg: #0b100e; --head-ink: #eaf2ec;
}

/* ---------- more themes: the earth brown is always the primary colour; only the character changes ---------- */

/* Christmas: cranberry, pine and gold on warm cream, candy-stripe edge, falling snow (see app.js) */
.tlv2-wrap[data-theme="christmas"] {
	--bg: #f7eee4; --surface: #fffdfa; --ink: #2b1a14; --muted: #7d6657; --line: #ead9c8; --hour-line: #d6bfa6;
	--accent: #a4462b; --accent-ink: #ffffff; --accent-soft: #f6e0d4;
	--free: #fffdfa; --free-hover: #fbefd2; --busy: #f0d0cb; --busy-ink: #6a1d1d;
	--mine: #1e6b3d; --mine-ink: #ffffff; --block: #8c1c2b; --block-ink: #ffffff; --past: #f1e7dc;
	--head-bg: #5f2511;
}
.tlv2-wrap[data-theme="christmas"] .tlv2-top {
	background-image: radial-gradient(120% 140% at 15% 0%, #85391b 0%, #5f2511 60%, #4a1c0d 100%);
	border-bottom: 8px solid transparent;
	border-image: repeating-linear-gradient(135deg, #c0392b 0 14px, #fffaf2 14px 28px, #1e6b3d 28px 42px) 1;
}
.tlv2-wrap[data-theme="christmas"] .tlv2-title h2::before,
.tlv2-wrap[data-theme="christmas"] .tlv2-title h2::after { content: "\2726"; color: #f2c94c; font-size: .7em; margin: 0 .45em; vertical-align: .12em; }
.tlv2-wrap[data-theme="christmas"] .tlv2-seg { background: #f6e0d4; }
body.tlv2-clean:has(.tlv2-wrap[data-theme="christmas"]) { background: #efe0d0; }
.tlv2-snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }

/* Easter: pastel eggs and spring greens */
.tlv2-wrap[data-theme="easter"] {
	--bg: #fbf7ec; --surface: #fffefa; --ink: #33271f; --muted: #7d6e62; --line: #eee3d2; --hour-line: #dccdb6;
	--accent: #a8532b; --accent-ink: #ffffff; --accent-soft: #f7e6d9;
	--free: #fffefa; --free-hover: #fff1c0; --busy: #e4d8f0; --busy-ink: #3f2d57;
	--mine: #4a9460; --mine-ink: #ffffff; --block: #6a4a3a; --block-ink: #ffffff; --past: #f3eee3;
	--head-bg: #7a3519;
}
.tlv2-wrap[data-theme="easter"] .tlv2-top {
	background-image:
		radial-gradient(ellipse 10px 13px at 3% 84%, rgba(255, 222, 120, .55) 0 98%, transparent 100%),
		radial-gradient(ellipse 9px 12px at 9% 93%, rgba(196, 170, 240, .55) 0 98%, transparent 100%),
		radial-gradient(ellipse 10px 13px at 15% 82%, rgba(160, 222, 178, .5) 0 98%, transparent 100%),
		radial-gradient(ellipse 9px 12px at 85% 84%, rgba(255, 176, 196, .52) 0 98%, transparent 100%),
		radial-gradient(ellipse 10px 13px at 91% 93%, rgba(255, 222, 120, .5) 0 98%, transparent 100%),
		radial-gradient(ellipse 9px 12px at 97% 82%, rgba(196, 170, 240, .52) 0 98%, transparent 100%),
		linear-gradient(135deg, #86401f, #7a3519 55%, #6c2e14);
	border-bottom: 6px solid transparent;
	border-image: linear-gradient(90deg, #f7c6d0, #ffe28a, #b9e3c0, #cdbdf0, #f7c6d0) 1;
}
.tlv2-wrap[data-theme="easter"] .tlv2-seg { background: #f5e6d8; }
body.tlv2-clean:has(.tlv2-wrap[data-theme="easter"]) { background: #f3ecdc; }

/* Autumn: honey, olive and leaf orange */
.tlv2-wrap[data-theme="autumn"] {
	--bg: #faf1e2; --surface: #fffcf6; --ink: #2e2013; --muted: #7e6a52; --line: #ecdcc3; --hour-line: #d9c3a0;
	--accent: #b0541f; --accent-ink: #ffffff; --accent-soft: #f6dfc2;
	--free: #fffcf6; --free-hover: #fbe5c2; --busy: #f0d2a3; --busy-ink: #5a3410;
	--mine: #566b2b; --mine-ink: #ffffff; --block: #4e3320; --block-ink: #ffffff; --past: #f3e9d8;
	--head-bg: #6e3412;
}
.tlv2-wrap[data-theme="autumn"] .tlv2-top { background-image: linear-gradient(120deg, #5f2b0e 0%, #7a3a14 50%, #9a5a1e 100%); }
body.tlv2-clean:has(.tlv2-wrap[data-theme="autumn"]) { background: #f1e3cc; }

/* Coast: warm sand, brown and sea teal */
.tlv2-wrap[data-theme="coast"] {
	--bg: #f6f2ea; --surface: #fffefc; --ink: #23211e; --muted: #706b63; --line: #e5ddd0; --hour-line: #cfc4b2;
	--accent: #a8532a; --accent-ink: #ffffff; --accent-soft: #f3e1d4;
	--free: #fffefc; --free-hover: #dff0ee; --busy: #cfe2e0; --busy-ink: #17464b;
	--mine: #1c6e78; --mine-ink: #ffffff; --block: #3f3a35; --block-ink: #ffffff; --past: #eeeae2;
	--head-bg: #7a3519;
}
.tlv2-wrap[data-theme="coast"] .tlv2-top { background-image: linear-gradient(120deg, #6e2f15 0%, #7a3519 60%, #8a4426 100%); border-bottom: 5px solid #2f8f98; }
body.tlv2-clean:has(.tlv2-wrap[data-theme="coast"]) { background: #ece5d8; }

/* Winter: frosty slate with a deep brown header */
.tlv2-wrap[data-theme="winter"] {
	--bg: #eef2f5; --surface: #ffffff; --ink: #1f2a33; --muted: #62707c; --line: #dbe3ea; --hour-line: #bfccd7;
	--accent: #8f4423; --accent-ink: #ffffff; --accent-soft: #efe0d6;
	--free: #ffffff; --free-hover: #e2edf6; --busy: #d3dde6; --busy-ink: #243746;
	--mine: #2d5f86; --mine-ink: #ffffff; --block: #3b4651; --block-ink: #ffffff; --past: #e6ebef;
	--head-bg: #5b2a15;
}
.tlv2-wrap[data-theme="winter"] .tlv2-top { background-image: linear-gradient(135deg, #4c2110 0%, #5b2a15 55%, #6d3a22 100%); border-bottom: 5px solid #c9d8e6; }
body.tlv2-clean:has(.tlv2-wrap[data-theme="winter"]) { background: #e3e9ee; }

/* Dusk: dark chocolate with copper */
.tlv2-wrap[data-theme="dusk"] {
	--bg: #1b130f; --surface: #261b15; --ink: #f3e8dc; --muted: #b39f8c; --line: #3a2a21; --hour-line: #4f3a2d;
	--accent: #e08a54; --accent-ink: #2a1206; --accent-soft: #3b261b;
	--free: #261b15; --free-hover: #33241b; --busy: #4a3426; --busy-ink: #f0dccb;
	--mine: #e6b35a; --mine-ink: #2a1a06; --block: #8c4a2f; --block-ink: #ffffff; --past: #1f1611;
	--danger: #ff9a85; --head-bg: #3a1b0c; --head-ink: #f3e8dc;
}
.tlv2-wrap[data-theme="dusk"] .tlv2-top { background-image: linear-gradient(135deg, #2c1307 0%, #3a1b0c 55%, #4b2511 100%); }
.tlv2-wrap[data-theme="dusk"] .tlv2-link { color: #f2a374; }
.tlv2-wrap[data-theme="dusk"] .tlv2-colhead.is-today strong { color: #f2a374; }
body.tlv2-clean:has(.tlv2-wrap[data-theme="dusk"]) { background: #120b08; }

.tlv2-wrap, .tlv2-wrap * { box-sizing: border-box; }
.tlv2-wrap {
	background: var(--bg);
	color: var(--ink);
	border-radius: 20px;
	overflow: clip;
	max-width: min(1200px, 100%) !important;
	margin-inline: auto !important;
	font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	position: relative;
	font-variant-numeric: tabular-nums;
}
.tlv2-wrap h2, .tlv2-wrap h3 { color: inherit; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.tlv2-wrap button { font: inherit; color: inherit; cursor: pointer; }
.tlv2-wrap button:disabled { cursor: default; }
.tlv2-wrap :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tlv2-top :focus-visible { outline-color: #ffffff; }

/* header band */
.tlv2-top { background: var(--head-bg); color: var(--head-ink); padding: 18px 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.tlv2-topline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 12px; }
.tlv2-title { text-align: center; }
.tlv2-addr { font-size: 0.82rem; color: var(--head-soft); line-height: 1.4; }
.tlv2-addr-d { text-align: left; padding-top: 2px; }
.tlv2-addr-d .tlv2-addr-l { display: block; }
.tlv2-addr-m { display: none; }
.tlv2-addr .tlv2-link { font-weight: 600; }
.tlv2-title h2 { font-size: 1.5rem; line-height: 1.2; color: var(--head-ink); }
.tlv2-title p { margin: 4px 0 0; color: var(--head-soft); font-size: 0.85rem; }
.tlv2-account { justify-self: end; }
.tlv2-datenav { justify-content: center; }
.tlv2-datebar { display: flex; justify-content: center; }
.tlv2-account { display: flex; align-items: center; gap: 12px; flex-shrink: 0; font-size: 0.9rem; }
.tlv2-who { font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlv2-account.is-in { flex-direction: column; align-items: flex-end; gap: 10px; }
.tlv2-account-row { display: flex; align-items: center; gap: 12px; max-width: 100%; }
.tlv2-mine-btn { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; min-height: 38px; padding: 6px 16px; font-size: 0.88rem; font-weight: 700; }
.tlv2-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.74rem; font-weight: 700; line-height: 1; }
.tlv2-badge[hidden] { display: none; }
.tlv2-link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.tlv2-top .tlv2-link { color: var(--head-ink); opacity: .85; }
.tlv2-wrap[data-theme="night"] .tlv2-link { color: #d8f34b; }
.tlv2-muted { color: var(--muted); font-size: 0.9rem; }
.tlv2-muted a { color: var(--accent); }

.tlv2-datenav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tlv2-datenav > .tlv2-btn { position: relative; z-index: 2; }
.tlv2-pill {
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	background: #ffffff; color: #14231f; border-radius: 999px; padding: 10px 18px; min-height: 44px;
	font-weight: 700; font-size: 0.95rem; cursor: pointer; white-space: nowrap;
	overflow: hidden; -webkit-tap-highlight-color: transparent; isolation: isolate;
}
.tlv2-wrap .tlv2-pill { color: #14231f; border: 0; font-family: inherit; }
.tlv2-pill:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.tlv2-pill span { overflow: hidden; text-overflow: ellipsis; }

/* buttons */
.tlv2-btn {
	border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
	padding: 9px 16px; min-height: 42px; font-weight: 600; font-size: 0.92rem;
	transition: background .12s, border-color .12s, transform .05s;
}
.tlv2-btn:hover:not(:disabled) { border-color: var(--accent); }
.tlv2-btn:active:not(:disabled) { transform: translateY(1px); }
.tlv2-btn:disabled { opacity: .55; }
.tlv2-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) !important; }
.tlv2-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff !important; }
.tlv2-btn-light { background: #ffffff; border-color: #ffffff; color: #14231f !important; }
.tlv2-btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .38); color: var(--head-ink); }
.tlv2-btn-ghost:hover:not(:disabled) { border-color: #ffffff; background: rgba(255, 255, 255, .1); }
.tlv2-icon { width: 44px; padding: 0; font-size: 1.4rem; line-height: 1; }

/* body + toolbar */
.tlv2-body { padding: 14px 16px 18px; }
.tlv2-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.tlv2-toolbar:empty { display: none; }
.tlv2-seg, .tlv2-tabs { display: inline-flex; background: var(--accent-soft); border-radius: 999px; padding: 4px; gap: 2px; }
.tlv2-tabs { display: flex; }
.tlv2-seg button, .tlv2-tabs button {
	border: 0; background: transparent; border-radius: 999px; padding: 8px 16px; min-height: 40px;
	font-weight: 600; font-size: 0.92rem; color: var(--muted);
}
.tlv2-tabs button { flex: 1; }
.tlv2-seg button.is-on, .tlv2-tabs button.is-on { background: var(--accent); color: var(--accent-ink); }

/* stage */
.tlv2-stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; }
.tlv2-stage.is-loading { opacity: .6; }
.tlv2-loading { padding: 40px 16px; text-align: center; color: var(--muted); margin: 0; }
.tlv2-errbox { padding: 28px 16px; text-align: center; }
.tlv2-errbox p { margin: 0 0 12px; color: var(--danger); }
.tlv2-banner { margin: 0; padding: 10px 14px; background: var(--accent-soft); color: var(--ink); font-size: 0.9rem; border-bottom: 1px solid var(--line); }

/* ---------- horizontal day timeline ---------- */
.tlv2-hscroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.tlv2-hgrid {
	--hrow: 76px; --head: 36px; --dayw: 0px;
	position: relative; display: grid;
	grid-template-columns: var(--courtw) repeat(var(--cols), var(--col));
	grid-template-rows: var(--head);
	grid-auto-rows: var(--hrow);
	width: calc(var(--dayw) + var(--courtw) + var(--cols) * var(--col));
}
/* week: a day label column, then the court column, then the hours */
.tlv2-hgrid:not(.is-weekh) { --hrow: 84px; }
.tlv2-hgrid:not(.is-weekh) .tlv2-hres .tlv2-res-name { font-size: 0.95rem; }
.tlv2-hgrid:not(.is-weekh) .tlv2-hres .tlv2-res-time { font-size: 0.82rem; }
.tlv2-hgrid.is-weekh { --hrow: 52px; grid-template-columns: var(--dayw) var(--courtw) repeat(var(--cols), var(--col)); }
.tlv2-h-day {
	position: sticky; left: 0; z-index: 6; background: var(--surface); border: 0; border-top: 1px solid var(--line); border-radius: 0;
	box-shadow: 1px 0 0 var(--line); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
	padding: 0 8px; text-align: left; min-width: 0; overflow: hidden;
}
.tlv2-h-day strong { font-size: 0.95rem; line-height: 1.15; }
.tlv2-h-day span { font-size: 0.74rem; color: var(--muted); line-height: 1.15; }
.tlv2-h-day em { font-style: normal; font-size: 0.62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 1px 7px; border-radius: 999px; margin-top: 2px; }
.tlv2-h-day:hover { background: var(--free-hover); }
.tlv2-h-day.is-today { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent), 1px 0 0 var(--line); }
.tlv2-h-day.is-today strong { color: var(--accent); }
.tlv2-h-day.is-past strong, .tlv2-h-day.is-past span { color: var(--muted); opacity: .8; }
.is-weekh .tlv2-h-court { justify-content: center; padding: 0 6px; font-size: 0.85rem; }
.is-weekh .tlv2-h-court strong { font-size: 0.82rem; }
.tlv2-h-court.is-daystart, .tlv2-h-day.is-daystart, .tlv2-hslot.is-daystart { border-top: 2px solid var(--hour-line); }
.is-weekh .tlv2-hres { margin: 3px 2px; padding: 3px 8px; gap: 0; border-radius: 9px; }
.is-weekh .tlv2-hres .tlv2-res-name { font-size: 0.8rem; line-height: 1.2; }
.is-weekh .tlv2-hres .tlv2-res-time { font-size: 0.68rem; }
.is-weekh .tlv2-hres .tlv2-res-tag { display: none; }
.is-weekh .tlv2-hslot span { font-size: 1rem; }
.tlv2-h-corner, .tlv2-h-court { position: sticky; left: 0; z-index: 6; background: var(--surface); box-shadow: 1px 0 0 var(--line), 8px 0 10px -8px rgba(0, 0, 0, .25); }
.tlv2-h-corner { border-bottom: 1px solid var(--line); top: 0; z-index: 9; }
.tlv2-h-court { display: flex; align-items: center; padding: 0 10px; border-top: 1px solid var(--line); }
.tlv2-h-court strong { font-size: 0.92rem; line-height: 1.2; }
.tlv2-h-hour {
	display: flex; align-items: center; padding-left: 6px; font-size: 0.78rem; font-weight: 700; color: var(--ink);
	border-left: 1px solid var(--hour-line); border-bottom: 1px solid var(--line); background: var(--surface);
	position: sticky; top: 0; z-index: 7;
}
.tlv2-hslot {
	border: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 0; padding: 0;
	background: var(--free); color: var(--muted); display: flex; align-items: center; justify-content: center; min-width: 0;
}
.tlv2-hslot.is-hour { border-left-color: var(--hour-line); }
.tlv2-hslot span { font-size: 1.15rem; font-weight: 600; opacity: .28; }
.tlv2-hslot:hover:not(:disabled) { background: var(--free-hover); color: var(--accent); }
.tlv2-hslot:hover:not(:disabled) span { opacity: 1; }
.tlv2-hslot { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.tlv2-hslot:active:not(:disabled) { background: var(--free-hover); color: var(--accent); }
.tlv2-hslot:active:not(:disabled) span { opacity: 1; }
/* time bubble above the touched slot */
.tlv2-htip {
	position: absolute; z-index: 9; display: none; pointer-events: none; text-align: center; white-space: nowrap; line-height: 1.15;
	background: var(--ink); color: var(--surface); padding: 6px 12px; border-radius: 10px; box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}
.tlv2-htip.is-on { display: block; }
.tlv2-htip strong { display: block; font-size: 1.15rem; letter-spacing: .01em; }
.tlv2-htip span { display: block; font-size: 0.72rem; opacity: .85; margin-top: 2px; }
.tlv2-htip::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -6px; width: 12px; height: 12px; background: var(--ink); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.tlv2-htip.is-below::after { bottom: auto; top: -6px; }
.tlv2-hslot.is-past, .tlv2-hslot.is-closed {
	background: var(--past);
	background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, .035) 6px 7px);
}
.tlv2-hres {
	position: relative; z-index: 2; margin: 5px 2px; border: 0; border-radius: 12px; padding: 8px 10px; text-align: left;
	overflow: hidden; min-width: 0; background: var(--busy); color: var(--busy-ink);
	display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.tlv2-hres.is-mine { background: var(--mine); color: var(--mine-ink); }
.tlv2-hres.is-block { background: var(--block); color: var(--block-ink); }
.tlv2-hres:hover { filter: brightness(.95); }
.tlv2-hres .tlv2-res-tag { position: absolute; top: 6px; right: 8px; }
.tlv2-hres.is-short { padding-inline: 7px; }
.tlv2-hres.is-short .tlv2-res-time, .tlv2-hres.is-short .tlv2-res-tag { display: none; }
.tlv2-hres.is-movable { cursor: grab; }
.tlv2-hhandle {
	position: absolute; top: 0; bottom: 0; width: 9px; max-width: 34%; cursor: ew-resize; z-index: 3;
	display: flex; align-items: center; justify-content: center; touch-action: none;
}
.tlv2-hhandle.is-l { left: 0; } .tlv2-hhandle.is-r { right: 0; }
.tlv2-hhandle::after { content: ""; width: 3px; height: 18px; border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .12s; }
.tlv2-hres:hover .tlv2-hhandle::after, .tlv2-hres.is-drag .tlv2-hhandle::after { opacity: .45; }
.tlv2-hhandle:hover::after { opacity: .9 !important; }
.tlv2-hres.is-drag { opacity: .4; cursor: grabbing; }
.tlv2-hghost {
	position: absolute; z-index: 7; pointer-events: none; border: 2px dashed var(--accent); border-radius: 10px;
	background: color-mix(in srgb, var(--accent) 24%, var(--surface)); display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 0.8rem; color: var(--ink); overflow: hidden; white-space: nowrap;
}
.tlv2-wrap.is-dragging, .tlv2-wrap.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.tlv2-hnow { position: absolute; top: 0; bottom: 0; left: calc(var(--dayw) + var(--courtw) + var(--col) * var(--n)); width: 0; border-left: 2px solid var(--danger); z-index: 4; pointer-events: none; }
/* in the week the line covers only today's two rows, below the hour header */
.is-weekh .tlv2-hnow { top: calc(var(--head) + var(--tr) * var(--hrow)); bottom: auto; height: calc(var(--nr) * var(--hrow)); }
.is-weekh .tlv2-hnow::before { top: -5px; }
.tlv2-hnow::before { content: ""; position: absolute; left: -6px; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* ---------- vertical grid (week on desktop, optional day layout) ---------- */
.tlv2-grid-head, .tlv2-grid-body { display: grid; }
.tlv2-grid-head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.tlv2-colhead { padding: 10px 6px; text-align: center; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.tlv2-colhead strong { font-size: 0.95rem; }
.tlv2-colhead span { font-size: 0.78rem; color: var(--muted); }
.tlv2-colhead.is-today { background: var(--accent-soft); }
.tlv2-colhead.is-today strong { color: var(--accent); }
.tlv2-wrap[data-theme="night"] .tlv2-colhead.is-today strong { color: #d8f34b; }
.tlv2-grid-body { position: relative; grid-template-rows: repeat(var(--rows), var(--row)); }
.tlv2-time { font-size: 0.74rem; color: var(--muted); padding: 3px 8px 0 0; text-align: right; border-top: 1px solid var(--line); }
.tlv2-time.is-hour { color: var(--ink); font-weight: 600; border-top-color: var(--hour-line); }

.tlv2-slot {
	border: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 0;
	background: var(--free); color: var(--muted); font-size: 0.78rem; padding: 0; text-align: center;
	display: flex; align-items: center; justify-content: center; min-width: 0;
}
.tlv2-slot.is-hour { border-top-color: var(--hour-line); }
.tlv2-slot span { opacity: .55; }
.tlv2-slot:hover:not(:disabled) { background: var(--free-hover); color: var(--ink); }
.tlv2-slot:hover:not(:disabled) span { opacity: 1; font-weight: 600; }
.tlv2-slot.is-past, .tlv2-slot.is-closed {
	background: var(--past);
	background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, .035) 6px 7px);
}

.tlv2-res {
	margin: 2px; border: 0; border-radius: 10px; padding: 5px 9px; text-align: left; overflow: hidden; min-width: 0;
	background: var(--busy); color: var(--busy-ink);
	display: flex; flex-direction: column; justify-content: flex-start; gap: 1px; position: relative; z-index: 1;
	box-shadow: inset 3px 0 0 rgba(0, 0, 0, .18);
}
.tlv2-res.is-mine { background: var(--mine); color: var(--mine-ink); box-shadow: none; }
.tlv2-res.is-block { background: var(--block); color: var(--block-ink); box-shadow: none; }
.tlv2-res:hover { filter: brightness(.96); }
.tlv2-res-name { font-weight: 700; font-size: 0.88rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlv2-res-time { font-size: 0.76rem; opacity: .85; white-space: nowrap; }
.tlv2-res-tag { position: absolute; top: 5px; right: 7px; font-size: 0.66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.tlv2-res.is-short { flex-direction: row; align-items: center; gap: 8px; padding-block: 0; }
.tlv2-res.is-short .tlv2-res-name { flex: 0 1 auto; }
.tlv2-res.is-short .tlv2-res-tag { position: static; margin-left: auto; }

.tlv2-now { position: absolute; left: var(--timew); right: 0; top: calc(var(--row) * var(--n)); height: 0; border-top: 2px solid var(--danger); z-index: 3; pointer-events: none; }
.tlv2-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* week grid: narrow columns, so keep cells quiet and show a "+" on hover */
.is-week .tlv2-slot span { display: none; }
.is-week .tlv2-slot:hover:not(:disabled)::after { content: "+"; font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.is-week .tlv2-res { padding: 4px 7px; }
.is-week .tlv2-res-name { font-size: 0.82rem; }
.is-week .tlv2-res-time { font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; }
.is-week .tlv2-res-tag { display: none; }
.is-week .tlv2-res.is-short { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
.is-week .tlv2-res.is-short .tlv2-res-time { display: none; }

/* week list (phones) */
.tlv2-weeklist { display: grid; gap: 0; }
.tlv2-daycard { padding: 12px 14px; border-top: 1px solid var(--line); }
.tlv2-daycard:first-child { border-top: 0; }
.tlv2-daycard header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tlv2-daycard header em { font-style: normal; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--accent); color: var(--accent-ink); padding: 2px 8px; border-radius: 999px; }
.tlv2-daycard header .tlv2-link { margin-left: auto; }
.tlv2-daycard.is-today { background: var(--accent-soft); }
.tlv2-daycard.is-past { opacity: .6; }
.tlv2-daycard ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.tlv2-chip { width: 100%; display: flex; gap: 10px; align-items: center; border: 0; text-align: left; background: var(--busy); color: var(--busy-ink); border-radius: 10px; padding: 9px 12px; min-height: 42px; }
.tlv2-chip.is-mine { background: var(--mine); color: var(--mine-ink); }
.tlv2-chip.is-block { background: var(--block); color: var(--block-ink); }
.tlv2-chip-time { font-weight: 700; font-size: 0.88rem; }
.tlv2-chip-name { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlv2-free { margin: 0; font-size: 0.85rem; color: var(--muted); }
.tlv2-free span { font-weight: 700; color: var(--ink); }

/* legend */
.tlv2-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 0.82rem; color: var(--muted); }
.tlv2-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tlv2-key { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.tlv2-key.is-free { background: var(--free); }
.tlv2-key.is-busy { background: var(--busy); border-color: transparent; }
.tlv2-key.is-mine { background: var(--mine); border-color: transparent; }
.tlv2-key.is-past { background: var(--past); }
.tlv2-key.is-block { background: var(--block); border-color: transparent; }

/* dialogs */
.tlv2-dlg { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 24px); width: 440px; color: var(--ink); }
.tlv2-dlg::backdrop { background: rgba(10, 20, 16, .6); backdrop-filter: blur(2px); }
.tlv2-dlg-in {
	background: var(--surface); color: var(--ink); border-radius: 18px; padding: 22px; display: grid; gap: 14px;
	font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; font-variant-numeric: tabular-nums;
}
.tlv2-dlg h3 { font-size: 1.2rem; margin: 0; }
.tlv2-dlg p { margin: 0; }
.tlv2-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.tlv2-dl dt { color: var(--muted); font-size: 0.9rem; }
.tlv2-dl dd { margin: 0; font-weight: 600; }
.tlv2-field { display: grid; gap: 6px; }
.tlv2-lbl { font-size: 0.85rem; color: var(--muted); }
.tlv2-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tlv2-chip-opt { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 14px; min-height: 42px; font-weight: 600; font-size: 0.9rem; }
.tlv2-chip-opt.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tlv2-chip-opt:disabled { opacity: .35; }
.tlv2-form { display: grid; gap: 12px; }
.tlv2-form label, .tlv2-field { font-size: 0.9rem; }
.tlv2-wrap input[type="text"], .tlv2-wrap input[type="password"] {
	width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px;
	padding: 11px 12px; min-height: 44px; font: inherit; margin-top: 4px;
}
.tlv2-field input[type="text"] { margin-top: 0; }
.tlv2-wrap select, .tlv2-wrap input[type="date"] {
	border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px;
	padding: 9px 10px; min-height: 42px; font: inherit; max-width: 100%;
}
.tlv2-datefield { position: relative; display: flex; align-items: center; }
.tlv2-datefield input[type="text"] { padding-right: 46px; }
.tlv2-datefield.is-bad input[type="text"] { border-color: #b3261e; box-shadow: 0 0 0 2px rgba(179, 38, 30, .15); }
.tlv2-datefield-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; }
.tlv2-datefield-btn:hover, .tlv2-datefield-btn:focus-visible { color: var(--ink); background: var(--line); }
/* my reservations dialog */
.tlv2-minelist { display: grid; gap: 10px; max-height: min(55vh, 460px); overflow-y: auto; padding: 2px; margin: 0 -2px; }
.tlv2-mineitem { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: opacity .25s, transform .25s; }
.tlv2-mineitem.is-gone { opacity: 0; transform: scale(.97); }
.tlv2-mine-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tlv2-mine-head strong { font-size: 1rem; }
.tlv2-mine-head em { font-style: normal; font-size: 0.7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 2px 8px; border-radius: 999px; }
.tlv2-mine-meta { font-size: 0.95rem; font-weight: 600; }
.tlv2-mine-note { font-size: 0.85rem; color: var(--muted); }
.tlv2-mine-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; margin-top: 4px; }
.tlv2-mine-actions .tlv2-link { margin-right: auto; font-size: 0.88rem; }
.tlv2-mine-lock { font-size: 0.8rem; text-align: right; }
.tlv2-mine-empty { margin: 0; padding: 22px 8px; text-align: center; color: var(--muted); }
.tlv2-timerow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tlv2-small { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }
.tlv2-modeseg { justify-self: start; }
.tlv2-modeseg button { padding: 6px 14px; min-height: 34px; font-size: 0.88rem; }
.tlv2-chip-opt[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tlv2-dlg select { width: auto; min-width: 84px; }
.tlv2-check { display: flex; align-items: center; gap: 8px; }
.tlv2-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.tlv2-error { color: var(--danger); font-size: 0.9rem; font-weight: 600; }

.tlv2-toast {
	position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
	background: #14231f; color: #fff; padding: 12px 18px; border-radius: 12px; max-width: min(460px, calc(100vw - 24px));
	font-size: 0.92rem; z-index: 99999; transition: opacity .2s, transform .2s;
}
.tlv2-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* desktop */
@media (min-width: 760px) {
	.tlv2-wrap { --row: 34px; --timew: 60px; }
	.tlv2-top { padding: 24px 28px 20px; }
	.tlv2-title h2 { font-size: 1.7rem; }
	.tlv2-body { padding: 18px 28px 24px; }
	.tlv2-res-name { font-size: 0.92rem; }
}

/* phones */
@media (max-width: 759px) {
	.tlv2-wrap { border-radius: 16px; --row: 42px; --timew: 46px; }
	.tlv2-topline { flex-direction: column; align-items: stretch; gap: 8px; }
	.tlv2-account { justify-content: space-between; }
	.tlv2-datenav { flex-wrap: nowrap; gap: 6px; }
	.tlv2-datenav .tlv2-btn { flex-shrink: 0; padding-inline: 12px; }
	.tlv2-datenav { width: 100%; }
	.tlv2-datenav .tlv2-icon { width: 40px; padding: 0; }
	.tlv2-datenav .tlv2-btn-ghost:not(.tlv2-icon) { padding-inline: 12px; }
	.tlv2-pill { flex: 1 1 auto; min-width: 0; padding: 9px 10px; font-size: 0.88rem; gap: 6px; }
	.tlv2-seg { width: 100%; }
	.tlv2-seg button { flex: 1; padding-inline: 8px; }
	.tlv2-tabs { width: 100%; }
	.tlv2-time { padding-right: 6px; font-size: 0.7rem; }
	.tlv2-res-name { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
	.tlv2-btn, .tlv2-toast { transition: none; }
}

/* ---------- clean booking page (own template, only reservations) ---------- */
body.tlv2-clean { margin: 0; background: #dfe8e3; min-height: 100vh; }
body.tlv2-clean:has(.tlv2-wrap[data-theme="clay"]) { background: #f1e6d8; }
body.tlv2-clean:has(.tlv2-wrap[data-theme="night"]) { background: #0b100e; }
.tlv2-clean-main { padding: 24px 16px 40px; }
.tlv2-clean-main .tlv2-wrap { margin-block: 0 !important; }

/* ---------- phones: compact, so most of the day is visible ---------- */
@media (max-width: 759px) {
	.tlv2-clean-main { padding: 0 0 24px; }
	.tlv2-clean-main .tlv2-wrap { border-radius: 0; }
	.tlv2-wrap { font-size: 14px; }

	.tlv2-top { padding: 10px 10px 10px; gap: 8px; }
	.tlv2-topline { display: block; position: relative; }
	.tlv2-topgap { display: none; }
	.tlv2-addr-d { display: none; }
	.tlv2-addr-m { display: block; font-size: 0.72rem; margin: 3px 0 0; }
	.tlv2-title h2 { font-size: 1.05rem; }
	.tlv2-title p { font-size: 0.75rem; margin-top: 2px; }
	.tlv2-account { justify-self: stretch; justify-content: center; gap: 8px; font-size: 0.78rem; margin-top: 4px; }
	.tlv2-account.is-in { flex-direction: row; justify-content: space-between; align-items: center; gap: 8px; }
	.tlv2-account-row { gap: 8px; min-width: 0; }
	.tlv2-account.is-in .tlv2-mine-btn { min-height: 32px; padding: 4px 12px; font-size: 0.8rem; flex-shrink: 0; }
	.tlv2-badge { height: 18px; min-width: 18px; margin-left: 6px; font-size: 0.7rem; }
	.tlv2-who { max-width: 160px; }
	.tlv2-account .tlv2-btn { min-height: 32px; padding: 4px 14px; font-size: 0.82rem; }

	.tlv2-datenav { gap: 5px; }
	.tlv2-datenav .tlv2-btn { min-height: 36px; font-size: 0.8rem; }
	.tlv2-datenav .tlv2-icon { width: 34px; font-size: 1.2rem; }
	.tlv2-datenav .tlv2-btn-ghost:not(.tlv2-icon) { padding-inline: 10px; }
	.tlv2-pill { min-height: 36px; padding: 6px 10px; font-size: 0.82rem; gap: 5px; }

	.tlv2-body { padding: 8px 0 12px; }
	.tlv2-toolbar { padding: 0 8px; margin-bottom: 8px; gap: 6px; }
	.tlv2-seg, .tlv2-tabs { padding: 3px; }
	.tlv2-seg button, .tlv2-tabs button { min-height: 32px; padding: 4px 8px; font-size: 0.8rem; }
	.tlv2-stage { border-radius: 0; border-inline: 0; }
	.tlv2-weeklist .tlv2-daycard { padding: 10px 10px; }
	.tlv2-banner { padding: 8px 10px; font-size: 0.8rem; }

	.tlv2-hgrid { --hrow: 56px; --head: 26px; }
	.tlv2-hgrid.is-weekh { --hrow: 46px; }
	.tlv2-hgrid:not(.is-weekh) { --hrow: 62px; }
	.tlv2-hgrid:not(.is-weekh) .tlv2-hres .tlv2-res-name { font-size: 0.78rem; }
	.tlv2-hgrid:not(.is-weekh) .tlv2-hres .tlv2-res-time { font-size: 0.7rem; }
	.tlv2-h-day { padding: 0 4px 0 6px; gap: 1px; }
	.tlv2-h-day strong { font-size: 0.8rem; }
	.tlv2-h-day span { font-size: 0.6rem; white-space: nowrap; }
	.tlv2-h-day em { font-size: 0.54rem; padding: 0 6px; }
	.is-weekh .tlv2-h-court { padding: 0 2px; }
	.is-weekh .tlv2-h-court strong { font-size: 0.78rem; }
	.is-weekh .tlv2-hres { margin: 2px 1px; padding: 2px 5px; border-radius: 7px; }
	.is-weekh .tlv2-hres .tlv2-res-name { font-size: 0.68rem; line-height: 1.1; -webkit-line-clamp: 2; }
	.is-weekh .tlv2-hres .tlv2-res-time { display: none; }
	.tlv2-h-court { padding: 0 4px; justify-content: center; text-align: center; }
	.tlv2-h-court strong { font-size: 0.74rem; line-height: 1.15; }
	.tlv2-h-hour { font-size: 0.68rem; padding-left: 4px; }
	.tlv2-hslot span { font-size: 0.9rem; opacity: .2; }
	.tlv2-hres { margin: 3px 1px; padding: 4px 6px; border-radius: 8px; gap: 1px; }
	.tlv2-hres .tlv2-res-name { font-size: 0.72rem; line-height: 1.15; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
	.tlv2-hres .tlv2-res-time { font-size: 0.64rem; }
	.tlv2-hres.is-short { padding-inline: 4px; }
	.tlv2-hres.is-tiny .tlv2-res-name { display: none; }
	.tlv2-hres.is-short .tlv2-res-name { font-size: 0.66rem; }
	.tlv2-hnow::before { width: 8px; height: 8px; left: -5px; }

	.tlv2-legend { padding: 0 10px; margin-top: 8px; gap: 4px 12px; font-size: 0.72rem; }
	.tlv2-key { width: 11px; height: 11px; }
	.tlv2-chip-name, .tlv2-chip-time { font-size: 0.82rem; }
}

@media (hover: none) { .tlv2-hhandle { display: none; } }

/* ---------- admin copy / paste ---------- */
/* Floating pill at the bottom of the screen, where the thumb / mouse already is. */
.tlv2-clip {
	position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100000;
	display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 24px);
	padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--ink); color: var(--surface);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); font-size: 0.92rem; line-height: 1.25;
}
.tlv2-clip[hidden] { display: none; }
.tlv2-clip-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlv2-clip-hint { opacity: 0.75; }
.tlv2-clip .tlv2-btn { flex: none; min-height: 40px; padding: 6px 18px; background: var(--surface); color: var(--ink); border-color: transparent; font-weight: 700; }
.tlv2-wrap.is-pasting .tlv2-body { padding-bottom: 84px; }
.tlv2-wrap.is-pasting .tlv2-toast { bottom: 82px; }
.tlv2-wrap.is-pasting .tlv2-hslot:not(:disabled),
.tlv2-wrap.is-pasting .tlv2-slot:not(:disabled) { cursor: copy; }
.tlv2-wrap.is-pasting .tlv2-hslot:not(:disabled):hover,
.tlv2-wrap.is-pasting .tlv2-slot:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
@media (max-width: 759px) {
	.tlv2-clip { gap: 10px; padding-left: 14px; font-size: 0.86rem; }
	.tlv2-clip-hint { display: none; }
	.tlv2-wrap.is-pasting .tlv2-body { padding-bottom: 92px; }
}

/* ---------- slot colours ---------- */
.tlv2-hres.has-tint, .tlv2-res.has-tint, .tlv2-chip.has-tint { background: var(--tc); color: var(--tci); }
.tlv2-res.has-tint { box-shadow: none; }
.tlv2-colors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tlv2-swatch {
	position: relative; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--surface); padding: 0;
	box-shadow: 0 0 0 1px var(--line); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
	background: var(--surface); transition: transform .1s, box-shadow .1s;
}
.tlv2-swatch:hover { transform: scale(1.08); }
.tlv2-swatch.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.tlv2-swatch.is-default { width: auto; min-width: 34px; padding: 0 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.tlv2-swatch.is-custom { font-weight: 700; font-size: 1.1rem; color: var(--muted); overflow: hidden;
	background-image: conic-gradient(#e5534b, #e9a23b, #f1e05a, #5fb878, #4a90d9, #9b6bd6, #e5534b); color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.5); }
.tlv2-swatch.is-custom.is-on { background-image: none; text-shadow: none; }
.tlv2-color-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* ---------- copy week ---------- */
.tlv2-copywk { margin-left: auto; }
.tlv2-preview { margin: 4px 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 0.9rem; line-height: 1.5; }
.tlv2-preview strong { font-weight: 700; }
.tlv2-preview-x { display: block; margin-top: 4px; font-size: 0.85rem; opacity: .85; }
.tlv2-preview.is-warn { background: #fcebea; color: #5c1410; }
.tlv2-weeksel { width: 100% !important; }
.tlv2-hscroll.is-panning, .tlv2-hscroll.is-panning * { cursor: grabbing !important; user-select: none; }
.tlv2-hscroll { -webkit-user-select: none; user-select: none; }
.tlv2-stack { display: grid; gap: 14px; margin: 6px 0 14px; }

/* ---------- vertical day view: both courts side by side, scrolls inside its own frame ---------- */
.tlv2-grid-wrap.is-day { --row: 30px; max-height: clamp(420px, calc(100vh - 150px), 780px); overflow-y: auto; overscroll-behavior: auto; scrollbar-width: thin; }
@supports (height: 100dvh) { .tlv2-grid-wrap.is-day { max-height: clamp(420px, calc(100dvh - 150px), 780px); } }
.is-day .tlv2-grid-head { box-shadow: 0 1px 0 var(--line), 0 6px 10px -8px rgba(0, 0, 0, .25); }
.is-day .tlv2-colhead { padding: 9px 6px; }
.is-day .tlv2-colhead strong { font-size: 0.95rem; }
.is-day .tlv2-time { font-size: 0.68rem; padding: 2px 8px 0 0; border-top-color: transparent; }
.is-day .tlv2-time.is-hour { border-top-color: var(--hour-line); font-size: 0.74rem; }
.is-day .tlv2-slot { font-size: 1rem; }
.is-day .tlv2-slot .tlv2-plus { font-weight: 600; opacity: .28; }
.is-day .tlv2-slot:hover:not(:disabled) .tlv2-plus { opacity: 1; color: var(--accent); }
.is-day .tlv2-slot:hover:not(:disabled) .tlv2-plus::after { content: " Slobodno"; font-size: 0.78rem; }
.is-day .tlv2-res { margin: 1px 3px; border-radius: 10px; padding: 4px 10px; }
.is-day .tlv2-res.is-movable { cursor: grab; }
.is-day .tlv2-res.is-drag { opacity: .4; cursor: grabbing; }
.is-day .tlv2-res-name { font-size: 0.85rem; }
.is-day .tlv2-res-time { font-size: 0.72rem; }
.tlv2-layoutbtn { white-space: nowrap; }
@media (max-width: 759px) {
	.tlv2-grid-wrap.is-day { --row: 28px; max-height: clamp(360px, calc(100vh - 110px), 900px); }
	@supports (height: 100dvh) { .tlv2-grid-wrap.is-day { max-height: clamp(360px, calc(100dvh - 110px), 900px); } }
	.is-day .tlv2-colhead { padding: 7px 4px; }
	.is-day .tlv2-colhead strong { font-size: 0.85rem; }
	.is-day .tlv2-res { padding: 3px 7px; margin: 1px 2px; border-radius: 8px; }
	.is-day .tlv2-res-name { font-size: 0.76rem; }
	.is-day .tlv2-res-time { font-size: 0.66rem; }
	.is-day .tlv2-time { font-size: 0.62rem; padding-right: 5px; }
	.is-day .tlv2-time.is-hour { font-size: 0.68rem; }
	.is-day .tlv2-slot:hover:not(:disabled) .tlv2-plus::after { content: ""; }
}
.tlv2-grid-wrap.is-panning, .tlv2-grid-wrap.is-panning * { cursor: grabbing !important; user-select: none; }
.tlv2-grid-wrap { -webkit-user-select: none; user-select: none; }

/* own calendar (Monday first, independent of device region) */
.tlv2-cal { position: fixed; z-index: 100000; width: 292px; max-width: calc(100vw - 16px); box-sizing: border-box; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, .28); padding: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.tlv2-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tlv2-cal-head strong { font-size: 1rem; }
.tlv2-wrap .tlv2-cal-nav { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 1.4rem; line-height: 1; }
.tlv2-wrap .tlv2-cal-nav:hover { background: var(--line); }
.tlv2-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.tlv2-cal-dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.tlv2-wrap .tlv2-cal-day { height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-weight: 600; font-size: .95rem; }
.tlv2-wrap .tlv2-cal-day.is-we { color: var(--muted); }
.tlv2-wrap .tlv2-cal-day:hover:not(:disabled) { background: var(--line); }
.tlv2-wrap .tlv2-cal-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.tlv2-wrap .tlv2-cal-day.is-sel { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.tlv2-wrap .tlv2-cal-day:disabled { opacity: .3; cursor: default; }
.tlv2-cal-foot { display: flex; justify-content: center; margin-top: 8px; }

/* ---------- fixed frame: header + toolbar stay put, only the schedule (times) scrolls ---------- */
@media (min-height: 560px) {
	.tlv2-wrap {
		position: sticky; top: var(--tlv2-top, 0px);
		max-height: var(--tlv2-h, calc(100vh - var(--tlv2-top, 0px) - 6px)); display: flex; flex-direction: column;
	}
	@supports (height: 100dvh) { .tlv2-wrap { max-height: var(--tlv2-h, calc(100dvh - var(--tlv2-top, 0px) - 6px)); } }
	.tlv2-wrap.is-pinned { position: fixed; top: var(--tlv2-top, 0px); margin: 0 !important; max-width: none !important; z-index: 20; box-sizing: border-box; }
	.tlv2-wrap > .tlv2-top { flex: none; }
	.tlv2-wrap > .tlv2-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-bottom: 10px; }
	.tlv2-body > .tlv2-toolbar { flex: none; }
	.tlv2-body > .tlv2-stage { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; }
	.tlv2-stage > .tlv2-grid-wrap, .tlv2-stage > .tlv2-hscroll { flex: 0 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
	.tlv2-stage > .tlv2-grid-wrap.is-day { max-height: none; }
}

/* ---------- login dialog: clear fields, big button, stays at the top so the phone keyboard does not cover it ---------- */
.tlv2-login-in { gap: 12px; }
.tlv2-login-sub { font-size: 0.86rem; line-height: 1.4; }
.tlv2-login-form { gap: 14px; }
.tlv2-lf { display: grid; gap: 6px; }
.tlv2-lf > label { font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.tlv2-wrap .tlv2-login-form input[type="text"], .tlv2-wrap .tlv2-login-form input[type="password"] { margin-top: 0; min-height: 50px; font-size: 16px; border-width: 2px; border-color: var(--line); background: var(--surface); }
.tlv2-wrap .tlv2-login-form input[type="text"]:focus, .tlv2-wrap .tlv2-login-form input[type="password"]:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
.tlv2-pwrap { position: relative; }
.tlv2-pwrap input { padding-right: 84px !important; }
.tlv2-wrap .tlv2-pwshow { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--accent-soft); color: var(--ink); font-weight: 700; font-size: 0.8rem; border-radius: 8px; padding: 8px 12px; min-height: 36px; }
.tlv2-login-go { width: 100%; min-height: 50px; font-size: 1.05rem; justify-content: center; }
.tlv2-login-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.9rem; }
.tlv2-login-links a { color: var(--accent); font-weight: 600; }
@media (max-width: 759px) {
	#tlv2-login { margin: max(10px, env(safe-area-inset-top)) auto auto; max-height: calc(100dvh - 20px); overflow-y: auto; }
	#tlv2-login .tlv2-dlg-in { padding: 18px; }
}

/* ---------- messages in the login dialog (Cloudflare version) ---------- */
.tlv2-okmsg { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #e6f4ec; color: #14573c; font-size: .9rem; font-weight: 600; }
