/* Follows the josiah.tools design system (master.css + round-robin), shared with invoice.bloomer.studio */

:root {
	--bg: #e8e8e8;
	--surface: #fff;
	--ink: #000;
	--muted: #555;
	--line: #000;
	--yellow: #ffeaa7;
	--green: #55efc4;
	--green-strong: #00b894;
	--red: #fab1a0;
	--red-strong: #e17055;
	--blue: #81ecec;
	--purple: #a29bfe;
	--gray: #dfe6e9;
	--btn: #eee;
	--btn-hover: #ddd;
	--btn-active: #ccc;
	--hover: #0000000d;
	--radius-section: 15px;
	--radius-control: 5px;
	--border: solid 2px var(--line);
	--shadow: 4px 4px 0 var(--line);
	--hatch: repeating-linear-gradient(135deg, #0000 0 5px, #00000026 5px 7px);
	--dots: radial-gradient(#00000040 1.2px, #0000 1.6px) 0 0 / 7px 7px;
}

* {
	box-sizing: border-box;
	font-family: "Poppins", sans-serif;
}
::selection {
	background: #000;
	color: #fff;
}

html {
	color-scheme: light;
}
body {
	background: var(--bg);
	color: var(--ink);
	margin: 0;
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
}

:focus-visible {
	outline: solid 3px var(--green-strong);
	outline-offset: 2px;
}

.main {
	margin: 44px auto 50px;
	width: 1500px;
	max-width: 100%;
	padding: 0 28px;
}
.main.narrow {
	width: 900px;
}

h1 {
	margin: 0;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}
h3.subtitle {
	margin: 4px 0 0;
	font-weight: 400;
	font-size: 16px;
	color: var(--muted);
}

.page-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 26px;
}
.page-head .actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.section {
	position: relative;
	margin-bottom: 30px;
	padding: 20px;
	border-radius: var(--radius-section);
	border: var(--border);
	background: var(--surface);
}
.section.yellow {
	background: var(--yellow);
}
.section.green {
	background: var(--green);
}
.section.red {
	background: var(--red);
}
.section.blue {
	background: var(--blue);
}
.section.lifted {
	box-shadow: var(--shadow);
}

.section-title {
	user-select: none;
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin: 0 0 7px;
	flex-wrap: wrap;
}
.section-title h2 {
	display: inline;
	font-size: 21px;
	font-weight: 500;
	margin: 0;
}
.section-title .title-sub {
	font-size: 14px;
	font-weight: 400;
}
.section-title .title-action {
	margin-left: auto;
}

/* Buttons */
button,
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 6px 12px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ink);
	border: var(--border);
	border-radius: var(--radius-control);
	background: var(--btn);
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
}
button:hover,
.btn:hover {
	background: var(--btn-hover);
}
button:active,
.btn:active {
	background: var(--btn-active);
}
button[disabled] {
	opacity: 0.7;
	cursor: not-allowed;
	background: var(--btn);
}
.btn.primary {
	background: var(--green);
	font-weight: 500;
}
.btn.primary:hover {
	background: #3ee0b4;
}
.btn.primary:active {
	background: #2fcfa3;
}
.btn.danger:hover {
	background: var(--red);
}
.btn.ghost {
	background: none;
	border-color: transparent;
}
.btn.ghost:hover {
	background: var(--hover);
}
.btn.icon {
	padding: 6px;
}
.btn svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
kbd {
	display: inline-block;
	min-width: 20px;
	padding: 0 5px;
	border: var(--border);
	border-bottom-width: 3px;
	border-radius: 4px;
	background: #fff;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	line-height: 1.4;
}

/* Fields: label and input share one bordered block, like round-robin's .input-block */
.fields {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 10px 2%;
}
.input-block {
	width: 49%;
	display: flex;
	flex-wrap: nowrap;
	border: var(--border);
	border-radius: var(--radius-control);
	background: #fff;
	overflow: hidden;
}
.input-block.full {
	width: 100%;
}
.input-block .input-label {
	flex: 0 0 40%;
	display: flex;
	align-items: center;
	padding: 6px 8px;
	font-size: 15px;
	border-right: var(--border);
	background: #fff;
	user-select: none;
}
.input-block.full .input-label {
	flex-basis: 24%;
}
.input-block input,
.input-block select {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	font-size: 15px;
	padding: 6px 8px;
	border: none;
	outline: none;
	background: #fff;
	color: var(--ink);
}
.input-block:focus-within {
	outline: solid 3px var(--green-strong);
	outline-offset: 1px;
}
.input-block textarea {
	width: 100%;
	font-size: 15px;
	padding: 8px;
	border: none;
	outline: none;
	resize: vertical;
	min-height: 64px;
	color: var(--ink);
	line-height: 1.5;
}
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
	min-height: 36px;
}

