/*
 * Nailux staff area.
 *
 * The admin design rather than the client portal's: dark rail, light
 * workspace. Staff spend hours in here; clients spend two minutes. A
 * near-black document editor is right for one and tiring for the other.
 *
 * Edge to edge: the staff area is a tool, not a document, so it takes
 * the whole window rather than sitting in the theme's reading column.
 *
 * Desktop-first in spirit but responsive in fact — the rail folds into
 * a top bar, the file screen collapses to one column and the table to
 * stacked rows, because the officer posting an update is standing on a
 * plot with a phone.
 */

.nxa {
	--ink: #0a0a0b;
	--rail: #121214;
	--rail-on: #1e1e22;
	--paper: #f6f6f7;
	--white: #fff;
	--line: #e4e4e7;
	--muted: #6b7074;
	--dim: #9499a0;
	--peach: #f09c72;
	--clay: #a9522c;
	--danger: #c7452a;

	/* Bridge to the shared invoice-thread component in portal.css, which
	   is always enqueued ahead of this file. */
	--t-bg: var(--white);
	--t-line: var(--line);
	--t-text: var(--ink);
	--t-muted: var(--muted);
	--t-dim: var(--dim);
	--t-accent: var(--clay);
	--t-danger: var(--danger);

	--display: "Outfit", system-ui, -apple-system, sans-serif;
	--body: "Outfit", system-ui, -apple-system, sans-serif;

	display: flex;
	align-items: stretch;
	min-height: 70vh;
	width: 100%;
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--body);
	font-size: 15px;
	line-height: 1.6;

	/*
	 * Clip, not hidden. This is here to stop the full-bleed layout
	 * pushing a horizontal scrollbar onto the page — but `overflow:
	 * hidden` makes this element a scroll container, and a scroll
	 * container is the thing a `position: sticky` child sticks inside.
	 * Since this container never scrolls, the rail and the header had
	 * nowhere to stick and quietly scrolled away with the page.
	 *
	 * `clip` does the same clipping without becoming a scroll
	 * container. The `hidden` above it is the fallback for Safari
	 * before 16, which lands exactly where we started: clipped, no
	 * sticky. Nothing breaks, it just stops being pinned.
	 */
	overflow-x: hidden;
	overflow-x: clip;
}

/*
 * Fallback for a theme that still drops the shortcode inside its reading
 * column: break out of it. The theme's own page template is the better
 * place to fix this — when it does, these selectors stop matching and the
 * plain width above carries the layout, with no 100vw and so no risk of
 * a scrollbar-width horizontal overflow.
 */
