:root {
	--jc-bg: #0f172a;
	--jc-bg-soft: #1e293b;
	--jc-surface: #ffffff;
	--jc-surface-2: #f8fafc;
	--jc-border: #e2e8f0;
	--jc-text: #0f172a;
	--jc-muted: #64748b;
	--jc-primary: #2563eb;
	--jc-primary-dark: #1d4ed8;
	--jc-green: #16a34a;
	--jc-amber: #d97706;
	--jc-red: #dc2626;
	--jc-blue: #0284c7;
	--jc-radius: 14px;
	--jc-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .06);
	--jc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body.jc-body {
	margin: 0;
	font-family: var(--jc-font);
	color: var(--jc-text);
	background: var(--jc-surface-2);
	-webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }

/* ---------------------------------------------------------- Auth screen */
.jc-auth {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 24px;
	background: radial-gradient(1200px 600px at 50% -10%, #1e3a8a 0%, var(--jc-bg) 60%);
}
.jc-auth__card {
	width: 100%;
	max-width: 400px;
	background: var(--jc-surface);
	border-radius: 20px;
	padding: 32px 28px;
	box-shadow: var(--jc-shadow);
}
.jc-auth__brand { text-align: center; margin-bottom: 22px; }
.jc-auth__logo { font-size: 26px; font-weight: 800; letter-spacing: -.5px; color: var(--jc-primary); }
.jc-auth__tag { margin: 6px 0 0; color: var(--jc-muted); font-size: 14px; }
.jc-auth__link { display: block; text-align: center; margin-top: 14px; color: var(--jc-primary); text-decoration: none; font-size: 14px; }
.jc-auth__link:hover { text-decoration: underline; }

.jc-form { display: flex; flex-direction: column; gap: 14px; }
.jc-form__hint { margin: 0; color: var(--jc-muted); font-size: 14px; }
.jc-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.jc-field input, .jc-modal input, .jc-modal select {
	border: 1px solid var(--jc-border);
	border-radius: 10px;
	padding: 12px 12px;
	font-size: 16px; /* >=16px prevents iOS focus zoom */
	font-weight: 400;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
	width: 100%;
}
.jc-field input:focus, .jc-modal input:focus, .jc-modal select:focus {
	border-color: var(--jc-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.jc-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.jc-check input { width: 16px; height: 16px; }

.jc-alert { border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.jc-alert--error { background: #fef2f2; color: var(--jc-red); }
.jc-alert--ok { background: #f0fdf4; color: var(--jc-green); }

/* --------------------------------------------------------------- Buttons */
.jc-btn {
	border: 1px solid transparent;
	border-radius: 10px;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	background: var(--jc-surface-2);
	color: var(--jc-text);
	transition: background .15s, transform .05s;
	touch-action: manipulation; /* kill 300ms tap delay */
	-webkit-tap-highlight-color: transparent;
}
.jc-btn:active { transform: translateY(1px); }
.jc-btn--primary { background: var(--jc-primary); color: #fff; }
.jc-btn--primary:hover { background: var(--jc-primary-dark); }
.jc-btn--ghost { background: transparent; border-color: rgba(255,255,255,.25); color: #fff; }
.jc-btn--ghost:hover { background: rgba(255,255,255,.12); }
.jc-btn--danger { background: #fef2f2; color: var(--jc-red); }
.jc-btn--danger:hover { background: #fee2e2; }
.jc-btn--sm { padding: 6px 10px; font-size: 13px; }
.jc-btn--block { width: 100%; }
.jc-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ----------------------------------------------------------------- Shell */
.jc-topbar { background: var(--jc-bg); color: #fff; }
.jc-topbar__inner {
	max-width: 920px; margin: 0 auto; padding: 14px 20px;
	display: flex; align-items: center; justify-content: space-between;
}
.jc-topbar__brand { font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
.jc-topbar__user { display: flex; align-items: center; gap: 12px; }
.jc-topbar__hello { font-size: 14px; opacity: .85; }

.jc-nav {
	position: sticky; top: 0; z-index: 10;
	background: var(--jc-surface); border-bottom: 1px solid var(--jc-border);
}
.jc-nav-toggle { display: none; } /* desktop: use the horizontal tabs */
.jc-tabs {
	display: flex; gap: 4px;
	padding: 6px; max-width: 920px; margin: 0 auto;
	overflow-x: auto;
}
.jc-tab {
	flex: 1 0 auto; border: none; background: transparent;
	padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
	color: var(--jc-muted); white-space: nowrap;
}
.jc-tab.is-active { background: var(--jc-primary); color: #fff; }

.jc-view { max-width: 920px; margin: 0 auto; padding: 18px 16px 80px; }
.jc-loading { text-align: center; color: var(--jc-muted); padding: 60px 0; }

.jc-section-head {
	display: flex; align-items: center; justify-content: space-between;
	margin: 4px 0 16px;
}
.jc-section-head h2 { margin: 0; font-size: 20px; }

/* Category dropdown (Sprzątanie: Pokoje / Urządzenia / Inne). */
.jc-cat-select {
	font-size: 18px; font-weight: 800; letter-spacing: -.3px; color: var(--jc-text);
	border: 1px solid var(--jc-border); border-radius: 10px;
	padding: 9px 12px; background: var(--jc-surface); max-width: 65%;
}
.jc-cat-select:focus { outline: none; border-color: var(--jc-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* ----------------------------------------------------------------- Cards */
.jc-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .jc-grid { grid-template-columns: 1fr 1fr; } }

.jc-card {
	background: var(--jc-surface); border: 1px solid var(--jc-border);
	border-radius: var(--jc-radius); box-shadow: var(--jc-shadow);
	padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.jc-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.jc-card__title { margin: 0; font-size: 17px; font-weight: 700; }
.jc-card__meta { color: var(--jc-muted); font-size: 13px; margin-top: 2px; }
.jc-card__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Accordion cleaning card: collapsed shows name/freq/status/%, click expands. */
.jc-acc { padding: 0; gap: 0; }
.jc-acc-head {
	width: 100%; border: none; background: transparent; cursor: pointer;
	display: flex; align-items: center; gap: 10px; padding: 14px 16px; text-align: left;
	touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.jc-acc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jc-acc-title { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.jc-acc-side { display: flex; align-items: center; gap: 8px; flex: none; }
.jc-acc-pct { font-size: 13px; font-weight: 800; color: var(--jc-amber); background: #fffbeb; padding: 3px 9px; border-radius: 999px; }
.jc-acc-caret { color: var(--jc-muted); transition: transform .2s; font-size: 14px; }
.jc-acc.is-open .jc-acc-caret { transform: rotate(180deg); }
.jc-acc-body { display: none; padding: 0 16px 16px; }
.jc-acc.is-open .jc-acc-body { display: flex; flex-direction: column; gap: 12px; }

.jc-badge {
	display: inline-flex; align-items: center; gap: 5px;
	font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.jc-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.jc-badge--scheduled { background: #eff6ff; color: var(--jc-blue); }
.jc-badge--ready { background: #f0fdf4; color: var(--jc-green); }
.jc-badge--overdue { background: #fef2f2; color: var(--jc-red); }
.jc-badge--in_progress { background: #fffbeb; color: var(--jc-amber); }
.jc-badge--trip-preparing { background: #fffbeb; color: var(--jc-amber); }
.jc-badge--trip-returned { background: #eff6ff; color: var(--jc-blue); }
.jc-badge--trip-completed { background: #f1f5f9; color: var(--jc-muted); }

.jc-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.jc-trip-section__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 6px; font-size: 14px; }
.jc-tag-custom { color: var(--jc-muted); font-style: italic; font-weight: 400; font-size: 12px; }

/* ---------------------------------------------------- Trip cards (3-col) */
.jc-trip-list { display: flex; flex-direction: column; gap: 16px; }
.jc-trip-card { width: 100%; }

/* 3 columns: the dashed "pre-departure" group (2 inner cols) + the post col.
   Packing is the priority, so freed space (missing stages) goes to it. */
.jc-trip-stages { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; margin: 6px 0 14px; }
.jc-trip-stages--full { grid-template-columns: 1fr; } /* no post stage: prep spans all 3 cols */
.jc-trip-prep {
	position: relative;
	display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
	border: 2px dashed var(--jc-border); border-radius: 12px;
	padding: 22px 12px 12px;
}
.jc-trip-prep--wide-pack { grid-template-columns: 3fr 1fr; } /* pack 3/4, pre 1/4 (no post) */
.jc-trip-prep--solo { grid-template-columns: 1fr; }          /* pack only */
.jc-trip-prep__label {
	grid-column: 1 / -1;
	position: absolute; top: -10px; left: 12px;
	background: var(--jc-surface); padding: 0 8px;
	font-size: 12px; font-weight: 700; color: var(--jc-muted); text-transform: uppercase; letter-spacing: .4px;
}
.jc-trip-col { background: var(--jc-surface-2); border-radius: 10px; padding: 10px; }
.jc-trip-col__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.jc-col-count { font-size: 12px; font-weight: 700; color: var(--jc-muted); font-variant-numeric: tabular-nums; }
.jc-trip-col .jc-tasklist li { background: var(--jc-surface); }
.jc-trip-col [data-trip-add] { margin-top: 8px; }

/* Locked stage: visible but dimmed and non-interactive. */
.jc-trip-col--locked { opacity: .6; }
.jc-trip-col--locked input, .jc-trip-col--locked button { pointer-events: none; }
.jc-trip-post--idle .jc-trip-col { opacity: .45; } /* stage 3 before departure: more greyed */

.jc-trip-details { border-top: 1px solid var(--jc-border); padding-top: 6px; }
.jc-trip-details summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 6px 0; }

.jc-recur { color: var(--jc-primary); font-weight: 700; }

/* ----------------------------------------------------------- Declutter */
.jc-subtabs { display: flex; gap: 8px; margin-bottom: 14px; }
.jc-subtab {
	border: 1px solid var(--jc-border); background: var(--jc-surface);
	border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--jc-muted);
}
.jc-subtab.is-active { background: var(--jc-text); color: #fff; border-color: var(--jc-text); }

.jc-decl-name { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }

/* Prominent progress: big count + big % pill + thick bar. */
.jc-decl-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 8px; }
.jc-decl-count { font-size: 30px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1; }
.jc-decl-count .done { color: var(--jc-green); }
.jc-decl-count small { font-size: 17px; font-weight: 600; color: var(--jc-muted); }
.jc-decl-pct {
	font-size: 22px; font-weight: 800; color: var(--jc-green);
	background: #f0fdf4; padding: 6px 14px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.jc-decl-pct.is-full { color: #fff; background: var(--jc-green); }
.jc-progress--lg { height: 14px; }

.jc-decl-stats { display: flex; gap: 8px; margin: 12px 0; }
.jc-decl-stat {
	flex: 1; display: flex; flex-direction: column; gap: 3px;
	background: var(--jc-surface-2); border-radius: 10px; padding: 8px 10px; min-width: 0;
}
.jc-decl-stat__label { font-size: 11px; color: var(--jc-muted); text-transform: uppercase; letter-spacing: .3px; }
.jc-decl-stat__val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.jc-decl-today { color: var(--jc-primary); font-size: 18px; }

.jc-throw { display: flex; gap: 10px; align-items: stretch; }
.jc-throw__input {
	flex: 1; border: 1px solid var(--jc-border); border-radius: 10px;
	padding: 12px; font-size: 18px; font-weight: 700; text-align: center;
}
.jc-plus {
	flex: none; width: 64px; border: none; border-radius: 12px;
	background: var(--jc-primary); color: #fff; font-size: 32px; font-weight: 700; line-height: 1;
	touch-action: manipulation;
}
.jc-plus:active { transform: translateY(1px); }

.jc-duration { display: flex; gap: 10px; }
.jc-duration label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }

.jc-modal__box--wide { max-width: 640px; }
.jc-stats-h { margin: 16px 0 8px; font-size: 15px; }

.jc-table-wrap { overflow-x: auto; }
.jc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.jc-table th, .jc-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--jc-border); white-space: nowrap; }
.jc-table th { color: var(--jc-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.jc-table td:nth-child(3) { font-variant-numeric: tabular-nums; }
.jc-table td .jc-mark-sq { margin-right: 8px; vertical-align: -2px; }

.jc-chart-wrap { overflow-x: auto; padding-bottom: 4px; }
.jc-chart-bar { fill: var(--jc-primary); }
.jc-chart-val { fill: var(--jc-muted); font-size: 10px; text-anchor: middle; font-weight: 700; }
.jc-chart-axis { fill: var(--jc-muted); font-size: 9px; text-anchor: middle; }

/* ------------------------------------------------------------ Calendar */
.jc-cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.jc-cal-head h2 { margin: 0; font-size: 20px; text-align: center; flex: 1; }
.jc-cal-head .jc-btn { min-width: 44px; font-size: 22px; line-height: 1; padding: 6px 12px; }

.jc-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.jc-cal-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--jc-muted); padding: 2px 0; }
.jc-cal-day {
	position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--jc-border);
	border-radius: 10px; background: var(--jc-surface); padding: 4px;
	display: flex; align-items: center; justify-content: center;
}
.jc-cal-day--empty { border: none; background: transparent; }
.jc-cal-num { position: absolute; top: 5px; left: 7px; font-size: 12px; font-weight: 600; color: var(--jc-muted); }
.jc-cal-day.is-today { border-color: var(--jc-primary); box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .18); }
.jc-cal-day.is-today .jc-cal-num { color: var(--jc-primary); }
.jc-cal-day.has-ev { cursor: pointer; }
.jc-cal-day.has-ev:hover { background: var(--jc-surface-2); }
.jc-cal-total { font-size: 20px; font-weight: 800; color: var(--jc-text); font-variant-numeric: tabular-nums; }
.jc-cal-squares { position: absolute; top: 4px; right: 4px; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.jc-cal-sq {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 14px; height: 14px; padding: 0 2px; border-radius: 3px;
	font-size: 9px; font-weight: 700; color: #fff; line-height: 1;
}
.jc-cal-daily { position: absolute; bottom: 6px; right: 7px; font-size: 30px; line-height: 1; color: var(--jc-green); font-weight: 900; }
.jc-cal-daily--legend { position: static; font-size: 15px; }

.jc-cal-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 16px 0 12px; font-size: 13px; color: var(--jc-muted); }
.jc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.jc-mark-sq { width: 14px; height: 14px; border-radius: 3px; flex: none; display: inline-block; }

.jc-cal-filters { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--jc-border); padding-top: 14px; }
.jc-cal-list li { gap: 10px; }

/* ------------------------------------------- Full-screen sheet */
.jc-modal.jc-modal--full { padding: 0; display: block; overflow: hidden; }
.jc-sheet { width: 100%; height: 100%; min-width: 0; background: var(--jc-surface); display: flex; flex-direction: column; }
.jc-sheet__head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
	border-bottom: 1px solid var(--jc-border); flex: none;
}
.jc-sheet__head h3 { margin: 0; font-size: 18px; }
.jc-sheet__close { border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; width: 44px; height: 44px; color: var(--jc-text); }
.jc-sheet__body { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Month accordion inside the sheet */
.jc-macc { border: 1px solid var(--jc-border); border-radius: 12px; overflow: hidden; min-width: 0; flex: none; }
.jc-macc-body { min-width: 0; }
.jc-macc-head { width: 100%; border: none; background: var(--jc-surface); cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; text-align: left; }
.jc-macc-title { flex: 1; font-size: 16px; font-weight: 800; }
.jc-macc-body { display: none; padding: 0 16px 16px; }
.jc-macc.is-open .jc-macc-body { display: block; }
.jc-macc.is-open .jc-acc-caret { transform: rotate(180deg); }

/* Daily status line chart */
.jc-dchart-grid { stroke: var(--jc-border); stroke-width: 1; }
.jc-dchart-ylab { fill: var(--jc-muted); font-size: 11px; text-anchor: end; }
.jc-dchart-xlab { fill: var(--jc-muted); font-size: 9px; text-anchor: middle; }
.jc-dchart-line { fill: none; stroke: var(--jc-primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }

.jc-progress { height: 8px; border-radius: 999px; background: var(--jc-border); overflow: hidden; }
.jc-progress__bar { height: 100%; background: var(--jc-green); transition: width .25s; }
.jc-progress-row { display: flex; align-items: center; gap: 10px; }
.jc-progress-row .jc-progress { flex: 1; }
.jc-progress__pct { font-size: 13px; font-weight: 700; color: var(--jc-muted); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

.jc-mark { flex: none; width: 22px; text-align: center; font-weight: 800; }
.jc-mark--ok { color: var(--jc-green); }
.jc-mark--no { color: var(--jc-red); }

.jc-tasklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.jc-tasklist li {
	display: flex; align-items: center; gap: 10px;
	padding: 8px 10px; background: var(--jc-surface-2); border-radius: 8px; font-size: 14px;
}
.jc-tasklist li.is-done .jc-task-name { text-decoration: line-through; color: var(--jc-muted); }
.jc-tasklist input[type=checkbox] { width: 18px; height: 18px; flex: none; }
.jc-tasklist .jc-task-grip { cursor: grab; color: var(--jc-muted); user-select: none; }
.jc-tasklist li.jc-dragging { opacity: .5; }
.jc-tasklist li .jc-task-name { flex: 1; }
.jc-task-mini { display: flex; gap: 4px; }

.jc-empty { text-align: center; color: var(--jc-muted); padding: 40px 16px; }

/* Row with a kebab menu: text gets full width, actions slide out below. */
.jc-tasklist--rows li.jc-row { flex-wrap: wrap; }
.jc-row .jc-task-name { flex: 1; min-width: 0; }
.jc-kebab {
	flex: none; border: none; background: transparent; cursor: pointer;
	font-size: 22px; line-height: 1; color: var(--jc-muted);
	width: 36px; height: 36px; border-radius: 8px;
	touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.jc-kebab:hover { background: var(--jc-border); }
.jc-row-actions { display: none; flex-basis: 100%; gap: 6px; flex-wrap: wrap; padding-top: 8px; margin-top: 8px; border-top: 1px dashed var(--jc-border); }
.jc-row.is-open .jc-row-actions { display: flex; }
.jc-row-actions .jc-btn { flex: 1 1 auto; }

.jc-stat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.jc-stat {
	flex: 1 1 90px; background: var(--jc-surface); border: 1px solid var(--jc-border);
	border-radius: 12px; padding: 12px; text-align: center;
}
.jc-stat__num { font-size: 22px; font-weight: 800; }
.jc-stat__label { font-size: 12px; color: var(--jc-muted); margin-top: 2px; }

.jc-history { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; color: var(--jc-muted); }
.jc-history li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--jc-border); }

/* ----------------------------------------------------------------- Toast */
.jc-toast {
	position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
	background: var(--jc-bg); color: #fff; padding: 12px 18px; border-radius: 12px;
	font-size: 14px; box-shadow: var(--jc-shadow); z-index: 100; max-width: 90vw;
}
.jc-toast--error { background: var(--jc-red); }

/* --------------------------------------------------------- Notification */
.jc-notify {
	display: flex; align-items: center; gap: 10px;
	background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
	border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px;
}
.jc-notify--overdue { background: #fef2f2; border-color: #fecaca; color: var(--jc-red); }
.jc-notify button { margin-left: auto; border: none; background: transparent; font-size: 18px; line-height: 1; color: inherit; align-self: flex-start; }
.jc-notify__list { display: flex; flex-direction: column; gap: 3px; }

/* Live counters — tabular figures keep the width from jumping each tick. */
.jc-timer, .jc-overdue { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ----------------------------------------------------------------- Modal */
.jc-modal {
	position: fixed; inset: 0; z-index: 200;
	background: rgba(15, 23, 42, .55);
	display: grid; place-items: center; padding: 16px;
}
.jc-modal[hidden] { display: none; }
.jc-modal__box {
	width: 100%; max-width: 420px; background: var(--jc-surface);
	border-radius: 18px; padding: 22px; box-shadow: var(--jc-shadow);
	max-height: 85vh; overflow-y: auto;
}
.jc-modal__box h3 { margin: 0 0 14px; font-size: 18px; }
.jc-modal__row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.jc-modal__row input, .jc-modal__row select { font-weight: 400; }
.jc-modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.jc-fab {
	position: fixed; right: 20px; bottom: 22px; z-index: 50;
	width: 56px; height: 56px; border-radius: 50%; border: none;
	background: var(--jc-primary); color: #fff; font-size: 28px; line-height: 1;
	box-shadow: var(--jc-shadow);
}

/* --------------------------------------------------------- Mobile (≤640px)
   99% of traffic is phones, so this is the primary layout. Bigger tap
   targets (≥44px), no iOS zoom, safe-area insets, bottom-sheet modals. */
@media (max-width: 640px) {
	/* Honor the notch / home indicator. */
	.jc-topbar__inner {
		padding: 12px 16px;
		padding-top: calc(12px + env(safe-area-inset-top));
	}
	/* Hamburger menu replaces the horizontal tab strip on phones. */
	.jc-nav-toggle {
		display: flex; align-items: center; gap: 10px; width: 100%;
		border: none; background: var(--jc-surface);
		padding: 14px 18px; font-size: 17px; font-weight: 700; color: var(--jc-text);
		padding-left: max(18px, env(safe-area-inset-left));
		padding-right: max(18px, env(safe-area-inset-right));
	}
	.jc-burger-bars { font-size: 20px; line-height: 1; }
	.jc-nav-current { flex: 1; text-align: left; }
	.jc-burger-caret { color: var(--jc-muted); transition: transform .2s; }
	.jc-nav.is-open .jc-burger-caret { transform: rotate(180deg); }

	.jc-tabs {
		display: none; flex-direction: column; gap: 4px; overflow: visible;
		max-width: none; padding: 6px 8px 10px;
		border-top: 1px solid var(--jc-border);
	}
	.jc-nav.is-open .jc-tabs { display: flex; }
	.jc-tab { flex: none; width: 100%; text-align: left; padding: 14px 16px; font-size: 16px; border-radius: 10px; }

	.jc-view {
		padding: 16px 14px;
		padding-bottom: calc(40px + env(safe-area-inset-bottom));
	}
	.jc-section-head h2 { font-size: 22px; }

	/* Comfortable touch targets. */
	.jc-btn { padding: 12px 16px; }
	.jc-btn--sm { padding: 10px 12px; font-size: 14px; min-height: 44px; }
	.jc-card__actions { gap: 8px; }
	.jc-card__actions .jc-btn--sm { min-width: 48px; }

	.jc-tasklist li { padding: 12px; font-size: 15px; gap: 12px; }
	.jc-tasklist input[type=checkbox] { width: 24px; height: 24px; }
	.jc-task-mini { gap: 6px; }
	.jc-task-mini .jc-btn--sm { min-width: 44px; padding: 10px 8px; }
	.jc-check input { width: 20px; height: 20px; }

	/* Keep the 3 stat tiles in one row; tighten gaps/padding to fit. */
	.jc-stat-row { gap: 8px; }
	.jc-stat { flex: 1 1 0; padding: 12px 8px; }
	.jc-stat__num { font-size: 20px; }
	.jc-stat__label { font-size: 11px; }

	/* Bottom-sheet style modal: easier to reach with the thumb. */
	.jc-modal { align-items: flex-end; padding: 0; }
	.jc-modal__box {
		max-width: 100%;
		border-radius: 20px 20px 0 0;
		padding: 22px 18px;
		padding-bottom: calc(22px + env(safe-area-inset-bottom));
	}
	.jc-modal__actions .jc-btn { min-height: 44px; }

	/* Toast sits above the home indicator. */
	.jc-toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

	/* Trip stages stack vertically; dashed group keeps its two parts together. */
	.jc-trip-stages { grid-template-columns: 1fr; gap: 12px; }
	.jc-trip-prep { grid-template-columns: 1fr; }

	/* Calendar: tighten the 7-column month grid for small screens. */
	.jc-cal-grid { gap: 4px; }
	.jc-cal-day { padding: 2px; border-radius: 8px; }
	.jc-cal-num { top: 3px; left: 4px; font-size: 10px; }
	.jc-cal-total { font-size: 15px; }
	.jc-cal-squares { top: 2px; right: 2px; gap: 1px; }
	.jc-cal-sq { min-width: 12px; height: 11px; font-size: 8px; border-radius: 2px; }
	.jc-cal-daily { bottom: 4px; right: 5px; font-size: 22px; }
	.jc-cal-wd { font-size: 10px; }
}

@media (max-width: 380px) {
	.jc-topbar__hello { display: none; } /* reclaim width on tiny phones */
}
