/*
 * J59 Hub
 * Junction59 brand: Arial only, gradient pairs as accents, black and white as the base.
 */

:root {
	--j59-black: #000000;
	--j59-white: #FFFFFF;
	--j59-ink: #101114;
	--j59-body: #3A3D45;
	--j59-muted: #6B7280;
	--j59-line: #E3E5E9;
	--j59-bg: #F4F5F7;
	--j59-lime-a: #C6EC38;
	--j59-lime-b: #49EEA6;
	--j59-cyan-a: #01C5FF;
	--j59-cyan-b: #007EFF;
	--j59-magenta-a: #E70D70;
	--j59-magenta-b: #FA0ECB;
	--j59-purple-a: #CC51FF;
	--j59-purple-b: #7400EA;
	--j59-radius: 10px;
	--j59-shadow: 0 1px 2px rgba(16, 17, 20, 0.06), 0 6px 16px rgba(16, 17, 20, 0.06);
}

* { box-sizing: border-box; }

/*
 * Always reserve the scrollbar's width, whether or not the page needs one.
 *
 * Without this, a short page has no scrollbar and a long one does, the viewport
 * changes width between them, and every centred container shifts sideways by
 * half a scrollbar. That is the small sideways jog in the top bar when you move
 * between the hub's own pages: nothing in the bar changed, the page under it
 * got shorter.
 */
html { scrollbar-gutter: stable; }

html, body { margin: 0; padding: 0; }

.j59-body {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--j59-body);
	background: var(--j59-bg);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--j59-ink); margin: 0 0 8px; font-weight: bold; }
h1 { font-size: 26px; letter-spacing: -0.3px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
a { color: var(--j59-cyan-b); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .j59-code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; background: #EEF0F3; padding: 2px 6px; border-radius: 4px; color: var(--j59-ink); }

/* Top bar ------------------------------------------------------------ */

.j59-topbar { background: var(--j59-black); color: var(--j59-white); }
.j59-topbar-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
	height: 60px;
	display: flex;
	align-items: center;
	gap: 24px;
}
.j59-topbar-accent { height: 3px; background: linear-gradient(90deg, var(--j59-lime-a) 0%, var(--j59-cyan-a) 33%, var(--j59-magenta-a) 66%, var(--j59-purple-a) 100%); }

.j59-brand { display: flex; align-items: center; gap: 12px; color: var(--j59-white); text-decoration: none; }
.j59-brand:hover { text-decoration: none; }
.j59-brand img { height: 24px; width: auto; display: block; }
.j59-brand-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.25); }
.j59-brand-name { font-size: 14px; letter-spacing: 0.4px; text-transform: uppercase; color: rgba(255,255,255,0.85); }

.j59-nav { display: flex; gap: 4px; margin-left: 8px; }
.j59-nav a {
	color: rgba(255,255,255,0.7);
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 14px;
}
.j59-nav a:hover { color: var(--j59-white); background: rgba(255,255,255,0.08); text-decoration: none; }
.j59-nav a.is-active { color: var(--j59-black); background: var(--j59-lime-a); }

.j59-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.j59-user { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.j59-user-name { color: rgba(255,255,255,0.85); }
.j59-signout { color: rgba(255,255,255,0.55); }
.j59-signout:hover { color: var(--j59-white); }

/* Layout ------------------------------------------------------------- */

.j59-main { padding: 28px 0 60px; }
.j59-container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.j59-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 20px; }
.j59-page-sub { color: var(--j59-muted); margin: 0; max-width: 70ch; }
.j59-crumb { font-size: 12px; color: var(--j59-muted); margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.j59-crumb span { margin: 0 6px; }

.j59-context-pill {
	color: var(--j59-black);
	font-weight: bold;
	font-size: 13px;
	padding: 6px 14px;
	border-radius: 999px;
	white-space: nowrap;
}

.j59-subnav { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--j59-line); }
.j59-subnav a { padding: 10px 14px; color: var(--j59-muted); font-size: 14px; border-bottom: 2px solid transparent; }
.j59-subnav a:hover { color: var(--j59-ink); text-decoration: none; }
.j59-subnav a.is-active { color: var(--j59-ink); border-bottom-color: var(--j59-cyan-b); font-weight: bold; }

/* Cards -------------------------------------------------------------- */

.j59-card {
	background: var(--j59-white);
	border: 1px solid var(--j59-line);
	border-radius: var(--j59-radius);
	padding: 20px 22px;
	margin-bottom: 20px;
	box-shadow: var(--j59-shadow);
}
.j59-card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.j59-card-head h2 { margin: 0; }
.j59-empty { text-align: center; padding: 44px 22px; }
.j59-panel { border: 1px dashed var(--j59-line); border-radius: 8px; padding: 18px; margin-bottom: 18px; background: #FAFBFC; }
.j59-subhead { margin: 18px 0 8px; color: var(--j59-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.6px; }

/* Hero ---------------------------------------------------------------- */

.j59-hero {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}
.j59-hero-text { min-width: 0; }
.j59-hero-meta { text-align: right; white-space: nowrap; }
.j59-hero-count {
	display: block;
	font-size: 34px;
	line-height: 1;
	font-weight: bold;
	color: var(--j59-ink);
	font-variant-numeric: tabular-nums;
}
.j59-hero-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--j59-muted); }