.hint {
	font-size: 13px;
	color: var(--muted);
	margin: 6px 0 0;
}

/* Checkboxes, from round-robin */
.checkbox-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
}
.checkbox-input {
	position: absolute;
	width: 0;
	height: 0;
	opacity: 0;
	pointer-events: none;
}
.checkbox-display {
	position: relative;
	flex: 0 0 22px;
	height: 22px;
	border: var(--border);
	border-radius: 4px;
	background: #fff;
}
.checkbox-label:hover .checkbox-display {
	background: #f0f0f0;
}
.checkbox-display::after {
	content: "";
	position: absolute;
	opacity: 0;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid #000;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.checkbox-input:checked + .checkbox-display {
	background: var(--green-strong);
}
.checkbox-input:checked + .checkbox-display::after {
	opacity: 1;
}
.checkbox-input:focus-visible + .checkbox-display {
	outline: solid 3px var(--green-strong);
	outline-offset: 2px;
}

/* Segmented buttons */
.filters {
	display: inline-flex;
	border: var(--border);
	border-radius: var(--radius-control);
	overflow: hidden;
	background: #fff;
}
.filters button {
	border: none;
	border-radius: 0;
	border-right: var(--border);
	background: #fff;
}
.filters button:last-child {
	border-right: none;
}
.filters button:hover {
	background: var(--btn-hover);
}
.filters button[aria-pressed="true"] {
	background: #000;
	color: #fff;
}

/* Pills */
.status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 1px 10px;
	border: var(--border);
	border-radius: 50px;
	font-size: 13px;
	font-weight: 500;
	background: #fff;
	white-space: nowrap;
}
.status.online {
	background: var(--green);
}
.status.idle {
	background: var(--yellow);
}
.status.offline {
	background: var(--gray);
}
.swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: var(--border);
	border-radius: 4px;
	flex-shrink: 0;
	vertical-align: -2px;
}

/* Toast */
.toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translate(-50%, 150%);
	padding: 10px 16px;
	background: #000;
	color: #fff;
	border-radius: var(--radius-control);
	font-size: 15px;
	transition: transform 0.2s;
	z-index: 100;
	pointer-events: none;
}
.toast.show {
	transform: translate(-50%, 0);
}

/* Dialog */
dialog {
	border: var(--border);
	border-radius: var(--radius-section);
	padding: 20px;
	width: 520px;
	max-width: calc(100% - 32px);
	background: var(--surface);
	box-shadow: var(--shadow);
}
dialog::backdrop {
	background: #0006;
}
dialog h2 {
	margin: 0 0 14px;
	font-size: 21px;
	font-weight: 500;
}
dialog .fields {
	margin-bottom: 18px;
}
dialog .dialog-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	flex-wrap: wrap;
}
dialog .dialog-actions .left {
	margin-right: auto;
}
dialog p {
	margin: 0 0 14px;
}

.color-picker {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	padding: 6px 8px;
	align-items: center;
}
.color-picker label {
	position: relative;
	cursor: pointer;
}
.color-picker input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.color-picker span {
	display: block;
	width: 26px;
	height: 26px;
	border: var(--border);
	border-radius: 6px;
}
.color-picker input:checked + span {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
}
.color-picker input:focus-visible + span {
	outline: solid 3px var(--green-strong);
	outline-offset: 4px;
}

