/* B'lis Activity Tracker — styled to match the B'lis Training theme. Everything is scoped to .blis-at. */

.blis-at {
	--bg: #f5f9fb;
	--panel: #ffffff;
	--ink: #2b2d5a;
	--navy: #3c3f76;
	--muted: #4b4e6e;
	--line: #c9d9e1;
	--accent-soft: #eef4f7;
	--blue: #87b2c5;
	--danger: #a33b2f;
	--on-ink: #ffffff;
	--display: "DM Serif Display", Georgia, serif;
	--body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--day-count: 5;
	box-sizing: border-box;
	position: relative;
	margin-left: auto;
	margin-right: auto;
	background: var(--bg);
	color: var(--ink);
	font: 15px/1.4 var(--body);
	border-radius: 16px;
	text-align: left;
}
.blis-at *, .blis-at *::before, .blis-at *::after { box-sizing: border-box; }
.blis-at [hidden] { display: none !important; }
.blis-at.is-loading .main { opacity: .5; }

/* Reset theme styles that would otherwise leak in */
.blis-at input, .blis-at button, .blis-at select, .blis-at textarea { font-family: var(--body); color: var(--ink); margin: 0; letter-spacing: normal; text-transform: none; box-shadow: none; min-height: 0; }
.blis-at button { line-height: 1.2; }
.blis-at p, .blis-at h2, .blis-at h3, .blis-at h4 { margin: 0; }
.blis-at table { margin: 0; }

.blis-at__app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 24px 24px 40px; }

/* Brand */
.blis-at .brand { display: flex; align-items: center; gap: 18px; padding-bottom: 14px; border-bottom: 1.5px solid var(--line); }
.blis-at .brand img { width: 96px; height: 96px; max-width: none; border-radius: 50%; object-fit: cover; flex: none; }
.blis-at .brand-name { font: 400 36px/1.05 var(--display); color: var(--navy); margin: 0; }
.blis-at .brand-sub { margin: 6px 0 0; font: 700 13px/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.blis-at .noscript { background: var(--accent-soft); border: 1.5px solid var(--navy); border-radius: 8px; padding: 12px 14px; font-weight: 500; }

/* Toolbar */
.blis-at .toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.blis-at .plan-meta { display: flex; gap: 16px; flex-wrap: wrap; flex: 1; align-items: flex-end; }
.blis-at .plan-meta label { display: flex; flex-direction: column; font: 700 12px var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); gap: 2px; flex: 1; min-width: 160px; margin: 0; }
.blis-at .plan-meta input { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 38px; margin: 0; font: 500 16px/1.2 var(--body); border: 0; border-radius: 0; border-bottom: 1.5px solid var(--ink); padding: 6px 0; background: transparent; color: var(--ink); }
.blis-at .plan-meta input[type="date"] { min-width: 0; text-align: left; }
.blis-at .plan-meta input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.blis-at .plan-meta input[type="date"]::-webkit-datetime-edit { padding: 0; }
.blis-at .plan-meta input:focus { outline: none; border-bottom-color: var(--blue); }
.blis-at .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.blis-at .btn { font: 600 14px var(--body); min-height: 44px; padding: 10px 18px; border: 1.5px solid var(--navy); background: var(--panel); color: var(--navy); border-radius: 8px; cursor: pointer; }
.blis-at .btn.primary { background: var(--navy); color: var(--on-ink); }
.blis-at .btn:hover { background: var(--accent-soft); }
.blis-at .btn.primary:hover { background: var(--ink); border-color: var(--ink); }
.blis-at .btn:disabled { opacity: .6; cursor: progress; }

