/* Layout and patterns shared by the web admin and link pages. Colours, type and
   components come from tokens.css. */

@import url('fonts.css');

html, body { margin: 0; }
body { min-height: 100vh; background: var(--jh-bg); color: var(--jh-fg); }
a { color: var(--jh-accent); }
a:hover { color: var(--jh-accent-hover); }
a.jh-btn, a.jh-nav-item { color: inherit; text-decoration: none; }
a.jh-btn--primary, a.jh-btn--primary:hover { color: var(--jh-on-accent); }
a.jh-btn--danger { color: var(--jh-danger); }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
legend.jh-h3 { margin-bottom: 10px; }
select.jh-input { padding-right: 8px; }
.jh-scope[data-theme='dark'] { color-scheme: dark; }

/* Stacks and rows */
.jk-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.jk-stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.jk-stack-xs { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.jk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jk-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.jk-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.jk-split > .wide { flex: 3 1 440px; min-width: 0; }
.jk-split > .narrow { flex: 2 1 300px; min-width: 0; }
.jk-split > .half { flex: 1 1 340px; min-width: 0; }
.jk-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: start; }
.jk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.jk-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.jk-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 112px)); gap: 8px; }
.jk-thumbs a, .jk-thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--jh-radius-sm); }
.jk-thumbs--two img { aspect-ratio: auto; height: 120px; }