/* ---------- Login ---------- */
.login-wrap {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.login {
	width: 400px;
	max-width: 100%;
	margin: 0;
	box-shadow: var(--shadow);
}
.login h1 {
	margin-bottom: 18px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.login .input-block {
	width: 100%;
	margin-bottom: 10px;
}
.login button {
	width: 100%;
	margin-top: 6px;
}
.form-error {
	min-height: 1.5em;
	margin: 8px 0 0;
	font-size: 14px;
	color: #b3261e;
}

/* ---------- Sidebar shell ---------- */
body.with-nav {
	display: grid;
	grid-template-columns: 236px minmax(0, 1fr);
	min-height: 100vh;
}
.sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	display: flex;
	flex-direction: column;
	padding: 40px 14px 20px;
	border-right: var(--border);
	background: var(--bg);
	z-index: 20;
}
.brand {
	display: flex;
	align-items: center;
	gap: 9px;
	font-weight: 700;
	font-size: 19px;
	text-decoration: none;
	padding: 0 10px 22px;
	letter-spacing: -0.01em;
}
.logo {
	width: 26px;
	height: 26px;
	flex-shrink: 0;
}
.nav-links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.nav-links a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 10px;
	border: solid 2px transparent;
	border-radius: var(--radius-control);
	text-decoration: none;
	font-weight: 500;
	white-space: nowrap;
}
.nav-links a:hover {
	background: var(--hover);
}
.nav-links a[aria-current="page"] {
	border-color: var(--line);
}
.nav-links a.nav-yellow[aria-current="page"] {
	background: var(--yellow);
}
.nav-links a.nav-green[aria-current="page"] {
	background: var(--green);
}
.nav-links a.nav-red[aria-current="page"] {
	background: var(--red);
}
.nav-links a.nav-blue[aria-current="page"] {
	background: var(--blue);
}
.nav-links svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.nav-logout {
	justify-content: flex-start;
	padding-left: 10px;
	font-weight: 500;
}

/* "Now" timer card at the bottom of the sidebar */
.now-card {
	margin-top: auto;
	margin-bottom: 12px;
	padding: 12px;
	border: var(--border);
	border-radius: 12px;
	background: #fff;
}
.now-card.running {
	background: var(--green);
	box-shadow: var(--shadow);
}
.now-card .now-label {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	font-weight: 500;
	margin: 0 0 2px;
}
.now-card .pulse {
	width: 10px;
	height: 10px;
	border: var(--border);
	border-radius: 50%;
	background: var(--red-strong);
	animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
	50% {
		transform: scale(0.6);
	}
}
.now-card .now-time {
	font-size: 30px;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
}
.now-card .now-what {
	margin: 4px 0 10px;
	font-size: 14px;
	line-height: 1.35;
	overflow-wrap: anywhere;
}
.now-card .now-what strong {
	font-weight: 600;
	display: block;
}
.now-card button {
	width: 100%;
}
.now-card.idle-card p {
	margin: 0 0 10px;
	font-size: 14px;
	color: var(--muted);
	line-height: 1.4;
}

/* ---------- Day header ---------- */
.day-nav {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.day-nav input[type="date"] {
	font-size: 15px;
	padding: 4px 8px;
	border: var(--border);
	border-radius: var(--radius-control);
	background: #fff;
}
.day-title {
	display: flex;
	align-items: baseline;
	gap: 14px;
	flex-wrap: wrap;
}
.day-title .weekday {
	font-size: 44px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.03em;
}
.day-title .date {
	font-size: 20px;
	font-weight: 500;
	color: var(--muted);
}

.stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 22px;
}
.stat {
	padding: 12px 16px;
	border: var(--border);
	border-radius: 12px;
	background: #fff;
}
.stat .value {
	display: block;
	font-size: 26px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	line-height: 1.2;
}
.stat .label {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	color: var(--muted);
}