/* Activity buttons */
.blis-at .bank { padding: 14px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; }
.blis-at .bank-title { font: 700 13px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin: 0 0 2px; }
.blis-at .hint { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.blis-at .hint-narrow { display: none; }
.blis-at .bank-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.blis-at .chip { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; background: var(--panel); border: 1.5px solid var(--line); border-radius: 8px; padding: 0 4px 0 12px; min-height: 44px; cursor: pointer; user-select: none; color: var(--ink); }
.blis-at .chip:hover { border-color: var(--navy); }
.blis-at .chip span { flex: 1; font-weight: 500; white-space: nowrap; }
.blis-at .chip.in-plan { background: var(--accent-soft); border-color: var(--blue); }
.blis-at .chip.in-plan span::after { content: " \2713"; color: var(--navy); font-weight: 700; }
.blis-at .add-btn { border: 0; background: var(--accent-soft); color: var(--navy); width: 32px; height: 32px; padding: 0; border-radius: 6px; font-size: 18px; font-weight: 600; cursor: pointer; flex: none; }
.blis-at .add-btn:hover { background: var(--navy); color: var(--on-ink); }

/* Status */
.blis-at .main { min-width: 0; transition: opacity .2s; }
.blis-at .status { font-size: 14px; font-weight: 500; color: var(--navy); min-height: 1.4em; margin: 0 0 6px; text-align: right; }
.blis-at .status.is-error { color: var(--danger); }

/* Week tabs */
.blis-at .week-tabs { position: sticky; top: 108px; z-index: 6; background: var(--bg); padding-block: 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 4px; }
.blis-at .week-tab { font: 700 15px var(--body); letter-spacing: .06em; text-transform: uppercase; padding: 10px 6px; min-height: 52px; border: 1.5px solid var(--navy); background: var(--panel); color: var(--navy); border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.blis-at .week-tab small { font: 500 12px var(--body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.blis-at .week-tab[aria-selected="true"] { background: var(--navy); color: var(--on-ink); }
.blis-at .week-tab[aria-selected="true"] small { color: var(--on-ink); opacity: .85; }
.blis-at .week-panel { display: flex; flex-direction: column; gap: 10px; }
.blis-at .week-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.blis-at .week-title { margin: 0; font: 400 26px/1.1 var(--display); color: var(--navy); }
.blis-at .link-btn { border: 0; background: none; color: var(--navy); font: 600 14px var(--body); text-decoration: underline; cursor: pointer; padding: 6px 0; min-height: 44px; }
.blis-at .week-empty { margin: 0; padding: 22px 16px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 10px; }
.blis-at .week-add { font: 600 15px var(--body); color: var(--navy); background: var(--panel); border: 1.5px dashed var(--blue); border-radius: 8px; padding: 10px 12px; min-height: 44px; max-width: 100%; width: auto; height: auto; cursor: pointer; align-self: flex-start; }

/* Weekly grid */
.blis-at .grid-wrap { overflow-x: auto; border-radius: 10px; }
.blis-at table.check-grid { width: 100%; min-width: calc(160px + var(--day-count) * 96px); table-layout: fixed; border-collapse: collapse; background: var(--panel); border: 1.5px solid var(--line); }
.blis-at .check-grid th { font: 700 13px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--on-ink); background: var(--navy); text-align: center; padding: 9px 4px; border: 0; border-left: 1px solid rgba(255, 255, 255, .2); }
.blis-at .check-grid th.type-col { width: 160px; border-left: 0; text-align: left; padding-left: 10px; font-size: 11px; }
.blis-at .check-grid td { border: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 0; vertical-align: middle; background: transparent; }
.blis-at .check-grid tbody tr:first-child td { border-top: 0; }
.blis-at .check-grid td.type-cell { border-left: 0; background: var(--accent-soft); padding: 6px 4px 6px 10px; }
.blis-at .type-name { display: block; font: 700 14px/1.2 var(--body); letter-spacing: .04em; text-transform: uppercase; color: var(--navy); }
.blis-at .row-tools { display: flex; gap: 2px; margin-left: -6px; }
.blis-at .icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 32px; height: 32px; padding: 0; border-radius: 6px; font-size: 15px; }
.blis-at .icon-btn:hover { background: var(--panel); color: var(--navy); }
.blis-at .icon-btn.remove:hover { color: var(--danger); }
.blis-at .day-box { display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-height: 48px; }
.blis-at .day-box input[type="checkbox"] { flex: none; width: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--navy); cursor: pointer; }
.blis-at .day-box input[type="text"] { flex: 1; min-width: 0; width: auto; height: auto; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font: 14px var(--body); padding: 4px 2px; background: transparent; color: var(--ink); }
.blis-at .day-box input[type="text"]:focus { outline: none; border-bottom: 2px solid var(--navy); }
.blis-at .day-box input[type="text"]::placeholder { color: var(--muted); opacity: .55; }
.blis-at .print-rows, .blis-at .note-print, .blis-at .note-btn { display: none; }

/* Note sheet (phones) */
.blis-at .note-sheet { position: fixed; inset: 0; z-index: 99995; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-start; justify-content: center; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 16px; }
.blis-at .sheet-card { width: 100%; max-width: 480px; background: var(--panel); color: var(--ink); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.blis-at .sheet-title { margin: 0; font: 700 15px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--navy); }
.blis-at .sheet-done { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.blis-at .sheet-done input { width: 24px; height: 24px; margin: 0; accent-color: var(--navy); }
.blis-at .sheet-card textarea { width: 100%; min-height: 110px; font: 16px/1.4 var(--body); padding: 10px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); resize: vertical; }
.blis-at .sheet-card textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--navy); }
.blis-at .sheet-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Toast */
.blis-at .toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); background: var(--navy); color: var(--on-ink); padding: 10px 16px; border-radius: 8px; font-weight: 500; display: flex; gap: 12px; align-items: center; z-index: 99990; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); }
.blis-at .toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--on-ink); }
.blis-at .toast button { border: 0; background: transparent; color: var(--on-ink); font: 600 14px var(--body); text-decoration: underline; cursor: pointer; padding: 4px; white-space: nowrap; }
.blis-at button:focus-visible, .blis-at input:focus-visible, .blis-at select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media screen and (max-width: 960px) {
	.blis-at .week-tabs { top: 78px; }
}