/* App grid ------------------------------------------------------------ */

.j59-app-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 16px;
	align-items: stretch;
	margin-bottom: 28px;
}

.j59-app-card {
	display: flex;
	flex-direction: column;
	background: var(--j59-white);
	border: 1px solid var(--j59-line);
	border-radius: var(--j59-radius);
	overflow: hidden;
	box-shadow: var(--j59-shadow);
	transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
	color: inherit;
	min-height: 100%;
}
.j59-app-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(16,17,20,0.08), 0 12px 28px rgba(16,17,20,0.10);
	text-decoration: none;
}
.j59-app-card:focus-visible { outline: 3px solid var(--j59-cyan-b); outline-offset: 2px; }
.j59-app-accent { display: block; height: 4px; flex: none; }

.j59-app-inner { display: flex; gap: 14px; padding: 16px 18px 18px; flex: 1 1 auto; }

.j59-app-icon {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.j59-app-icon-ghost { background: #EEF0F3; color: var(--j59-muted); }
.j59-svg { display: block; }

.j59-app-text { display: flex; flex-direction: column; min-width: 0; }
.j59-app-eyebrow {
	display: block;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.7px;
	color: var(--j59-muted);
	margin-bottom: 3px;
}
.j59-app-name { display: block; font-weight: bold; color: var(--j59-ink); font-size: 16px; margin-bottom: 4px; }
.j59-app-ext { color: var(--j59-muted); font-size: 13px; margin-left: 2px; }
.j59-app-tag {
	display: inline-block;
	margin-left: 6px;
	font-size: 10px;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--j59-muted);
	background: #EEF0F3;
	border-radius: 999px;
	padding: 2px 8px;
	vertical-align: middle;
}
.j59-app-desc { display: block; color: var(--j59-muted); font-size: 13px; }
.j59-app-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.j59-chip {
	font-size: 11px;
	color: var(--j59-body);
	background: #F2F4F7;
	border-radius: 999px;
	padding: 3px 9px;
	white-space: nowrap;
}
.j59-app-card.is-pending { background: #FCFCFD; }
.j59-app-card-ghost { border-style: dashed; box-shadow: none; background: transparent; }
.j59-app-card-ghost:hover { border-color: var(--j59-cyan-b); background: var(--j59-white); }

/* Forms -------------------------------------------------------------- */

.j59-form { margin: 0; }
.j59-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.j59-field-full { grid-column: 1 / -1; }
.j59-field label { display: block; font-size: 13px; font-weight: bold; color: var(--j59-ink); margin-bottom: 5px; }
.j59-field input[type="text"],
.j59-field input[type="email"],
.j59-field input[type="url"],
.j59-field input[type="password"],
.j59-field input[type="number"],
.j59-field select,
.j59-field textarea {
	width: 100%;
	font-family: inherit;
	font-size: 14px;
	color: var(--j59-ink);
	background: var(--j59-white);
	border: 1px solid var(--j59-line);
	border-radius: 7px;
	padding: 9px 11px;
}
.j59-field input:focus, .j59-field select:focus, .j59-field textarea:focus {
	outline: none;
	border-color: var(--j59-cyan-b);
	box-shadow: 0 0 0 3px rgba(0, 126, 255, 0.15);
}
.j59-hint { color: var(--j59-muted); font-size: 12.5px; margin: 5px 0 0; font-weight: normal; }
.j59-static { color: var(--j59-ink); margin: 0; padding: 9px 0; }
.j59-actions { margin-top: 18px; display: flex; gap: 10px; align-items: center; }
.j59-inline-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.j59-inline-actions form { margin: 0; }

.j59-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; margin: 0 0 8px; }
.j59-check input { margin-top: 3px; }
.j59-check-inline { display: inline-flex; margin: 0; font-size: 13px; white-space: nowrap; }
.j59-switches { margin-top: 16px; display: grid; gap: 12px; }
.j59-checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 20px; }

/* Buttons ------------------------------------------------------------ */