.prose > .nxa,
.wrap > .nxa,
.entry-content > .nxa {
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.nxa *, .nxa *::before, .nxa *::after { box-sizing: border-box; }
.nxa h1, .nxa h2, .nxa p, .nxa ul, .nxa ol { margin: 0; }
.nxa ul, .nxa ol { padding: 0; list-style: none; }
/*
 * Links take the colour of whatever they sit in — but only when the
 * component has not said otherwise.
 *
 * :where() is load-bearing, not decoration. Written plainly as `.nxa a`
 * this selector scores (0,1,1) and beats every single-class component
 * rule below it, so `.nxa-btn--solid { color: #fff }` lost and the Add
 * a client button rendered as black text on a black pill — an invisible
 * label on the primary action of the first screen staff ever see. It
 * was quietly doing the same to the rail navigation, the back link and
 * the dark logo.
 *
 * :where() contributes zero specificity, so this drops to (0,1,0),
 * ties with the component rules, and loses to them on source order
 * because it is declared here, first. A browser too old to understand
 * it drops the rule entirely, which leaves the theme's own
 * `a { color: inherit }` doing the same job one rung lower.
 */
.nxa :where(a) { color: inherit; }
.nxa :focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.nxa-sr { position: absolute; left: -9999px; }
.nxa-dim { color: var(--muted); }
.nxa-right { text-align: right; }

/* Rail */

/*
 * The rail stays put.
 *
 * align-self is the load-bearing line: .nxa stretches its children, and
 * a sticky element stretched to the full height of its container has no
 * room left to move in, so it silently does nothing. Pinning it to the
 * top and giving it its own height makes it a scroller of its own — a
 * long client list then scrolls past a navigation that does not.
 */
.nxa-side {
	flex: none;
	width: 230px;
	background: var(--rail);
	color: #fff;
	padding: 22px 14px;
	display: flex;
	flex-direction: column;
	gap: 24px;
	position: sticky;
	top: 0;
	align-self: flex-start;

	/*
	 * As tall as it needs to be, never taller than the window.
	 *
	 * This was a flat height:100vh. The staff area sits inside the
	 * theme's page, below a site header and a page title, so a rail
	 * pinned to a full viewport height STARTED a few hundred pixels
	 * down and ended a whole screen below the fold — taking its footer,
	 * and with it the only way to sign out, somewhere nobody would look
	 * on a screen with five nav items and a short list.
	 *
	 * With an automatic height the rail is as tall as its contents, the
	 * footer sits directly under the navigation, and max-height keeps
	 * the internal scroll for the day the navigation grows.
	 */
	height: auto;
	max-height: 100vh;
	overflow-y: auto;
}

.nxa-logo {
	font-family: var(--display);
	font-size: 23px;
	text-decoration: none;
	color: #fff;
	padding: 0 8px;
}

.nxa-logo span { color: var(--dim); }
.nxa-logo--dark { color: var(--ink); }
.nxa-logo--dark span { color: var(--muted); }

.nxa-nav { display: flex; flex-direction: column; gap: 3px; }

.nxa-navitem {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 11px;
	border-radius: 9px;
	font-size: 13.5px;
	color: #9a9aa2;
	text-decoration: none;
}

.nxa-navitem:hover { color: #fff; background: #191a1d; }
.nxa-navitem.is-on { background: var(--rail-on); color: #fff; font-weight: 600; }

.nxa-side-foot {
	margin-top: auto; padding: 12px 8px 0;
	display: flex; flex-direction: column; gap: 8px;
	border-top: 1px solid #222226;
}
.nxa-who { font-size: 11.5px; color: var(--dim); }
.nxa-who strong { color: #fff; font-weight: 600; }

/*
 * Sign out is a BUTTON.
 *
 * It was a plain text link in the same colour as everything else at the
 * foot of the rail, and nobody could find it. A staff account can open
 * every client's land documents and the device is often shared, so this
 * is a control — not a footnote — and it gets the full width of the
 * rail and a border that says it can be pressed.
 */
.nxa-out {
	display: flex; align-items: center; justify-content: center; gap: 7px;
	min-height: 40px; padding: 9px 12px;
	border: 1px solid #35353b; border-radius: 8px;
	background: #1b1b1f; color: #fff;
	font-family: var(--body); font-size: 13px; font-weight: 600;
	text-decoration: none;
}
.nxa-out:hover, .nxa-out:focus { background: var(--danger); border-color: var(--danger); color: #fff; }
.nxa .nxa-out, .nxa .nxa-out:hover, .nxa .nxa-out:focus { color: #fff; }

/* Workspace */

.nxa-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/*
 * So does the header. It carries the file name, the step counter and
 * the primary action, and an officer who has scrolled down a long step
 * list should not have to scroll back up to find out which file they
 * are looking at, or to press the button.
 */
.nxa-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	padding: 22px 26px;
	background: var(--white);
	border-bottom: 1px solid var(--line);
	flex-wrap: wrap;
	position: sticky;
	top: 0;
	z-index: 4;
}

.nxa-back { display: inline-block; font-size: 11.5px; color: var(--muted); text-decoration: none; margin-bottom: 5px; }
.nxa-back:hover { color: var(--ink); }

.nxa-title { font-family: var(--display); font-size: 27px; font-weight: 400; line-height: 1.1; }
.nxa-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.nxa-flagtext { color: var(--clay); font-weight: 600; }

.nxa-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.nxa-body { padding: 22px 26px 30px; }

.nxa-pill {
	padding: 6px 11px;
	border-radius: 100px;
    background: var(--paper);
	border: 1px solid var(--line);
	font-size: 11.5px;
	font-weight: 600;
	white-space: nowrap;
}

/* Buttons and fields */

.nxa-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 11px 16px;
	border-radius: 9px;
	border: 1px solid var(--line);
	background: var(--white);
	color: var(--ink);
	font-family: var(--body);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
}

.nxa-btn:hover { border-color: #cfcfd4; }
.nxa-btn--solid { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.nxa-btn--solid:hover { background: #26262a; border-color: #26262a; }

/* The primary action is a link as often as it is a button, and a label
   that vanishes into its own background is the worst bug a button can
   have. Stated again at (0,2,0) so it survives a stray `a` rule from a
   theme as well as from here. */
.nxa a.nxa-btn--solid,
.nxa a.nxa-btn--solid:hover,
.nxa a.nxa-btn--solid:focus { color: #fff; }
.nxa-btn--small { padding: 8px 12px; font-size: 12px; }

/* Destructive, and dressed as such: quiet until you reach for it, then
   unmistakable. Loud by default would make every invoice card shout. */
.nxa-btn--bad { color: var(--danger); border-color: #e9c9c1; }
.nxa-btn--bad:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.nxa a.nxa-btn--bad:hover { color: #fff; }
.nxa-btn--full { width: 100%; }

.nxa-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }

.nxa-input {
	display: block;
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: var(--white);
	font-family: var(--body);
	font-size: 14px;
	color: var(--ink);
}

.nxa-input::placeholder { color: var(--dim); }
.nxa-textarea { line-height: 1.5; resize: vertical; }
/* A drawn chevron rather than two overlapping gradient triangles: the
   old trick renders as a lumpy wedge at anything but exactly 5px, and
   it sat badly against the taller fields on the step rows. */
.nxa-select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 32px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239499a0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-position: right 11px center;
	background-size: 11px 11px;
	background-repeat: no-repeat;
	text-overflow: ellipsis;
}

.nxa-select:hover { border-color: #cfcfd4; }

/*
 * No attempt to grey out an empty date here. The obvious selectors
 * (`:not([aria-valuenow])` on the datetime-edit sub-fields) do not
 * match in Chrome — measured, not assumed — and `[value=""]` keeps
 * matching after the picker sets a date, so it greys out real ones.
 * Doing it properly needs JavaScript, which is not worth adding to a
 * screen that works without any.
 */

.nxa-hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin: 7px 0 0; }
.nxa-form .nxa-btn { margin-top: 16px; }

.nxa-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nxa-narrow { max-width: 620px; }

/* Cards */

.nxa-card {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 18px;
	margin-bottom: 16px;
}

.nxa-cardtitle { font-size: 14.5px; font-weight: 600; margin: 22px 0 4px; }
.nxa-card > .nxa-cardtitle:first-child { margin-top: 0; }
.nxa-empty { color: var(--muted); }
.nxa-legend { font-size: 11.5px; color: var(--muted); margin-top: 12px; }

.nxa-notice {
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 13.5px;
	margin-bottom: 16px;
}

.nxa-notice--ok { background: #fff4ee; border: 1px solid #f3d3c2; color: #7a4526; }
.nxa-notice--bad { background: #fdecea; border: 1px solid #f3c3bb; color: #8a2d1a; }

/* Table */

.nxa-tablewrap { padding: 0; overflow: hidden; }
.nxa-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.nxa-table th {
	text-align: left;
	font-size: 9.5px;
	letter-spacing: 1.1px;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 600;
	padding: 12px 16px;
	background: var(--paper);
	border-bottom: 1px solid var(--line);
}

.nxa-table td { padding: 14px 16px; border-bottom: 1px solid #f0f0f2; vertical-align: middle; }
.nxa-table tr:last-child td { border-bottom: 0; }
.nxa-table tbody tr { cursor: pointer; }
.nxa-table tbody tr:hover { background: #fafafb; }
.nxa-rowlink { text-decoration: none; display: block; }
.nxa-table td .nxa-dim { display: block; font-size: 11.5px; }

.nxa-stagecell { display: flex; align-items: center; gap: 9px; }
.nxa-bar { flex: none; width: 60px; height: 6px; border-radius: 100px; background: var(--line); overflow: hidden; }
.nxa-bar span { display: block; height: 100%; background: var(--ink); }

.nxa-lastcell { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.nxa-lastcell.is-stale { color: var(--clay); font-weight: 600; }
.nxa-flag { width: 6px; height: 6px; border-radius: 50%; background: var(--peach); flex: none; }

.nxa-search input {
	width: 230px;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 9px;
	font-family: var(--body);
	font-size: 13px;
}

/* File screen */

.nxa-cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.nxa-col { min-width: 0; }

.nxa-stagerow {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 11px 0;
	border-bottom: 1px solid #f0f0f2;
}

.nxa-stagerow:last-of-type { border-bottom: 0; }
.nxa-stagename { flex: 1; font-size: 13.5px; min-width: 0; }
.nxa-stagerow .nxa-select { flex: 0 0 140px; }
.nxa-stagerow .nxa-date { flex: 0 0 140px; }

.nxa-marker { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); flex: none; }
.nxa-marker--done { background: var(--ink); border-color: var(--ink); }
.nxa-marker--in_progress { background: var(--peach); border-color: var(--peach); }
.nxa-marker--waiting { background: var(--peach); border-color: var(--clay); }
.nxa-marker--hold { background: var(--danger); border-color: var(--danger); }

.nxa-file {
	display: block;
	width: 100%;
	padding: 15px 13px;
	border: 1px dashed #cfcfd4;
	border-radius: 10px;
	background: var(--paper);
	font-family: var(--body);
	font-size: 12.5px;
	color: var(--muted);
	margin-bottom: 12px;
}

.nxa-files { display: grid; gap: 8px; margin-top: 14px; }
.nxa-files li { display: flex; align-items: center; gap: 11px; padding: 8px; background: var(--paper); border-radius: 9px; }
.nxa-files img { width: 42px; height: 42px; object-fit: cover; border-radius: 7px; flex: none; }
.nxa-filekind { width: 42px; height: 42px; border-radius: 7px; background: var(--white); border: 1px solid var(--line);
	display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; flex: none; }
.nxa-filemeta { display: flex; flex-direction: column; min-width: 0; }
.nxa-filemeta strong { font-size: 12.5px; }
.nxa-filemeta .nxa-dim { font-size: 10.5px; }

.nxa-history li { padding: 11px 0; border-bottom: 1px solid #f0f0f2; font-size: 13px; }
.nxa-history li:last-child { border-bottom: 0; }
.nxa-history .nxa-dim { display: block; font-size: 11px; margin-bottom: 2px; }

/* Access code */

.nxa-codebox { background: #fff4ee; border: 1px solid #f3d3c2; border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.nxa-eyebrow { font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; font-weight: 600; color: var(--clay); }
.nxa-code { font-size: 28px; font-weight: 600; letter-spacing: 4px; margin: 6px 0; }
.nxa-codebox .nxa-btn { margin-top: 12px; }

/* Invoices */

.nxa-duebanner { background: var(--paper); border-radius: 9px; padding: 11px 13px; font-size: 13px; margin-bottom: 12px; }
.nxa-duebanner strong { color: var(--clay); }

.nxa-invoices { display: grid; gap: 9px; margin-bottom: 14px; }
.nxa-invoice { background: var(--paper); border-radius: 10px; padding: 12px; }
.nxa-invoice-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nxa-invoice-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nxa-invoice-main a { text-decoration: none; }
.nxa-invoice-meta { font-size: 11px; }
.nxa-invoice-right { display: flex; align-items: center; gap: 9px; flex: none; }
.nxa-invoice-amount { font-size: 14px; font-weight: 600; }
.nxa-invoice-actions { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.nxa-invoice-actions form { margin: 0; }

.nxa-tag { font-size: 9px; font-weight: 600; letter-spacing: .9px; text-transform: uppercase;
	padding: 4px 8px; border-radius: 100px; border: 1px solid transparent; white-space: nowrap; }
.nxa-tag--due { background: var(--white); border-color: var(--line); color: var(--muted); }
.nxa-tag--part_paid { background: #fff4ee; border-color: #f3d3c2; color: var(--clay); }
.nxa-tag--paid { background: var(--ink); color: #fff; }
.nxa-tag--overdue { background: #fdecea; border-color: #f3c3bb; color: #8a2d1a; }
.nxa-tag--cancelled { background: transparent; border-color: var(--line); color: var(--dim); }

.nxa-details summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 9px 0; }
.nxa-linerow { display: flex; gap: 8px; margin-bottom: 8px; }
.nxa-linerow .nxa-input { margin: 0; }
.nxa-qty { flex: 0 0 80px; }
.nxa-amount { flex: 0 0 120px; }

/* Login */

.nxa--login { display: block; background: var(--paper); padding: 48px 20px; }
.nxa-loginbox { max-width: 380px; margin: 0 auto; background: var(--white); border: 1px solid var(--line);
	border-radius: 14px; padding: 28px; }
.nxa-loginbox .nxa-title { margin-top: 14px; }
.nxa-lockline { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 18px;
	padding-top: 14px; border-top: 1px solid var(--line); }

/* Narrow */

@media (max-width: 960px) {
	.nxa-cols { grid-template-columns: minmax(0, 1fr); }
	/* On a phone the uploader comes first: the photo is taken on site. */
	.nxa-col--side { order: -1; }
}

@media (max-width: 780px) {
	.nxa { flex-direction: column; }

	/*
	 * Stacked now, so only one of the two can hold the top. The rail
	 * wins: it is how you get anywhere else. Pinning both would mean
	 * hardcoding the rail's height into the header's offset, and that
	 * number is wrong the moment the rail wraps on a narrow phone.
	 */
	.nxa-side {
		width: 100%;
		flex-direction: row;
		align-items: center;
		gap: 14px;
		padding: 12px 14px;
		/*
		 * The BAR no longer scrolls — the navigation inside it does.
		 *
		 * It used to scroll as a whole, and the sign-out sits at the end
		 * of the row, so on a phone the one control that matters most on
		 * a shared device was off the right-hand edge and reachable only
		 * by dragging the navigation sideways. Nobody does that looking
		 * for a way out; they close the tab and stay signed in.
		 */
		overflow: visible;
		max-height: none;
		height: auto;
		align-self: auto;
		z-index: 6;
	}

	.nxa-head { position: static; }

	.nxa-nav { flex-direction: row; gap: 6px; }
	.nxa-navitem { padding: 8px 10px; white-space: nowrap; }
	.nxa-navitem span { display: none; }
	.nxa-navitem.is-on span { display: inline; }
	/* The navigation is the part that scrolls sideways. */
	.nxa-nav { overflow-x: auto; flex: 1 1 auto; min-width: 0; scrollbar-width: none; }
	.nxa-nav::-webkit-scrollbar { display: none; }

	/*
	 * Folded into the top bar, pinned OUTSIDE the scroll, and still a
	 * button with its word on it. Hiding the label on a narrow screen
	 * would put it back where it started, which is unfindable.
	 */
	.nxa-side-foot {
		margin-top: 0; margin-left: 0; padding: 0;
		flex: 0 0 auto;
		flex-direction: row; align-items: center; gap: 8px;
		border-top: 0;
	}
	.nxa-out { min-height: 36px; padding: 7px 12px; white-space: nowrap; }
	/* The name goes; the button is what matters in a bar this narrow. */
	.nxa-who { display: none; }

	.nxa-head, .nxa-body { padding-left: 16px; padding-right: 16px; }
	.nxa-search input { width: 100%; }
	.nxa-head-right { width: 100%; }
	.nxa-grid2 { grid-template-columns: 1fr; }

	.nxa-stagerow { flex-wrap: wrap; }
	.nxa-stagename { flex: 1 1 100%; }
	.nxa-stagerow .nxa-select, .nxa-stagerow .nxa-date { flex: 1; }

	/* Table becomes stacked rows. */
	.nxa-table thead { display: none; }
	.nxa-table, .nxa-table tbody, .nxa-table tr, .nxa-table td { display: block; width: 100%; }
	.nxa-table tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
	.nxa-table td { border: 0; padding: 5px 16px; }
	.nxa-table td::before {
		content: attr(data-label);
		display: block;
		font-size: 9.5px;
		letter-spacing: 1px;
		text-transform: uppercase;
		color: var(--dim);
		margin-bottom: 2px;
	}
	.nxa-table td:last-child { display: none; }
}

/* ------------------------------------------------------------------
   Services and steps
   The officer's working surface. Everything here is edited standing
   up, often outdoors, so targets are large and the destructive
   actions are small and off to one side.
------------------------------------------------------------------ */

.nxa-cardhead {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.nxa-cardhead .nxa-cardtitle { margin: 0; }

/* Service tabs */

.nxa-svctabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 12px 0 4px;
}

.nxa-svctab {
	display: flex;
	flex-direction: column;
	gap: 1px;
	padding: 8px 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--white);
	text-decoration: none;
	min-width: 0;
}

.nxa-svctab:hover { border-color: #cfcfd4; }

.nxa-svctab.is-on {
	background: var(--ink);
	border-color: var(--ink);
}

.nxa-svctab-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.nxa-svctab-meta { font-size: 11px; color: var(--muted); }
.nxa-svctab.is-on .nxa-svctab-name { color: #fff; }
.nxa-svctab.is-on .nxa-svctab-meta { color: #a8a8b0; }

/* Disclosure blocks */

.nxa-disclose { margin-top: 12px; }

.nxa-disclose > summary {
	cursor: pointer;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--muted);
	padding: 6px 0;
	list-style: none;
}

.nxa-disclose > summary::-webkit-details-marker { display: none; }
.nxa-disclose > summary::before { content: "+ "; color: var(--clay); }
.nxa-disclose[open] > summary::before { content: "– "; }
.nxa-disclose > summary:hover { color: var(--ink); }

.nxa-subform { padding-top: 6px; }
.nxa-inlineform { display: flex; align-items: center; gap: 6px; }

/* One step */

.nxa-step {
	padding: 11px 0;
	border-top: 1px solid var(--line);
}

.nxa-step:first-of-type { border-top: 0; }

.nxa-step-head {
	display: flex;
	align-items: center;
	gap: 9px;
}

.nxa-step-name {
	flex: 1;
	min-width: 0;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--ink);
}

.nxa-step-tools { display: flex; gap: 3px; flex: none; }

.nxa-icobtn {
	width: 26px;
	height: 26px;
	border: 1px solid var(--line);
	border-radius: 7px;
	background: var(--white);
	color: var(--muted);
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.nxa-icobtn:hover { border-color: #cfcfd4; color: var(--ink); }
.nxa-icobtn--bad:hover { border-color: var(--danger); color: var(--danger); }

.nxa-step-fields {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 7px;
	padding-left: 24px;
}

/*
 * Both of these carry .nxa-input, which is width: 100%. Inside a flex
 * row that turns `flex: none` on the date into "take the entire line",
 * and that is what happened: the date ran the full width of the card
 * while the status select was crushed to 44px — just its chevron, the
 * word "Not started" clipped away entirely. An officer could not see
 * what state a step was in without opening the menu.
 *
 * Resetting width to auto is the fix: the flex basis then decides, as
 * it was always meant to. The status gets the room because it is the
 * field that is read; the date gets exactly what a date needs.
 */
.nxa-step-fields .nxa-select {
	flex: 0 1 230px;
	width: auto;
	min-width: 0;
}

.nxa-step-fields .nxa-date {
	flex: 0 0 150px;
	width: auto;
	min-width: 0;
	padding-left: 10px;
	padding-right: 6px;
	font-variant-numeric: tabular-nums;
}

.nxa-step-note { margin-top: 6px; margin-left: 24px; width: calc(100% - 24px); font-size: 13px; }

.nxa-step-attached {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin: 7px 0 0 24px;
}

.nxa-chip {
	display: inline-block;
	max-width: 100%;
	padding: 3px 8px;
	border: 1px solid var(--line);
	border-radius: 100px;
	font-size: 11px;
	color: var(--muted);
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

a.nxa-chip:hover { border-color: #cfcfd4; color: var(--ink); }
.nxa-chip--off { opacity: .55; text-decoration: line-through; }
.nxa-chip--hint { border-style: dashed; }
.nxa-chip--paid { color: var(--ink); border-color: var(--ink); }
.nxa-chip--part_paid, .nxa-chip--due { color: var(--clay); border-color: currentColor; }
.nxa-chip--overdue { color: var(--danger); border-color: currentColor; }

.nxa-addstep { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }

/* Tick lists — which steps an invoice covers */

.nxa-checks {
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 9px 11px;
	margin: 8px 0 0;
}

.nxa-checks legend {
	font-size: 10.5px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--muted);
	padding: 0 4px;
}

.nxa-check {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font-size: 13px;
	cursor: pointer;
}

.nxa-check input { width: 16px; height: 16px; flex: none; accent-color: var(--clay); }

.nxa-select--small { font-size: 12px; padding: 6px 8px; width: auto; }

/* The tracking link */

.nxa-tracklink {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	padding: 9px 11px;
	border: 1px dashed var(--line);
	border-radius: 9px;
	font-size: 11.5px;
	color: var(--muted);
	word-break: break-all;
}

@media (max-width: 780px) {
	/* Side by side still fits a phone at these widths, and stacking
	   them pushed the note box below the fold on every step. */
	.nxa-step-fields { padding-left: 0; }
	.nxa-step-fields .nxa-select { flex: 1 1 140px; }
	.nxa-step-fields .nxa-date { flex: 1 1 140px; }
	.nxa-step-note { margin-left: 0; width: 100%; }
	.nxa-step-attached { margin-left: 0; }
	.nxa-svctab { flex: 1 1 100%; }
}

/*
 * Row actions on the client list.
 *
 * Held back until the row is hovered. Six of these shouting "+ Property"
 * down the right-hand edge would read as the main thing to do on the
 * screen, and it is not — opening a file is. On a touch screen there
 * is no hover, so it stays visible there and the layout does not jump.
 */
.nxa-rowacts { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }

.nxa-rowact {
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	text-decoration: none;
	white-space: nowrap;
	padding: 5px 9px;
	border: 1px solid var(--line);
	border-radius: 7px;
	background: var(--white);
	opacity: 0;
	transition: opacity .12s ease;
}

.nxa-table tr:hover .nxa-rowact,
.nxa-rowact:focus-visible { opacity: 1; }

.nxa a.nxa-rowact:hover { color: var(--ink); border-color: #cfcfd4; }

@media (hover: none) {
	.nxa-rowact { opacity: 1; }
}

.nxa-refile { margin-top: 5px; }
.nxa-refile .nxa-select--small { max-width: 100%; }

/* The step library pick-list. Scrolls rather than pushing the Add
   button off a phone screen once the firm has fifty steps on file. */
.nxa-steplib {
	max-height: 230px;
	overflow-y: auto;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 8px 11px;
	margin-top: 6px;
	background: var(--white);
}

/* See the note in portal.css: one typeface, so tracking carries the
   display sizes. */
.nxa-title,
.nxa-logo { letter-spacing: -0.02em; }

.nxa-check--inline { display: inline-flex; margin-left: 2px; font-size: 12px; }
.nxa-check--inline input { width: 15px; height: 15px; }

.nxa-otherprops { list-style: none; margin: 6px 0 0; padding: 0; }
.nxa-otherprops li + li { margin-top: 5px; }

.nxa-otherprops a {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 9px 11px;
	border: 1px solid var(--line);
	border-radius: 9px;
	text-decoration: none;
	font-size: 13px;
}

.nxa-otherprops a:hover { border-color: #cfcfd4; }

/* Per-document controls on the file screen: hide / show / delete. */
.nxa-docacts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.nxa-docacts .nxa-hint { margin: 0; }

/* =========================================================================
 * Stays — the guest-link list and builder.
 *
 * Added in 1.6.0. Reuses the card, table, chip and tag components above;
 * what is here is only the things the builder needs that nothing else
 * did — the numbered steps, the pick list, and the live preview.
 * ====================================================================== */

.nxa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nxa-catfilter { margin: 0 0 16px; }

/* The step number beside each card title. Quiet on purpose: it is there
   to say "there are four of these and you are on the second", not to be
   looked at. */
.nxa-stepnum {
	flex: none;
	display: grid;
	place-items: center;
	width: 21px;
	height: 21px;
	border-radius: 6px;
	background: var(--paper);
	color: var(--muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 10px;
	font-weight: 600;
}

.nxa-cardhead { display: flex; align-items: flex-start; gap: 11px; }
.nxa-cardhead > span { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nxa-cardhead .nxa-hint { margin: 0; }

/* Interests, as tick-chips. A checkbox that looks like a chip rather
   than a list of forty checkboxes down the page: staff are scanning for
   the three they want, not reading all of them. */
.nxa-chipcheck { position: relative; display: inline-flex; }
.nxa-chipcheck input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }

.nxa-chipcheck span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border: 1px solid var(--line);
	border-radius: 100px;
	background: var(--white);
	color: var(--muted);
	font-size: 12px;
	transition: background .12s, color .12s, border-color .12s;
}

.nxa-chipcheck input:checked + span {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--white);
	font-weight: 600;
}

.nxa-chipcheck input:focus-visible + span { outline: 2px solid var(--clay); outline-offset: 2px; }

/* The recommendations list. */
.nxa-picklist {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--line);
	border-radius: 10px;
	overflow: hidden;
	max-height: 420px;
	overflow-y: auto;
}

.nxa-pickrow {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--line);
	cursor: pointer;
}

.nxa-pickrow:last-child { border-bottom: 0; }
.nxa-pickrow.is-on { background: #fdf6f1; }
.nxa-pickrow input[type="checkbox"] { flex: none; width: 16px; height: 16px; accent-color: var(--ink); }
.nxa-pickmain { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.nxa-pickmain strong { font-size: 13px; font-weight: 600; }
.nxa-pickmain small { font-size: 11px; color: var(--muted); }

.nxa-pickpos {
	flex: none;
	width: 48px;
	padding: 6px 8px;
	border: 1px solid var(--line);
	border-radius: 7px;
	font-family: inherit;
	font-size: 12px;
	text-align: center;
}

/* The link, and what you can do with it. */
.nxa-linkcard { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.nxa-linkcard-main { flex: 1; min-width: 260px; }
.nxa-linkcard-main .nxa-hint { margin: 8px 0 0; }

.nxa-linkurl {
	display: block;
	margin-top: 6px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12.5px;
	color: var(--clay);
	word-break: break-all;
}

.nxa-linkcard-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Builder beside preview. Collapses below the form on anything narrow,
   because the officer doing this on a phone needs the fields, not the
   picture of the fields. */
.nxa-staycols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.nxa-col--preview { position: sticky; top: 20px; }
.nxa-previewhead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }

.nxa-preview {
	width: 100%;
	height: 760px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--ink);
}

.nxa-tag--draft { background: var(--paper); color: var(--muted); }
.nxa-tag--sent { background: #ecedef; color: var(--muted); }
.nxa-tag--viewed { background: #fbe5d6; color: var(--clay); }
.nxa-tag--revoked { background: #fbe3dd; color: var(--danger); }

.nxa-table tr.is-past td { opacity: 0.55; }

@media (max-width: 1080px) {
	.nxa-staycols { grid-template-columns: minmax(0, 1fr); }
	.nxa-col--preview { position: static; }
	.nxa-preview { height: 560px; }
}

/* =========================================================================
 * Bookings — the queue, one booking, the timeline, the lapsed decision
 *
 * Phase 5. Written against what the engine does rather than against the
 * Phase 3 drawings, two of whose states turned out not to exist: a
 * lapsed booking owning some of its nights, and a bar on the timeline
 * for a booking that owns none.
 * ====================================================================== */

.nxa-navcount {
	margin-left: auto;
	min-width: 20px; padding: 1px 6px; border-radius: 10px;
	background: var(--danger); color: #fff;
	font-size: 11px; font-weight: 700; text-align: center;
}

/* ---- bands ---------------------------------------------------------- */

.nxa-band { margin: 0 0 26px; }
.nxa-band-title {
	display: flex; align-items: center; gap: 8px;
	font-size: 15px; font-weight: 600; margin: 0 0 2px;
}
.nxa-band-count {
	min-width: 20px; padding: 1px 7px; border-radius: 10px;
	background: var(--line); color: var(--muted);
	font-size: 11px; font-weight: 700; text-align: center;
}
.nxa-band-why { margin: 0 0 10px; font-size: 12px; color: var(--muted); }

/*
 * The band that must not be scrolled past. Everything in it is somebody's
 * money sitting against nights that are not safe.
 */
.nxa-band--decide .nxa-band-count { background: var(--danger); color: #fff; }
.nxa-band--decide .nxa-row { border-left: 3px solid var(--danger); }
.nxa-band--soon .nxa-row { border-left: 3px solid var(--peach); }
.nxa-band--said .nxa-row { border-left: 3px solid var(--clay); }
.nxa-band--owed .nxa-row { border-left: 3px solid #c9772f; }

.nxa-rows { display: flex; flex-direction: column; gap: 8px; }

.nxa-row {
	display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
	padding: 12px 14px;
	background: var(--white); border: 1px solid var(--line); border-radius: 10px;
	color: inherit; text-decoration: none;
}
.nxa-row:hover { border-color: #cfcfd4; }
.nxa-row-main { min-width: 0; }
.nxa-row-who { display: block; font-weight: 600; font-size: 14px; }
.nxa-row-where { display: block; font-size: 12px; color: var(--muted); margin: 1px 0 4px; }
.nxa-row-say { display: block; font-size: 12.5px; }
.nxa-row-side { text-align: right; flex: 0 0 auto; }
.nxa-row-money { display: block; font-size: 13px; font-weight: 600; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.nxa-row-ref { display: block; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }

.nxa-chip {
	display: inline-block; padding: 2px 8px; border-radius: 10px;
	font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
	background: var(--line); color: var(--muted);
}
.nxa-chip--held     { background: #fbefe6; color: #8a4a20; }
.nxa-chip--expired  { background: #fbe9e4; color: #a9391f; }
.nxa-chip--lapsed   { background: var(--danger); color: #fff; }
.nxa-chip--reserved { background: #e8f2ec; color: #235842; }
.nxa-chip--paid     { background: #dcebe3; color: #1d4a36; }
.nxa-chip--completed{ background: var(--line); color: var(--muted); }
.nxa-chip--cancelled{ background: #f1f1f2; color: #8a8f94; }
.nxa-chip--blocked  { background: #ecebf4; color: #4b4080; }

.nxa-card--alert { border-color: #e9c9c1; background: #fdf6f4; }
.nxa-card--do { display: block; }
.nxa-card--danger { border-color: #e9c9c1; }

.nxa-problems { margin: 8px 0 0; padding: 0 0 0 18px; font-size: 12.5px; }
.nxa-problems li { margin: 0 0 4px; }
.nxa-problems .is-bad { color: var(--danger); font-weight: 600; }

/* ---- one booking ---------------------------------------------------- */

.nxa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 14px; }
@media (max-width: 860px) { .nxa-grid { grid-template-columns: 1fr; } }

.nxa-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }

.nxa-dl { margin: 0; }
.nxa-dl > div {
	display: flex; gap: 14px; padding: 7px 0;
	border-bottom: 1px solid var(--line); font-size: 13px;
}
.nxa-dl > div:last-child { border-bottom: 0; }
.nxa-dl dt { flex: 0 0 110px; color: var(--muted); margin: 0; font-size: 12px; }
.nxa-dl dd { margin: 0; min-width: 0; }
.nxa-dl--money dd { font-variant-numeric: tabular-nums; font-weight: 600; }

.nxa-lines { list-style: none; margin: 10px 0 0; padding: 0; }
.nxa-lines li {
	display: flex; justify-content: space-between; gap: 12px;
	padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.nxa-lines li:last-child { border-bottom: 0; }
.nxa-lines li span:last-child { font-variant-numeric: tabular-nums; }

.nxa-fields { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.nxa-fields label { display: flex; flex-direction: column; gap: 3px; flex: 1 1 150px; }
.nxa-fields label span { font-size: 11.5px; color: var(--muted); }
.nxa-fields input, .nxa-fields select {
	padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
	font-family: var(--body); font-size: 14px; background: var(--white);
}
.nxa-note { display: flex; flex-direction: column; gap: 3px; margin: 0 0 10px; }
.nxa-note span { font-size: 11.5px; color: var(--muted); }
.nxa-note input {
	padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
	font-family: var(--body); font-size: 14px;
}
.nxa-tick { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: 12.5px; }
.nxa-tick input { margin-top: 2px; }

.nxa-btn--go { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.nxa a.nxa-btn--go, .nxa a.nxa-btn--go:hover, .nxa a.nxa-btn--go:focus { color: #fff; }
.nxa-btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }

/* ---- the lapsed night list ------------------------------------------ */

.nxa-nights { list-style: none; margin: 10px 0; padding: 0; }
.nxa-nights li {
	display: flex; gap: 14px; align-items: baseline;
	padding: 8px 10px; border-radius: 8px; margin: 0 0 4px; font-size: 13px;
}
.nxa-nights .nxa-night-date { flex: 0 0 110px; font-weight: 600; }
.nxa-nights .nxa-night-who { color: var(--muted); font-size: 12.5px; }
/* Free is the alarming one here, not the taken one: it means anybody can
   still take it while the officer is on the phone. */
.nxa-nights li.is-free { background: #fbefe6; }
.nxa-nights li.is-free .nxa-night-who { color: #8a4a20; font-weight: 600; }
.nxa-nights li.is-gone, .nxa-nights li.is-held { background: #f6f6f7; }

/* ---- the timeline --------------------------------------------------- */

.nxa-tl-wrap { overflow-x: auto; }
.nxa-tl { --nxa-cell: 30px; --nxa-name: 170px; min-width: max-content; }

.nxa-tl-head, .nxa-tl-row { display: flex; align-items: stretch; }
.nxa-tl-name {
	flex: 0 0 var(--nxa-name); width: var(--nxa-name);
	display: flex; align-items: center; gap: 6px;
	padding: 6px 10px 6px 0; font-size: 12.5px; font-weight: 600;
	border-right: 1px solid var(--line);
}
.nxa-tl-off {
	font-size: 10px; font-weight: 700; text-transform: uppercase;
	background: var(--line); color: var(--muted); padding: 1px 5px; border-radius: 4px;
}

.nxa-tl-day {
	flex: 0 0 var(--nxa-cell); width: var(--nxa-cell);
	display: flex; flex-direction: column; align-items: center;
	padding: 4px 0; font-size: 10.5px; color: var(--muted);
	border-left: 1px solid var(--line);
}
.nxa-tl-num { font-weight: 700; color: var(--ink); font-size: 11.5px; }

/*
 * FRIDAY AND SATURDAY, not Saturday and Sunday.
 *
 * These are the nights nxp_is_weekend_night() charges a premium for. The
 * drawn version shaded Sat/Sun, which puts the stripe one day out from
 * the money on the one screen somebody checks the money against.
 */
.nxa-tl-day.is-premium, .nxa-tl-cell.is-premium { background: #faf6f2; }
.nxa-tl-day.is-today, .nxa-tl-cell.is-today { background: #eef4fb; }

.nxa-tl-row { border-top: 1px solid var(--line); }
.nxa-tl-track {
	position: relative; display: flex;
	flex: 1 1 auto; min-height: 34px;
}
.nxa-tl-cell {
	flex: 0 0 var(--nxa-cell); width: var(--nxa-cell);
	border-left: 1px solid var(--line);
}

.nxa-tl-bar {
	position: absolute; top: 4px; bottom: 4px;
	left: calc(var(--s) * var(--nxa-cell));
	width: calc(var(--n) * var(--nxa-cell) - 2px);
	display: flex; align-items: center;
	padding: 0 6px; border-radius: 5px;
	font-size: 11px; font-weight: 600; color: #fff; text-decoration: none;
	overflow: hidden; white-space: nowrap;
}
.nxa-tl-bar span { overflow: hidden; text-overflow: ellipsis; }
.nxa-tl-bar--firm  { background: #235842; }
.nxa-tl-bar--held  { background: #a9522c; }
.nxa-tl-bar--block { background: #4b4080; }
.nxa-tl-bar:hover { filter: brightness(1.15); }

/*
 * Lapsed sits UNDER the row, never on it. A lapsed booking owns no
 * nights, so a bar would hide that those nights are for sale — and that
 * somebody else may already hold part of the range.
 */
.nxa-tl-flag {
	padding: 5px 10px 5px var(--nxa-name);
	background: #fdf6f4; border-top: 1px dashed #e9c9c1;
	font-size: 11.5px;
}
.nxa-tl-flag a { color: var(--danger); font-weight: 600; text-decoration: none; }

.nxa-tl-key { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.nxa-tl-key span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.nxa-tl-key i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.nxa-tl-key .k-firm { background: #235842; }
.nxa-tl-key .k-held { background: #a9522c; }
.nxa-tl-key .k-block { background: #4b4080; }
.nxa-tl-key .k-premium { background: #faf6f2; border: 1px solid var(--line); }
.nxa-tl-key .nxa-hint { flex-basis: 100%; margin: 4px 0 0; }