/* Text */
.jk-sub { color: var(--jh-fg-muted); font-size: 14px; line-height: 1.5; }
.jk-muted { color: var(--jh-fg-muted); }
.jk-strong { font-weight: 600; }
.jk-medium { font-weight: 500; }
.jk-error { color: var(--jh-danger); font-size: 13px; }
.jk-amount { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.jk-tile-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.jk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Cards and notices */
.jk-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.jk-tile { padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.jk-notice { padding: 12px 14px; border-radius: var(--jh-radius-md); background: var(--jh-info-bg); color: var(--jh-fg); font-size: 13px; line-height: 1.45; }
.jk-notice--warn { background: var(--jh-warn-bg); }
.jk-notice--danger { background: var(--jh-danger-bg); }
.jk-table-box { overflow-x: auto; }
.jk-table-box table { min-width: 640px; }
.jk-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; font-size: 14px; line-height: 1.4; }
.jk-kv dt { color: var(--jh-fg-muted); }
.jk-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.jk-line time, .jk-line .end { color: var(--jh-fg-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.jk-line time { font-family: var(--jh-font-mono); }
.jk-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.jk-facts dt { font-size: 12px; }
.jk-facts dd { font-weight: 500; }
.jk-rows > * + * { border-top: 1px solid var(--jh-border); }
.jk-rows > * { padding: 8px 0; }

/* Form fields */
.jk-field { display: flex; flex-direction: column; min-width: 0; }
.jk-hint { color: var(--jh-fg-muted); font-size: 12.5px; margin-top: 6px; line-height: 1.4; }
.jk-check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 14px; }
.jk-check input { width: 18px; height: 18px; }
.jk-option { display: flex; gap: 10px; padding: 10px 12px; min-height: 44px; box-sizing: border-box; border: 1px solid var(--jh-border); border-radius: var(--jh-radius-md); cursor: pointer; }
.jk-option input { margin-top: 3px; }
.jk-option:has(input:checked) { border-color: var(--jh-accent); background: var(--jh-accent-bg); }
.jk-option-title { display: block; font-size: 14px; font-weight: 500; }
.jk-option-sub { display: block; color: var(--jh-fg-muted); font-size: 12.5px; line-height: 1.4; }
.jk-file { position: relative; }
.jk-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.jk-file:focus-within { box-shadow: 0 0 0 3px var(--jh-focus-ring); border-color: var(--jh-accent); }
.jk-textlink { display: flex; align-items: center; padding: 0; border: 0; background: none; color: var(--jh-accent); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.jk-textlink:hover { color: var(--jh-accent-hover); }
.jk-tap { display: inline-flex; align-items: center; min-height: 44px; }

/* Selectable list rows */
.jk-pick { width: 100%; min-height: 56px; box-sizing: border-box; display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 14px 20px; border: 0; border-bottom: 1px solid var(--jh-border); background: transparent; color: var(--jh-fg); font: inherit; text-decoration: none; cursor: pointer; }
.jk-pick:hover { background: var(--jh-bg-alt); }
.jk-pick[aria-current='true'], .jk-pick[aria-pressed='true'] { background: var(--jh-accent-bg); }
.jk-pick:hover, a.jk-pick { color: var(--jh-fg); }
.jk-pick-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Highlighted table rows */
.jh-table tr.jk-row-on td { background: var(--jh-accent-bg); }
.jh-table tr.jk-row-bad td { background: var(--jh-danger-bg); }

/* Job stages */
.jk-stages { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 4px; }
.jk-stages li { padding: 4px 10px; border-radius: var(--jh-radius-pill); font-size: 12px; font-weight: 500; background: var(--jh-bg-alt); color: var(--jh-fg-muted); }
.jk-stages li.done { background: var(--jh-accent-bg); color: var(--jh-accent); }
.jk-stages li.now { background: var(--jh-accent); color: var(--jh-on-accent); }

/* Conversation */
.jk-chat { display: flex; flex-direction: column; gap: 8px; }
.jk-bubble { max-width: 85%; padding: 8px 12px; border-radius: var(--jh-radius-md); background: var(--jh-bg-alt); font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; }
.jk-bubble.out { align-self: flex-end; background: var(--jh-accent-bg); }

/* Paper documents */
.jk-paper { padding: 32px; display: flex; flex-direction: column; gap: 16px; font-size: 13px; line-height: 1.5; box-shadow: var(--jh-shadow-md); }
.jk-paper h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.jk-paper h2 { font-size: 14px; font-weight: 600; }
.jk-paper hr { width: 100%; margin: 0; }
.jk-paper .jk-kv { font-size: 13px; }
.jk-paper .jk-kv dt { color: inherit; opacity: 0.68; }

/* Centred and link pages */
.jk-center { min-height: 100vh; box-sizing: border-box; padding: 24px 16px; display: flex; align-items: center; justify-content: center; background: var(--jh-bg-alt); }
.jk-center > * { width: 100%; max-width: 420px; }
.jk-flow { min-height: 100vh; box-sizing: border-box; padding: 40px 16px; display: flex; justify-content: center; background: var(--jh-bg-alt); }
.jk-flow > * { width: 100%; max-width: 620px; }
.jk-brand { display: flex; align-items: center; gap: 10px; color: var(--jh-accent); }
.jk-brand b { color: var(--jh-fg); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.jk-brand .end { margin-left: auto; color: var(--jh-fg-muted); font-size: 12.5px; }

.jk-link { min-height: 100vh; box-sizing: border-box; background: var(--jh-bg-alt); }
.jk-link-page { max-width: 480px; min-height: 100vh; box-sizing: border-box; margin: 0 auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.jk-link-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.jk-link-actions .jh-btn { height: 52px; font-size: 16px; }
.jk-link-actions p { margin-top: 4px; text-align: center; color: var(--jh-fg-muted); font-size: 12.5px; }
.jk-link-page .jk-brand { gap: 8px; }
.jk-link-page .jk-brand svg { width: 18px; height: 18px; }
.jk-link-page .jk-paper h1 { font-size: 18px; }
.jk-link-page .jk-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jk-link-page .jk-thumbs--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.jk-link-page .jk-thumbs a.jh-small { display: flex; align-items: center; min-height: 44px; }
.jk-public .jh-input:not(.jh-textarea) { height: 44px; font-size: 16px; }
.jk-public .jh-btn--lg { height: 48px; font-size: 16px; }
.jk-result { margin: auto 0; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.jk-result-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--jh-success-bg); color: var(--jh-success); }
.jk-result-icon--muted { background: var(--jh-bg-sunken); color: var(--jh-fg-muted); }
.jk-rating { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.jk-rating .jh-btn { height: 48px; padding: 0; font-size: 16px; }
.jk-radius-map { position: relative; height: 300px; overflow: hidden; }
.jk-radius-map span { position: absolute; left: 10px; bottom: 8px; }
.jk-range { width: 100%; height: 44px; accent-color: var(--jh-accent); }

/* Owner home */
.jk-topbar { padding: 14px 24px; border-bottom: 1px solid var(--jh-border); background: var(--jh-bg-elev); }
.jk-owner { max-width: 960px; margin: 0 auto; box-sizing: border-box; padding: 32px 16px; display: flex; flex-direction: column; gap: 24px; }