.j59-btn {
	display: inline-block;
	font-family: inherit;
	font-size: 14px;
	font-weight: bold;
	color: var(--j59-ink);
	background: var(--j59-white);
	border: 1px solid var(--j59-line);
	border-radius: 7px;
	padding: 9px 16px;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.2;
}
.j59-btn:hover { border-color: #C9CDD4; text-decoration: none; }
.j59-btn-primary { color: var(--j59-black); border-color: transparent; background: linear-gradient(135deg, var(--j59-lime-a) 0%, var(--j59-lime-b) 100%); }
.j59-btn-primary:hover { filter: brightness(0.96); }
.j59-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.j59-btn-small { padding: 6px 11px; font-size: 13px; }
.j59-btn-block { width: 100%; }
.j59-btn-danger { color: var(--j59-magenta-a); border-color: #F3D3E3; background: var(--j59-white); }
.j59-linkbtn { background: none; border: none; padding: 0; font-family: inherit; font-size: inherit; color: var(--j59-cyan-b); cursor: pointer; text-decoration: underline; }

/* Tables ------------------------------------------------------------- */

.j59-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.j59-table th {
	text-align: left;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--j59-muted);
	border-bottom: 1px solid var(--j59-line);
	padding: 8px 10px;
	white-space: nowrap;
}
.j59-table td { padding: 11px 10px; border-bottom: 1px solid #F0F1F4; vertical-align: middle; }
.j59-table tr:last-child td { border-bottom: none; }
.j59-td-right { text-align: right; }
.j59-td-form { padding: 8px 0 !important; }
.j59-nowrap { white-space: nowrap; }
.j59-num { font-variant-numeric: tabular-nums; }
.j59-row-muted td { opacity: 0.55; }
.j59-subrow td { padding-top: 0; font-size: 12.5px; color: var(--j59-muted); border-bottom: 1px solid #F0F1F4; }
.j59-detail { color: var(--j59-muted); }
.j59-pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--j59-muted); }

.j59-inline-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; margin: 0; }
.j59-inline-row + .j59-inline-row { border-top: 1px solid #F0F1F4; }
.j59-inline-row input[type="text"], .j59-inline-row input[type="url"], .j59-inline-row input[type="number"], .j59-inline-row select {
	font-family: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--j59-line); border-radius: 6px; color: var(--j59-ink);
}
.j59-inline-name { flex: 1 1 150px; min-width: 120px; font-weight: bold; }
.j59-inline-url { flex: 1 1 170px; min-width: 130px; }
.j59-inline-cat { flex: 0 1 120px; }
.j59-inline-row select { max-width: 160px; }
.j59-inline-code { flex: 0 1 90px; }
.j59-inline-num { width: 62px; }
.j59-inline-delete { display: inline-block; margin: 0 0 0 8px; }
.j59-swatch { width: 8px; height: 30px; border-radius: 4px; display: inline-block; flex: none; }

/* Pills -------------------------------------------------------------- */

.j59-pill {
	display: inline-block;
	font-size: 11px;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	padding: 2px 9px;
	border-radius: 999px;
	white-space: nowrap;
	color: var(--j59-black);
	background: #E9ECF0;
	vertical-align: middle;
}
.j59-pill-lime { background: linear-gradient(135deg, var(--j59-lime-a), var(--j59-lime-b)); }
.j59-pill-cyan { background: linear-gradient(135deg, var(--j59-cyan-a), var(--j59-cyan-b)); color: var(--j59-white); }
.j59-pill-purple { background: linear-gradient(135deg, var(--j59-purple-a), var(--j59-purple-b)); color: var(--j59-white); }
.j59-pill-magenta { background: linear-gradient(135deg, var(--j59-magenta-a), var(--j59-magenta-b)); color: var(--j59-white); }
.j59-pill-off { background: #E9ECF0; color: var(--j59-muted); }

/* Notices ------------------------------------------------------------ */

.j59-notice {
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 18px;
	font-size: 14px;
	border: 1px solid var(--j59-line);
	background: var(--j59-white);
	border-left: 4px solid var(--j59-cyan-b);
	color: var(--j59-ink);
}
.j59-notice-success { border-left-color: var(--j59-lime-b); }
.j59-notice-error { border-left-color: var(--j59-magenta-a); }

/* Drop zone ---------------------------------------------------------- */

.j59-drop {
	border: 2px dashed #CDD2DA;
	border-radius: var(--j59-radius);
	background: #FAFBFC;
	padding: 34px 20px;
	text-align: center;
	margin-top: 16px;
	transition: border-color 0.12s ease, background 0.12s ease;
}
.j59-drop.is-over { border-color: var(--j59-cyan-b); background: rgba(1, 197, 255, 0.06); }
.j59-drop.has-file { border-style: solid; border-color: var(--j59-lime-b); background: rgba(73, 238, 166, 0.08); }
.j59-drop-title { font-size: 16px; font-weight: bold; color: var(--j59-ink); margin: 0 0 4px; }
.j59-drop-sub { color: var(--j59-muted); font-size: 13.5px; margin: 0; }
.j59-drop-file { margin: 12px 0 0; font-weight: bold; color: var(--j59-ink); }

/* Login -------------------------------------------------------------- */

.j59-login-body {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--j59-black);
	background-image: radial-gradient(ellipse at 20% 0%, rgba(116, 0, 234, 0.45) 0%, transparent 55%),
		radial-gradient(ellipse at 90% 100%, rgba(1, 197, 255, 0.35) 0%, transparent 55%);
	padding: 40px 20px;
}
.j59-login-wrap { width: 100%; max-width: 400px; }
.j59-login-card {
	background: var(--j59-white);
	border-radius: 14px;
	padding: 34px 32px 28px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.j59-login-logo { height: 30px; width: auto; display: block; margin-bottom: 22px; }
.j59-login-title { font-size: 21px; margin-bottom: 4px; }
.j59-login-message { color: var(--j59-muted); font-size: 14px; margin-bottom: 20px; }
.j59-login-form label { display: block; font-size: 13px; font-weight: bold; color: var(--j59-ink); margin: 14px 0 5px; }
.j59-login-form input[type="text"], .j59-login-form input[type="password"] {
	width: 100%;
	font-family: inherit;
	font-size: 15px;
	padding: 10px 12px;
	border: 1px solid var(--j59-line);
	border-radius: 7px;
	color: var(--j59-ink);
}
.j59-login-form input:focus { outline: none; border-color: var(--j59-cyan-b); box-shadow: 0 0 0 3px rgba(0,126,255,0.15); }
.j59-login-form .j59-check { margin: 16px 0 20px; font-size: 13.5px; }
.j59-login-links { margin: 18px 0 0; font-size: 13px; text-align: center; }
.j59-login-foot { text-align: center; color: rgba(255,255,255,0.5); font-size: 12px; margin-top: 20px; letter-spacing: 0.4px; }

/* Footer ------------------------------------------------------------- */

.j59-footer { border-top: 1px solid var(--j59-line); padding: 18px 0; color: var(--j59-muted); font-size: 12.5px; background: var(--j59-white); }
.j59-footer-dot { margin: 0 8px; }

/* Client context bar, only inside apps that work in a client ---------- */

.j59-clientbar {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	background: var(--j59-white);
	border: 1px solid var(--j59-line);
	border-left: 4px solid var(--j59-cyan-b);
	border-radius: 8px;
	padding: 12px 18px;
	margin-bottom: 20px;
	box-shadow: var(--j59-shadow);
}
.j59-clientbar-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--j59-muted); }
.j59-clientbar-form { margin: 0; display: flex; gap: 8px; align-items: center; }
.j59-clientbar-form select {
	font-family: inherit;
	font-size: 15px;
	font-weight: bold;
	color: var(--j59-ink);
	background: var(--j59-white);
	border: 1px solid var(--j59-line);
	border-radius: 7px;
	padding: 7px 10px;
}
/* Draft / Demo / Live switch on each app row -------------------------- */