/* Phones: same weekly table, each cell stacks its checkbox over a note */
@media screen and (max-width: 760px) {
	.blis-at { border-radius: 0; }
	.blis-at__app { padding: 18px 12px 32px; }
	.blis-at .brand img { width: 60px; height: 60px; }
	.blis-at .brand-name { font-size: 26px; }
	.blis-at .brand-sub { font-size: 11px; }
	.blis-at .toolbar { flex-direction: column; align-items: stretch; gap: 14px; }
	.blis-at .plan-meta label { min-width: 0; }
	.blis-at .actions .btn { flex: 1; padding: 12px 8px; }
	.blis-at .hint-wide { display: none; }
	.blis-at .hint-narrow { display: inline; }
	.blis-at .bank-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.blis-at .chip { min-width: 0; }
	.blis-at .chip:last-child:nth-child(odd) { grid-column: 1 / -1; }
	.blis-at .chip span { white-space: normal; line-height: 1.2; padding-block: 6px; }
	.blis-at .week-tab { font-size: 13px; padding: 8px 2px; }
	.blis-at .week-tab small { font-size: 11px; }
	.blis-at .week-add { width: 100%; padding: 12px; font-size: 16px; }
	.blis-at .grid-wrap { overflow-x: auto; }
	.blis-at table.check-grid { min-width: calc(84px + var(--day-count) * 44px); }
	.blis-at .check-grid th { font-size: 12px; padding: 6px 2px; }
	.blis-at .check-grid th.type-col { width: 84px; padding-left: 6px; font-size: 10px; }
	.blis-at .check-grid td.type-cell { padding: 6px 2px 4px 6px; }
	.blis-at .type-name { font-size: 12px; line-height: 1.1; overflow-wrap: anywhere; }
	.blis-at .row-tools { margin: 2px 0 0 -4px; gap: 0; }
	.blis-at .row-tools .icon-btn { width: 24px; height: 32px; font-size: 14px; }
	.blis-at .day-box { flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 3px 6px; min-height: 0; }
	.blis-at .day-box input[type="checkbox"] { align-self: center; width: 24px; height: 24px; }
	.blis-at .day-box input[type="text"] { display: none; }
	.blis-at .note-btn { display: block; width: 100%; min-height: 32px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 2px 0; font: 12px/1.2 var(--body); color: var(--ink); text-align: center; overflow-wrap: anywhere; cursor: pointer; }
	.blis-at .note-btn.empty { color: var(--muted); opacity: .65; }
}

/* Print: only the tracker, all four weeks */
@media print {
	@page { size: letter portrait; margin: 0.5in; }
	html.blis-printing .blis-print-hide { display: none !important; }
	html.blis-printing body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
	html.blis-printing .blis-at.is-printing { margin: 0 !important; padding: 0 !important; max-width: none !important; width: auto !important; }
	.blis-at { background: #fff; border-radius: 0; color: #000; }
	.blis-at__app { display: block; padding: 0; }
	.blis-at .bank, .blis-at .week-tabs, .blis-at .actions, .blis-at .status, .blis-at .toast, .blis-at .noscript, .blis-at .link-btn, .blis-at .row-tools, .blis-at .week-empty, .blis-at .week-add, .blis-at .note-btn, .blis-at .note-sheet { display: none !important; }
	.blis-at .toolbar { display: flex !important; flex-direction: row !important; margin: 6px 0 10px; }
	.blis-at .plan-meta { flex-wrap: nowrap; gap: 28px; }
	.blis-at .plan-meta label { flex-direction: row; align-items: baseline; gap: 8px; font-size: 11px; color: #555; min-width: 0; white-space: nowrap; }
	.blis-at .plan-meta input { height: 24px; padding: 0 0 2px; font: 600 14px var(--body); color: #000; border-bottom: 1px solid #000; }
	.blis-at .plan-meta input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
	.blis-at .plan-meta input[type="date"]:invalid::-webkit-datetime-edit { color: transparent; }
	.blis-at input::placeholder { color: transparent; }
	.blis-at .brand { border-bottom: 2px solid #000; padding-bottom: 8px; }
	.blis-at .brand img { width: 56px; height: 56px; }
	.blis-at .week-panel, .blis-at .week-panel[hidden] { display: flex !important; break-inside: avoid; margin-bottom: 18px; }
	.blis-at .grid-wrap { overflow: visible; }
	.blis-at table.check-grid { min-width: 0; border-color: #000; }
	.blis-at .check-grid th { background: #fff; color: #000; border-bottom: 1.5px solid #000; border-left-color: #999; padding: 5px 4px; }
	.blis-at .check-grid td.type-cell { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.blis-at .check-grid tr { break-inside: avoid; }
	.blis-at .day-box { min-height: 36px; }
	.blis-at .day-box input[type="text"] { display: none; }
	.blis-at .note-print { display: block; flex: 1; min-width: 0; min-height: 16px; font-size: 11px; line-height: 1.25; border-bottom: 1px solid #999; overflow-wrap: anywhere; }
	.blis-at .print-rows { display: table-row-group; }
}