/* ---------- Timeline ---------- */
.timeline-section {
	padding: 0;
	overflow: hidden;
}
.tl-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding: 12px 16px;
	border-bottom: var(--border);
}
.tl-toolbar .spacer {
	flex: 1;
}
.device-chips {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
.device-chip {
	padding: 2px 12px 2px 6px;
	border-radius: 50px;
	font-size: 14px;
	font-weight: 500;
	background: #fff;
}
.device-chip .dot {
	width: 14px;
	height: 14px;
	border: var(--border);
	border-radius: 50%;
	background: var(--gray);
}
.device-chip[aria-pressed="true"] .dot {
	background: var(--device-color, var(--green));
}
.device-chip[aria-pressed="false"] {
	color: var(--muted);
	border-style: dashed;
}
.legend {
	display: flex;
	gap: 12px;
	font-size: 13px;
	color: var(--muted);
	flex-wrap: wrap;
}
.legend span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.legend i {
	display: inline-block;
	width: 18px;
	height: 12px;
	border: var(--border);
	border-radius: 3px;
}
.legend .k-active {
	background: var(--green);
}
.legend .k-idle {
	background: var(--hatch), var(--yellow);
}
.legend .k-locked {
	background: var(--dots), var(--gray);
}

.tl {
	display: grid;
	grid-template-columns: 148px minmax(0, 1fr);
	position: relative;
	user-select: none;
}
.tl-heads {
	border-right: var(--border);
	background: var(--bg);
	z-index: 3;
}
.tl-scroll {
	overflow-x: auto;
	overflow-y: hidden;
	position: relative;
	scrollbar-width: thin;
	scrollbar-color: #000 #0000;
}
.tl-canvas {
	position: relative;
	min-width: 100%;
	cursor: crosshair;
}

/* Rows share heights between the header column and the canvas */
.tl-row {
	position: relative;
	height: var(--h);
	border-bottom: solid 1px #0000001f;
}
.tl-row.r-ruler {
	--h: 36px;
	border-bottom: var(--border);
	background: #fff;
}
.tl-row.r-logged {
	--h: 44px;
	background: #fafafa;
}
.tl-row.r-device {
	--h: 28px;
	background: var(--bg);
	border-top: var(--border);
	border-bottom: var(--border);
}
.tl-row.r-activity {
	--h: 50px;
}
.tl-row.r-apps {
	--h: 46px;
}
.tl-row.r-open {
	--h: 20px;
	border-bottom: none;
}
.tl-row.r-open-toggle {
	--h: 24px;
	border-bottom: none;
}
.tl-row.r-end {
	--h: 8px;
	border-bottom: none;
}

.tl-heads .tl-row {
	display: flex;
	align-items: center;
	padding: 0 12px;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.tl-heads .r-device {
	font-weight: 600;
	gap: 7px;
}
.tl-heads .r-device .dot {
	width: 12px;
	height: 12px;
	border: var(--border);
	border-radius: 50%;
	flex-shrink: 0;
}
.tl-heads .r-open {
	font-size: 11px;
	font-weight: 400;
	color: var(--muted);
	padding-left: 20px;
}
.tl-heads .r-open-toggle button {
	padding: 0 6px;
	font-size: 12px;
	border-width: 0;
	background: none;
	color: var(--muted);
	gap: 4px;
}
.tl-heads .r-open-toggle button:hover {
	color: var(--ink);
	background: var(--hover);
}
.tl-heads .track-tag {
	display: inline-block;
	min-width: 28px;
	margin-right: 8px;
	padding: 0 4px;
	border: var(--border);
	border-radius: 4px;
	font-size: 11px;
	font-weight: 700;
	text-align: center;
	background: #fff;
}

/* Ruler */
.tick {
	position: absolute;
	bottom: 0;
	width: 0;
	border-left: solid 1px #000;
	height: 6px;
}
.tick.major {
	height: 12px;
	border-left-width: 2px;
}
.tick-label {
	position: absolute;
	top: 3px;
	transform: translateX(-50%);
	font-size: 12px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	pointer-events: none;
}
.gridline {
	position: absolute;
	top: 36px;
	bottom: 0;
	border-left: dashed 1px #0000001a;
	pointer-events: none;
}

/* Clips */
.clip {
	position: absolute;
	top: 5px;
	bottom: 5px;
	min-width: 2px;
	border: var(--border);
	border-radius: 6px;
	overflow: hidden;
	padding: 0 6px;
	font-size: 12px;
	line-height: 1.25;
	display: flex;
	flex-direction: column;
	justify-content: center;
	white-space: nowrap;
	cursor: pointer;
}
.clip.tiny {
	border-width: 1px;
	border-radius: 2px;
	padding: 0;
}
.clip strong,
.clip span {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}
.clip strong {
	font-weight: 600;
}
.clip span {
	font-size: 11px;
}
.clip:hover {
	z-index: 2;
	box-shadow: 2px 2px 0 #000;
}
.r-open .clip {
	top: 3px;
	bottom: 3px;
	border-width: 1.5px;
	border-radius: 4px;
	padding: 0;
}
.r-logged .clip {
	top: 6px;
	bottom: 6px;
	border-radius: 8px;
}
.r-logged .clip.running {
	border-style: dashed;
	border-right-width: 0;
	border-radius: 8px 0 0 8px;
}

/* Presence bands */
.band {
	position: absolute;
	top: 6px;
	bottom: 6px;
	border: var(--border);
	border-radius: 6px;
	min-width: 2px;
}
.band.active {
	background: var(--green);
}
.band.idle {
	background: var(--hatch), var(--yellow);
}
.band.locked {
	background: var(--dots), var(--gray);
}
.wave {
	position: absolute;
	inset: 8px 0 8px 0;
	pointer-events: none;
}
.wave rect {
	fill: #000;
	opacity: 0.55;
}

/* Overlays */
.tl-selection {
	position: absolute;
	top: 0;
	bottom: 0;
	background: #81ecec4d;
	border-left: dashed 2px #000;
	border-right: dashed 2px #000;
	pointer-events: none;
	z-index: 4;
}
.tl-selection[hidden] {
	display: none;
}
.sel-handle {
	position: absolute;
	top: 0;
	width: 22px;
	height: 26px;
	margin-left: -11px;
	border: var(--border);
	border-radius: 5px;
	background: var(--blue);
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: ew-resize;
	pointer-events: auto;
	z-index: 6;
}
.sel-handle.in {
	left: 0;
	border-radius: 5px 5px 5px 0;
}
.sel-handle.out {
	left: 100%;
	border-radius: 5px 5px 0 5px;
}
.tl-playhead {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 0;
	border-left: solid 2px var(--red-strong);
	pointer-events: none;
	z-index: 5;
}
.tl-playhead::before {
	content: "";
	position: absolute;
	top: 0;
	left: -8px;
	border: solid 7px transparent;
	border-top: solid 10px var(--red-strong);
}
.tl-hover {
	position: absolute;
	top: 0;
	bottom: 0;
	border-left: dashed 1px #000;
	pointer-events: none;
	z-index: 5;
}
.tl-hover span {
	position: absolute;
	top: 8px;
	left: 4px;
	padding: 0 5px;
	background: #000;
	color: #fff;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.tl-empty {
	position: absolute;
	left: 50%;
	top: 55%;
	transform: translate(-50%, -50%);
	text-align: center;
	padding: 16px 20px;
	border: var(--border);
	border-radius: 12px;
	background: #fff;
	z-index: 3;
	max-width: 420px;
	cursor: default;
}
.tl-empty p {
	margin: 0 0 10px;
}
.tl-empty p:last-child {
	margin: 0;
}

.tooltip {
	position: fixed;
	z-index: 50;
	max-width: 340px;
	padding: 8px 11px;
	background: #000;
	color: #fff;
	border-radius: 7px;
	font-size: 13px;
	line-height: 1.4;
	pointer-events: none;
	overflow-wrap: anywhere;
}
.tooltip strong {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
}
.tooltip .swatch {
	border-color: #fff;
}
.tooltip .meta {
	color: #ccc;
	font-variant-numeric: tabular-nums;
}

.tl-help {
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
	padding: 10px 16px;
	border-top: var(--border);
	font-size: 13px;
	color: var(--muted);
}

/* ---------- Inspector + sessions ---------- */
.below {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	gap: 26px;
	align-items: start;
}
.inspector.has-selection {
	box-shadow: var(--shadow);
	background: #fff;
}
.inspector .empty {
	color: var(--muted);
	margin: 6px 0 0;
	line-height: 1.6;
}
.range-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 6px 0 16px;
}
.range-row input[type="time"] {
	font-size: 18px;
	font-weight: 600;
	padding: 2px 8px;
	border: var(--border);
	border-radius: var(--radius-control);
	font-variant-numeric: tabular-nums;
}
.range-row .arrow {
	font-weight: 700;
}
.range-row .span-length {
	color: var(--muted);
}
.meter {
	display: flex;
	height: 26px;
	border: var(--border);
	border-radius: 7px;
	overflow: hidden;
	margin-bottom: 8px;
	background: var(--dots), var(--gray);
}
.meter > div {
	height: 100%;
	border-right: var(--border);
}
.meter > div:last-child {
	border-right: none;
}
.meter .m-active {
	background: var(--green);
}
.meter .m-idle {
	background: var(--hatch), var(--yellow);
}
.meter-legend {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	font-size: 14px;
	margin-bottom: 16px;
}
.meter-legend span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.meter-legend b {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.meter-legend i {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: var(--border);
	border-radius: 3px;
}

.insp-block {
	margin-bottom: 16px;
}
.insp-block h3 {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 6px;
}
.breakdown {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.breakdown li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 64px;
	gap: 10px;
	align-items: center;
	font-size: 14px;
}
.breakdown .bar-wrap {
	position: relative;
	min-width: 0;
	padding: 3px 8px;
	border-radius: 5px;
	overflow: hidden;
}
.breakdown .bar {
	position: absolute;
	inset: 0 auto 0 0;
	border: var(--border);
	border-radius: 5px;
}
.breakdown .bar-text {
	position: relative;
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.breakdown .bar-text small {
	color: var(--muted);
	font-size: 12px;
	margin-left: 4px;
}
.breakdown .dur {
	text-align: right;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.gap-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.gap-item {
	padding: 6px 10px;
	border: var(--border);
	border-radius: 7px;
	font-size: 14px;
	background: var(--hatch), var(--yellow);
}
.gap-item.off {
	background: var(--dots), var(--gray);
}
.gap-item .checkbox-label {
	align-items: flex-start;
}
.gap-item .gap-text {
	display: flex;
	flex-direction: column;
	line-height: 1.35;
}
.gap-item .gap-text b {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.gap-item .gap-text small {
	font-size: 12.5px;
	color: #333;
}
.warn {
	padding: 8px 12px;
	border: var(--border);
	border-radius: 7px;
	background: var(--red);
	font-size: 14px;
	margin-bottom: 14px;
}

.log-form {
	border-top: var(--border);
	padding-top: 16px;
	margin-top: 4px;
}
.log-form .fields {
	margin-bottom: 12px;
}
.log-total {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}
.log-total .big {
	font-size: 36px;
	font-weight: 700;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}
.log-total .btn {
	margin-left: auto;
	font-size: 17px;
	padding: 8px 18px;
}

.sessions {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.session {
	display: grid;
	grid-template-columns: 10px minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	width: 100%;
	padding: 8px 12px 8px 8px;
	text-align: left;
	background: #fff;
	white-space: normal;
}
.session .stripe {
	align-self: stretch;
	border: var(--border);
	border-radius: 4px;
}
.session .what {
	min-width: 0;
	line-height: 1.35;
}
.session .what strong,
.session .what span {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.session .what strong {
	font-weight: 600;
}
.session .what span {
	font-size: 13px;
	color: var(--muted);
}
.session .dur {
	text-align: right;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1.3;
}
.session .dur small {
	display: block;
	font-weight: 400;
	font-size: 12px;
	color: var(--muted);
}
.session.logged {
	background: #f4f4f4;
}
.session.logged .what strong::after {
	content: " (logged)";
	font-weight: 400;
	color: var(--muted);
	font-size: 13px;
}

/* ---------- Log page ---------- */
.week-totals {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.week-total {
	display: grid;
	grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 96px;
	gap: 14px;
	align-items: center;
	font-size: 15px;
}
.week-total .name {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.week-total .track {
	height: 22px;
}
.week-total .fill {
	height: 100%;
	border: var(--border);
	border-radius: 5px;
	min-width: 4px;
}
.week-total .hours {
	text-align: right;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.day-group {
	padding: 0;
	overflow: hidden;
}
.day-group-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 10px 20px;
	border-bottom: var(--border);
	background: var(--yellow);
	font-weight: 600;
}
.day-group-head .sum {
	font-variant-numeric: tabular-nums;
}
.entry-row {
	display: grid;
	grid-template-columns: 14px minmax(0, 1fr) 150px 80px 84px;
	gap: 14px;
	align-items: center;
	padding: 10px 20px;
	border-bottom: solid 1px #0000001f;
}
.entry-row:last-child {
	border-bottom: none;
}
.entry-row .stripe {
	height: 34px;
	border: var(--border);
	border-radius: 4px;
}
.entry-row .what {
	min-width: 0;
}
.entry-row .what strong,
.entry-row .what span {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.entry-row .what strong {
	font-weight: 500;
}
.entry-row .what span {
	font-size: 14px;
	color: var(--muted);
}
.entry-row .when {
	font-size: 14px;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}
.entry-row .dur {
	text-align: right;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.entry-row .row-actions {
	display: flex;
	gap: 2px;
	justify-content: flex-end;
}
.list-empty {
	padding: 40px 20px;
	text-align: center;
}
.list-empty p {
	margin: 0 0 14px;
}

/* ---------- Projects ---------- */
.project-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 18px;
}
.project-card {
	margin: 0;
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	text-align: left;
	align-items: stretch;
	white-space: normal;
	border-radius: var(--radius-section);
	font-size: 15px;
	min-height: 150px;
}
.project-card:hover {
	box-shadow: var(--shadow);
	transform: translate(-2px, -2px);
}
.project-card:active {
	box-shadow: none;
	transform: none;
}
.project-card .p-name {
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
	overflow-wrap: anywhere;
}
.project-card .p-client {
	font-size: 14px;
}
.project-card .p-hours {
	margin-top: auto;
	padding-top: 14px;
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}
.project-card .p-meta {
	font-size: 13px;
}
.project-card.archived {
	opacity: 0.6;
	border-style: dashed;
}

/* ---------- Settings ---------- */
.device-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 10px 0 14px;
}
.device-row {
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr) auto auto;
	gap: 12px;
	align-items: center;
	padding: 10px 14px;
	border: var(--border);
	border-radius: 10px;
	background: #fff;
}
.device-row .dot {
	width: 18px;
	height: 18px;
	border: var(--border);
	border-radius: 50%;
}
.device-row .what strong {
	display: block;
	font-weight: 600;
}
.device-row .what span {
	display: block;
	font-size: 13px;
	color: var(--muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.device-row .row-actions {
	display: flex;
	gap: 4px;
}
.pair-code {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: var(--border);
	border-radius: var(--radius-control);
	background: var(--yellow);
	font-family: ui-monospace, Consolas, monospace;
	font-size: 13px;
	word-break: break-all;
	margin: 0 0 12px;
	user-select: all;
}
.steps {
	margin: 0 0 14px;
	padding-left: 22px;
	line-height: 1.6;
}
.chip-input {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	padding: 6px;
	border: var(--border);
	border-radius: var(--radius-control);
	background: #fff;
}
.chip-input input {
	flex: 1 1 160px;
	border: none;
	outline: none;
	font-size: 15px;
	padding: 4px;
}
.chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 1px 4px 1px 10px;
	border: var(--border);
	border-radius: 50px;
	background: var(--red);
	font-size: 14px;
}
.chip button {
	padding: 0;
	border: none;
	background: none;
}
.chip button svg {
	width: 16px;
	height: 16px;
	transition: transform 0.1s;
}
.chip button:hover svg {
	transform: rotate(-90deg);
}

/* ---------- Responsive ---------- */
@media only screen and (max-width: 1180px) {
	.below {
		grid-template-columns: minmax(0, 1fr);
	}
	.stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media only screen and (max-width: 940px) {
	body.with-nav {
		display: block;
	}
	.sidebar {
		position: static;
		height: auto;
		flex-direction: row;
		align-items: center;
		flex-wrap: wrap;
		gap: 8px;
		padding: 10px 16px;
		border-right: none;
		border-bottom: var(--border);
	}
	.brand {
		padding: 0 8px 0 0;
		font-size: 16px;
	}
	.nav-links {
		flex-direction: row;
		gap: 4px;
		overflow-x: auto;
	}
	.nav-links a {
		padding: 5px 9px;
	}
	.now-card {
		order: 10;
		width: 100%;
		margin: 6px 0 0;
		display: grid;
		grid-template-columns: auto minmax(0, 1fr) auto;
		align-items: center;
		gap: 12px;
	}
	.now-card .now-what {
		margin: 0;
	}
	.now-card button {
		width: auto;
	}
	.nav-logout {
		margin-left: auto;
	}
	.main {
		padding: 0 16px;
		margin-top: 26px;
	}
	.day-title .weekday {
		font-size: 34px;
	}
	.entry-row {
		grid-template-columns: 14px minmax(0, 1fr) auto;
		grid-template-areas: "stripe what dur" "stripe when actions";
		gap: 2px 12px;
	}
	.entry-row .stripe {
		grid-area: stripe;
		height: 100%;
	}
	.entry-row .what {
		grid-area: what;
	}
	.entry-row .when {
		grid-area: when;
	}
	.entry-row .dur {
		grid-area: dur;
	}
	.entry-row .row-actions {
		grid-area: actions;
	}
}

@media only screen and (max-width: 640px) {
	.brand span,
	.nav-links svg {
		display: none;
	}
	.tl {
		grid-template-columns: 74px minmax(0, 1fr);
	}
	.tl-heads .tl-row {
		padding: 0 6px;
		font-size: 11px;
	}
	.tl-heads .track-tag {
		display: none;
	}
	.section {
		padding: 16px;
	}
	.input-block,
	.input-block.full {
		width: 100%;
	}
	.input-block .input-label,
	.input-block.full .input-label {
		flex-basis: 34%;
	}
	.stats {
		gap: 10px;
	}
	.stat .value {
		font-size: 21px;
	}
	.week-total {
		grid-template-columns: minmax(0, 1fr) 70px;
	}
	.week-total .track {
		grid-column: 1 / -1;
		order: 3;
	}
	.log-total .btn {
		margin-left: 0;
		width: 100%;
	}
	.tl-help {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation: none !important;
	}
}

/* ---------- Timer dialogs ---------- */
.now-card .now-edit {
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: none;
	text-align: left;
	white-space: normal;
	font-size: 14px;
	line-height: 1.35;
	margin: 4px 0 10px;
}
.now-card .now-edit:hover {
	background: none;
	text-decoration: underline;
}
.dialog-note {
	margin: -8px 0 16px;
}
.option-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 14px;
}
.checkbox-label.radio .checkbox-display {
	border-radius: 50%;
}
.checkbox-label.radio .checkbox-display::after {
	left: 5px;
	top: 5px;
	width: 8px;
	height: 8px;
	border: none;
	border-radius: 50%;
	background: #000;
	transform: none;
}
.stop-summary {
	padding: 8px 12px;
	border: var(--border);
	border-radius: 7px;
	background: var(--yellow);
	font-size: 15px;
}

.swatch.k-active {
	background: var(--green);
}
.swatch.k-idle {
	background: var(--hatch), var(--yellow);
}
.swatch.k-logged {
	background: var(--purple);
}
.swatch.k-unlogged {
	background: var(--red);
}
.filters button svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
}
.filters button {
	padding: 4px 10px;
}
dialog .extra-actions {
	justify-content: flex-start;
	margin-top: 14px;
	padding-top: 14px;
	border-top: var(--border);
}
i.k-active {
	background: var(--green);
}
i.k-idle {
	background: var(--hatch), var(--yellow);
}
i.k-locked {
	background: var(--dots), var(--gray);
}
.tl-scroll.panning,
.tl-scroll.panning .tl-canvas,
.tl-scroll.panning .clip {
	cursor: grabbing;
}

/* ---------- Project page ---------- */
a.project-card {
	text-decoration: none;
	color: var(--ink);
}
.project-card .p-money {
	display: block;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0;
	margin-top: 4px;
}
.back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	color: var(--muted);
}
.back-link::before {
	content: "";
	width: 7px;
	height: 7px;
	border-left: solid 2px currentColor;
	border-bottom: solid 2px currentColor;
	transform: rotate(45deg);
}
.back-link:hover {
	color: var(--ink);
}
.project-title {
	display: flex;
	align-items: center;
	gap: 12px;
	overflow-wrap: anywhere;
}
.swatch.big {
	width: 26px;
	height: 26px;
	border-radius: 7px;
}

.day-chart {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 10px;
	height: 190px;
	margin-top: 10px;
	padding-bottom: 22px;
}
.chart-scale {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	font-size: 12px;
	color: var(--muted);
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.chart-bars {
	display: flex;
	align-items: flex-end;
	gap: 2px;
	border-bottom: var(--border);
	border-top: dashed 1px #0000002e;
}
.chart-col {
	position: relative;
	flex: 1;
	height: 100%;
	display: flex;
	align-items: flex-end;
	border-radius: 4px 4px 0 0;
}
.chart-col:hover {
	background: var(--hover);
}
.chart-bar {
	display: block;
	width: 100%;
	min-height: 0;
	border: var(--border);
	border-bottom: none;
	border-radius: 4px 4px 0 0;
}
.chart-col.empty .chart-bar {
	border: none;
}
.chart-tick {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	font-size: 12px;
	color: var(--muted);
	white-space: nowrap;
}
.sum-money {
	margin-left: 12px;
	font-weight: 500;
}
.entry-row.no-stripe {
	grid-template-columns: minmax(0, 1fr) 150px 80px 44px;
}
@media only screen and (max-width: 940px) {
	.entry-row.no-stripe {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "what dur" "when actions";
	}
}
.week-total .hours small {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: var(--muted);
}