.j59-lifeswitch { display: inline-flex; border: 1px solid var(--j59-line); border-radius: 7px; overflow: hidden; }
.j59-lifeform { margin: 0; display: flex; }
.j59-lifeopt {
	font-family: inherit;
	font-size: 12px;
	line-height: 1;
	padding: 7px 11px;
	border: 0;
	border-right: 1px solid var(--j59-line);
	background: var(--j59-white);
	color: var(--j59-muted);
	cursor: pointer;
	white-space: nowrap;
}
.j59-lifeswitch > *:last-child .j59-lifeopt,
.j59-lifeswitch > .j59-lifeopt:last-child { border-right: 0; }
button.j59-lifeopt:hover { background: #F4F5F7; color: var(--j59-ink); }
.j59-lifeopt.is-on { font-weight: bold; color: var(--j59-white); cursor: default; }
.j59-lifeopt.is-on.is-draft { background: #2B2F36; }
.j59-lifeopt.is-on.is-demo { background: #E70D70; }
.j59-lifeopt.is-on.is-live { background: #007EFF; }

.j59-clientbar-only { font-size: 14px; color: var(--j59-ink); }
.j59-clientbar-note { color: var(--j59-muted); font-size: 12.5px; margin-left: auto; }

/* Lists and long-form copy -------------------------------------------- */

.j59-list { margin: 0 0 14px; padding-left: 20px; color: var(--j59-body); }
.j59-list li { margin-bottom: 6px; }
.j59-field textarea { resize: vertical; line-height: 1.5; }

/* Suggest a tool ------------------------------------------------------ */

.j59-suggest-card {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	background: var(--j59-white);
	border: 2px dashed #CDD2DA;
	border-radius: var(--j59-radius);
	padding: 20px 22px;
	color: inherit;
	max-width: 640px;
}
.j59-suggest-card:hover { border-color: var(--j59-cyan-b); text-decoration: none; }
.j59-suggest-card strong { display: block; color: var(--j59-ink); font-size: 16px; margin-bottom: 4px; }
.j59-suggest-plus {
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--j59-lime-a), var(--j59-lime-b));
	color: var(--j59-black);
	font-size: 22px;
	font-weight: bold;
	line-height: 36px;
	text-align: center;
}

.j59-filterbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.j59-filterbar a { font-size: 13px; padding: 5px 11px; border-radius: 999px; color: var(--j59-muted); background: #F0F1F4; }
.j59-filterbar a:hover { color: var(--j59-ink); text-decoration: none; }
.j59-filterbar a.is-active { background: var(--j59-ink); color: var(--j59-white); }

.j59-suggestion { border-top: 1px solid var(--j59-line); padding: 18px 0 6px; }
.j59-suggestion:first-of-type { border-top: none; }
.j59-suggestion-head { display: flex; align-items: center; gap: 10px; }
.j59-suggestion-head h3 { margin: 0; font-size: 16px; }
.j59-suggestion-body { white-space: pre-line; margin: 8px 0; }

/* Admin: the apps list --------------------------------------------------- */

.j59-explainer { max-width: 90ch; margin-bottom: 18px; }
.j59-applist { border-top: 1px solid var(--j59-line); }

.j59-approw { border-bottom: 1px solid #F0F1F4; }
.j59-approw.is-child { padding-left: 30px; border-left: 3px solid var(--j59-line); margin-left: 8px; background: #FCFCFD; }
.j59-approw.is-off { opacity: 0.6; }

.j59-approw-main { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; }
.j59-approw-icon {
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.j59-approw-body { flex: 1 1 auto; min-width: 0; }
.j59-approw-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.j59-approw-title strong { color: var(--j59-ink); font-size: 15px; }
.j59-approw-meta { font-size: 12.5px; color: var(--j59-muted); word-break: break-all; }
.j59-approw-url { font-family: "SFMono-Regular", Consolas, monospace; color: var(--j59-body); }
.j59-approw-sep { margin: 0 6px; }
.j59-approw-desc { font-size: 13px; color: var(--j59-muted); margin-top: 4px; }
.j59-approw-levels { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.j59-approw-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--j59-muted); }
.j59-approw-actions { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.j59-approw-edit {
	border-top: 1px dashed var(--j59-line);
	background: #FAFBFC;
	border-radius: 8px;
	padding: 20px 22px;
	margin: 0 0 18px;
}
.j59-approw-remove { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--j59-line); }
.j59-iconrow { display: flex; align-items: center; gap: 10px; }
.j59-iconrow select { flex: 1 1 auto; }

.j59-iconpreview {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.j59-pill-dark { background: var(--j59-ink); color: var(--j59-white); }

.j59-grantgroup { border-top: 1px solid #F0F1F4; padding: 12px 0; }
.j59-grantgroup:first-of-type { border-top: none; }
.j59-checkgrid-nested { margin: 8px 0 0 28px; padding-left: 14px; border-left: 2px solid var(--j59-line); }

/* Responsive --------------------------------------------------------- */

@media (max-width: 1024px) {
	.j59-app-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 900px) {
	.j59-container { padding: 0 16px; }
	.j59-form-grid { grid-template-columns: 1fr; }
	.j59-page-head { flex-direction: column; align-items: flex-start; }
	.j59-table { display: block; overflow-x: auto; white-space: nowrap; }
	.j59-subnav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.j59-subnav a { white-space: nowrap; }
	.j59-approw-main { flex-wrap: wrap; }
	.j59-approw-actions { width: 100%; }
	.j59-lifeswitch { flex: 1 1 auto; }
	.j59-lifeform { flex: 1 1 auto; }
	.j59-lifeopt { width: 100%; padding: 9px 8px; }
	.j59-inline-row select { max-width: none; }
}

@media (max-width: 760px) {
	.j59-topbar-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px 16px; }
	.j59-brand-divider, .j59-brand-name { display: none; }
	.j59-brand img { height: 22px; }
	.j59-topbar-right { margin-left: auto; gap: 12px; }
	.j59-nav { order: 3; width: 100%; margin-left: 0; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.j59-nav a { white-space: nowrap; padding: 6px 10px; }
	.j59-main { padding: 20px 0 48px; }
	h1 { font-size: 22px; }
	.j59-hero { align-items: flex-start; gap: 14px; margin-bottom: 20px; }
	.j59-hero-meta { text-align: left; }
	.j59-hero-count { font-size: 26px; }
	.j59-card { padding: 16px 16px 18px; }
	.j59-clientbar { padding: 12px 14px; gap: 10px; }
	.j59-clientbar-note { display: none; }
	.j59-clientbar-form select { font-size: 16px; }
	.j59-checkgrid { grid-template-columns: 1fr; }
	.j59-checkgrid-nested { margin-left: 14px; padding-left: 12px; }
	.j59-actions { flex-wrap: wrap; }
	.j59-suggest-card { max-width: none; }
}

@media (max-width: 560px) {
	.j59-app-grid { grid-template-columns: 1fr; gap: 12px; }
	.j59-app-inner { padding: 14px 15px 16px; gap: 12px; }
	.j59-app-icon { width: 36px; height: 36px; border-radius: 9px; }
	.j59-login-card { padding: 26px 20px 22px; }
	.j59-inline-row { gap: 6px; }
	.j59-inline-name, .j59-inline-url { flex: 1 1 100%; }
	/* Touch targets and no iOS zoom on focus. */
	.j59-field input, .j59-field select, .j59-field textarea { font-size: 16px; padding: 11px 12px; }
	.j59-btn { padding: 11px 16px; }
}

/* Demo mode, levels and grant rows ------------------------------------ */

.j59-demobar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	background: #FFF6FB;
	border: 1px solid #F3D3E3;
	border-left: 4px solid var(--j59-magenta-a);
	border-radius: 8px;
	padding: 12px 18px;
	margin-bottom: 20px;
	color: var(--j59-ink);
	font-size: 13.5px;
}
.j59-demobar-tag {
	font-size: 11px;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--j59-white);
	background: linear-gradient(135deg, var(--j59-magenta-a), var(--j59-magenta-b));
	border-radius: 999px;
	padding: 3px 10px;
}

.j59-app-tag-demo { color: var(--j59-white); background: linear-gradient(135deg, var(--j59-magenta-a), var(--j59-magenta-b)); }
.j59-app-tag-hidden { color: var(--j59-white); background: var(--j59-ink); }
.j59-app-level { display: block; margin-top: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--j59-muted); }

.j59-grantline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 3px 0; }
.j59-grantline .j59-check { margin: 0; flex: 1 1 240px; }
.j59-levelselect {
	font-family: inherit;
	font-size: 13px;
	padding: 5px 9px;
	border: 1px solid var(--j59-line);
	border-radius: 6px;
	color: var(--j59-ink);
	background: var(--j59-white);
	flex: none;
	min-width: 150px;
}
/* A level picker sitting inside a form field must not stretch to the full
   width the way an ordinary field select does. */
.j59-field .j59-levelselect { width: auto; max-width: 220px; }
.j59-levelnote { margin: 0; white-space: nowrap; }
.j59-inline-levels { flex: 1 1 160px; min-width: 120px; }
.j59-urllist code { font-size: 12px; }
.j59-urllist li { margin-bottom: 4px; }

/* Access grid ---------------------------------------------------------- */

.j59-steps { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.j59-steps a {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	flex: 1 1 260px;
	padding: 14px 16px;
	border: 1px solid var(--j59-line);
	border-radius: 9px;
	background: var(--j59-white);
	color: inherit;
}
.j59-steps a:hover { border-color: #C9CDD4; text-decoration: none; }
.j59-steps a.is-active { border-color: var(--j59-cyan-b); box-shadow: 0 0 0 2px rgba(0,126,255,0.12); }
.j59-steps strong { display: block; color: var(--j59-ink); }
.j59-steps .j59-hint { margin-top: 2px; }
.j59-steps-num {
	flex: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #EEF0F3;
	color: var(--j59-muted);
	font-size: 12px;
	font-weight: bold;
	line-height: 24px;
	text-align: center;
}
.j59-steps a.is-active .j59-steps-num { background: linear-gradient(135deg, var(--j59-lime-a), var(--j59-lime-b)); color: var(--j59-black); }

.j59-gridwrap { overflow-x: auto; border: 1px solid var(--j59-line); border-radius: 9px; }
.j59-grid { border-collapse: collapse; font-size: 13px; width: 100%; }
.j59-grid th, .j59-grid td { border-bottom: 1px solid #F0F1F4; border-right: 1px solid #F0F1F4; padding: 9px 10px; }
.j59-grid thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: #FAFBFC;
	text-align: center;
	vertical-align: bottom;
	font-size: 11px;
	color: var(--j59-ink);
	min-width: 96px;
}
.j59-grid-app { display: block; font-weight: bold; }
.j59-grid-note { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--j59-muted); font-weight: normal; margin-top: 2px; }
.j59-grid-name {
	position: sticky;
	left: 0;
	z-index: 3;
	background: var(--j59-white);
	text-align: left;
	min-width: 190px;
	font-weight: normal;
	box-shadow: 1px 0 0 var(--j59-line);
}
.j59-grid thead .j59-grid-name { z-index: 4; background: #FAFBFC; }
.j59-grid tbody tr:hover td, .j59-grid tbody tr:hover .j59-grid-name { background: #F7FAFF; }
.j59-grid td { text-align: center; }
.j59-grid th.is-child, .j59-grid td.is-child { background: #FCFCFD; }
.j59-grid th.is-child .j59-grid-app { font-weight: normal; color: var(--j59-muted); }
.j59-gridcell { display: inline-flex; margin: 0; cursor: pointer; padding: 4px; }
.j59-gridcell input { width: 17px; height: 17px; }
.j59-gridlevel {
	font-family: inherit;
	font-size: 12px;
	padding: 4px 6px;
	border: 1px solid var(--j59-line);
	border-radius: 5px;
	background: var(--j59-white);
	color: var(--j59-ink);
	max-width: 110px;
}
.j59-grid-dash { color: #C9CDD4; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* Import preview ------------------------------------------------------- */

.j59-cell-warn { background: #FFF6FB; color: var(--j59-magenta-a); font-weight: bold; }
.j59-codeblock {
	font-family: "SFMono-Regular", Consolas, monospace;
	font-size: 12px;
	background: #EEF0F3;
	color: var(--j59-ink);
	border-radius: 6px;
	padding: 10px 12px;
	margin: 10px 0;
	overflow-x: auto;
	white-space: pre;
}

/* Former colleagues ---------------------------------------------------- */

.j59-inline-form { display: inline-block; margin: 0 0 0 6px; }
.j59-field-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0 14px; }
.j59-field-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--j59-muted); }
.j59-field-row input { padding: 7px 10px; border: 1px solid var(--j59-line); border-radius: 6px; font: inherit; }

/* Two tables pasted side by side ---------------------------------------- */

.j59-paste-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0; }
.j59-paste-row label { flex: 1 1 320px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--j59-muted); }
.j59-paste-row textarea,
.j59-paste {
	font-family: "SFMono-Regular", Consolas, monospace;
	font-size: 12px;
	padding: 10px;
	border: 1px solid var(--j59-line);
	border-radius: 6px;
	resize: vertical;
}

/* Result dashboards ----------------------------------------------------
 *
 * Status is carried by a word first and a colour second, everywhere. A colour
 * on its own is decoration pretending to be information: it says nothing to
 * somebody who cannot see the hue, and nothing at all on a printout.
 *
 * The tones are the hub's existing four, used for state rather than for
 * identity, so nothing new has to be learned to read a result.
 */

.j59-tone-good  { --tone: var(--j59-lime-b);    --tone-soft: #E8FBF2; --tone-ink: #0A6B45; }
.j59-tone-watch { --tone: var(--j59-purple-b);  --tone-soft: #F4ECFE; --tone-ink: #5A00B4; }
.j59-tone-bad   { --tone: var(--j59-magenta-a); --tone-soft: #FDEAF2; --tone-ink: #A3064E; }
.j59-tone-flat  { --tone: #B9BEC7;              --tone-soft: #F1F3F6; --tone-ink: var(--j59-muted); }

.j59-dash-verdict {
	border: 1px solid var(--j59-line);
	border-left: 4px solid var(--tone, var(--j59-line));
	border-radius: 8px;
	background: var(--tone-soft, #FAFBFC);
	padding: 16px 18px;
	margin-bottom: 18px;
}
.j59-dash-word { font-size: 20px; font-weight: bold; color: var(--tone-ink, var(--j59-ink)); margin: 0 0 6px; }
.j59-dash-counts { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--j59-body); }
.j59-dash-counts strong { color: var(--j59-ink); }

/* Reconciliation, written as the sum it is. */
.j59-dash-sum {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 14px;
	padding: 16px 18px;
	border: 1px solid var(--j59-line);
	border-radius: 8px;
	background: #FAFBFC;
	margin-bottom: 18px;
}
.j59-sum-term { display: flex; flex-direction: column; }
.j59-sum-n { font-size: 22px; font-weight: bold; color: var(--j59-ink); line-height: 1.1; }
.j59-sum-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--j59-muted); }
.j59-sum-op { font-size: 18px; color: var(--j59-muted); padding-bottom: 12px; }
.j59-sum-vs { color: var(--tone-ink, var(--j59-muted)); font-weight: bold; }
.j59-sum-verdict {
	flex: 1 1 100%;
	margin: 4px 0 0;
	font-size: 13px;
	font-weight: bold;
	color: var(--tone-ink, var(--j59-ink));
}

/* Plain count tiles. */
.j59-dash-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.j59-tile {
	flex: 1 1 150px;
	border: 1px solid var(--j59-line);
	border-radius: 8px;
	padding: 12px 14px;
	background: #FAFBFC;
	display: flex;
	flex-direction: column;
}
.j59-tile-n { font-size: 20px; font-weight: bold; color: var(--j59-ink); line-height: 1.2; }
.j59-tile-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--j59-muted); }

/* Horizontal bars. One series, so the heading names it and there is no legend. */
.j59-chart { margin: 4px 0 10px; }
.j59-chart-row {
	display: grid;
	grid-template-columns: 46px 1fr 72px 92px;
	align-items: center;
	gap: 10px;
	padding: 3px 0;
}
.j59-chart-key { font-size: 12px; font-weight: bold; color: var(--j59-ink); }
.j59-chart-track { position: relative; height: 14px; background: #EDEFF3; border-radius: 4px; overflow: hidden; }

/*
 * The band is a bracket over the bar, not a fill behind it.
 *
 * Drawn as a fill underneath, the bar covers the band's lower edge, so the band
 * appears to begin where the bar ends: it reads as "the normal range is
 * everything above this week", which is the opposite of what it says. Two edge
 * marks sitting on top survive any bar length. A band that runs past the widest
 * touchpoint simply loses its right mark off the end of the track, which is a
 * true statement about a band wider than the week.
 */
.j59-chart-band {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 2;
	border-left: 2px solid rgba(16, 17, 20, 0.38);
	border-right: 2px solid rgba(16, 17, 20, 0.38);
	background: rgba(16, 17, 20, 0.06);
}
.j59-chart-bar {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	background: var(--tone, var(--j59-purple-b));
	border-radius: 0 4px 4px 0;
	min-width: 2px;
}
.j59-chart-val { font-size: 12px; text-align: right; color: var(--j59-ink); font-variant-numeric: tabular-nums; }
.j59-chart-state { font-size: 11px; color: var(--tone-ink, var(--j59-muted)); font-weight: bold; }

.j59-grid .j59-num, .j59-table .j59-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Collapsible sections, so a finished run can hide its own inputs. */
.j59-fold { border-top: 1px solid var(--j59-line); margin-top: 14px; padding-top: 4px; }
.j59-fold > summary {
	cursor: pointer;
	list-style: none;
	padding: 8px 0;
	font-size: 11px;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--j59-muted);
	display: flex;
	align-items: center;
	gap: 8px;
}
.j59-fold > summary::-webkit-details-marker { display: none; }
.j59-fold > summary::before { content: "\25B8"; font-size: 12px; transition: transform 0.12s ease; }
.j59-fold[open] > summary::before { transform: rotate(90deg); }
.j59-fold > summary:hover { color: var(--j59-ink); }
.j59-fold-body { padding: 4px 0 10px; }

@media (max-width: 640px) {
	.j59-chart-row { grid-template-columns: 40px 1fr 66px; }
	.j59-chart-state { grid-column: 2 / -1; }
	.j59-dash-sum { gap: 10px; }
	.j59-sum-op { padding-bottom: 8px; }
}

/* A block of text meant to be copied out, not edited here. */
.j59-paste {
	width: 100%;
	box-sizing: border-box;
	background: var(--j59-surface, #fff);
	line-height: 1.5;
}

/* -----------------------------------------------------------------------
   EDITING A DAY ON THE WORKING CALENDAR (0.29.0)
   A native <details> in a sub-row. Closed it is one quiet line under the
   day; open it is the name, the type and a Save. No JavaScript, and nothing
   positioned absolutely that the table's own overflow could clip on a phone.
----------------------------------------------------------------------- */

.j59-hol-editrow td { padding-top: 0; padding-bottom: 6px; }

.j59-hol-edit > summary {
	display: inline-block;
	cursor: pointer;
	font-size: 12px;
	color: var(--j59-muted);
	padding: 2px 0;
	list-style: none;
	user-select: none;
}

/* The default marker is a black triangle that reads as a heavier control
   than this is. Replaced with a small chevron that turns when it opens. */
.j59-hol-edit > summary::-webkit-details-marker { display: none; }
.j59-hol-edit > summary::before {
	content: "\203A";
	display: inline-block;
	margin-right: 6px;
	transition: transform 0.12s ease;
}
.j59-hol-edit[open] > summary::before { transform: rotate(90deg); }
.j59-hol-edit > summary:hover { color: var(--j59-ink); }
.j59-hol-edit[open] > summary { color: var(--j59-ink); font-weight: 700; }

.j59-hol-edit .j59-inline-row {
	margin-top: 6px;
	padding: 10px 12px;
	background: var(--j59-bg);
	border: 1px solid var(--j59-line);
	border-radius: 8px;
	gap: 12px;
}

.j59-hol-field {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--j59-muted);
	white-space: nowrap;
}

.j59-hol-field input[type="text"] { min-width: 240px; }

/* On a phone the table scrolls sideways, so the form stacks rather than
   pushing the row wider still. */
@media (max-width: 782px) {
	.j59-hol-edit .j59-inline-row { flex-direction: column; align-items: stretch; }
	.j59-hol-field { white-space: normal; }
	.j59-hol-field input[type="text"] { min-width: 0; width: 100%; }
}

/* -----------------------------------------------------------------------
   THE TIME OFF COMPARISON, FOLDED AWAY (0.30.0)
   A one-time reconciliation rather than a standing report, so it opens
   itself only when a difference changes whether the agency works a day.
----------------------------------------------------------------------- */

.j59-cmp > summary {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
	cursor: pointer;
	list-style: none;
	padding: 2px 0;
	user-select: none;
}

.j59-cmp > summary::-webkit-details-marker { display: none; }

.j59-cmp > summary::before {
	content: "\203A";
	color: var(--j59-muted);
	transition: transform 0.12s ease;
}

.j59-cmp[open] > summary::before { transform: rotate(90deg); }

.j59-cmp-title {
	font-size: 15px;
	font-weight: 700;
	color: var(--j59-ink);
}

.j59-cmp-state {
	font-size: 12px;
	color: var(--j59-muted);
}

.j59-cmp[open] > summary { margin-bottom: 10px; }

.j59-cmp-done {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--j59-line);
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.j59-cmp-putaway {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0 0 16px;
}

/* -----------------------------------------------------------------------
   ADD A DAY, under the year calendar (0.31.0)
   It used to sit at the foot of the screen, past the day list and the
   comparison. The calendar is what tells you a day is missing, so the form
   that fixes it belongs next to the calendar.
----------------------------------------------------------------------- */

.j59-addday {
	margin: 14px 0 18px;
	padding: 12px 14px;
	background: var(--j59-bg);
	border: 1px solid var(--j59-line);
	border-radius: 9px;
}

.j59-addday .j59-field-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
	margin: 0;
}

.j59-addday label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	color: var(--j59-muted);
}

.j59-addday input[type="text"] { min-width: 260px; }

.j59-addday .j59-hint { margin: 8px 0 0; }

@media (max-width: 640px) {
	.j59-addday .j59-field-row { flex-direction: column; align-items: stretch; }
	.j59-addday input[type="text"] { min-width: 0; }
	.j59-addday .j59-btn { width: 100%; }
}
