/* /job-quote: schedule builder. Built on the shared tokens in styles.css. */
.jq { padding-bottom: var(--section); }

/* Sticky summary bar */
.jq-bar {
  position: sticky; top: var(--header-height); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 1rem; padding: 10px 14px; border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: linear-gradient(115deg, #f8e9c9 0%, #fbf8f1 50%, #e4edf7 100%);
}
.jq-bar__count { margin: 0; font-weight: 500; color: var(--black); }
.jq-bar .button { flex: none; white-space: nowrap; }
.jq-howto { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.95rem; }

/* Groups */
.jq-groups { display: grid; gap: 16px; }
.jq-group { padding: clamp(16px, 3vw, 24px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.jq-group--strip { border-color: var(--line-strong); box-shadow: inset 3px 0 0 var(--amber); }
.jq-group__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 0.75rem; }
.jq-group__title { margin: 0; font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem); }
.jq-group__count { font-size: 0.85rem; color: var(--muted); }
.jq-group__intro { margin: 0 0 1rem; color: var(--muted); max-width: 46rem; }
.jq-group__cta { margin: 0 0 1rem; }

/* Lines */
.jq-lines { display: grid; gap: 12px; }
.jq-lines:empty { display: none; }
.jq-line { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--stone); transition: box-shadow 0.3s ease, border-color 0.3s ease; }
.jq-line.is-new { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(201, 134, 44, 0.25); }
.jq-line__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.jq-thumb { flex: none; width: 56px; height: 56px; object-fit: contain; border-radius: var(--radius); background: #fff; }
.jq-line__name { flex: 1; min-width: 0; display: grid; }
.jq-line__name a, .jq-line__name strong { font-weight: 600; color: var(--black); }
.jq-line__name span { font-size: 0.85rem; color: var(--muted); }
.jq-remove, .jq-edit {
  flex: none; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff;
  color: var(--ink); font: inherit; font-size: 0.88rem; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer;
}
.jq-remove:hover, .jq-edit:hover { border-color: var(--ink); }
.jq-line__fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.jq-line .field label { margin-bottom: 4px; font-size: 0.8rem; color: var(--muted); }
.jq-line .field input, .jq-line .field select { min-height: 44px; padding: 8px 10px; font-size: 0.95rem; }
.jq-line .field-hint { margin-top: 4px; font-size: 0.78rem; }
.jq-runs { margin: 0 0 8px; padding-left: 1.2rem; font-size: 0.9rem; color: var(--charcoal); }
.jq-line__total { margin: 0; font-weight: 500; }

/* Picker */
.jq-picker { position: relative; margin-top: 12px; max-width: 34rem; }
.jq-picker__label { display: block; margin-bottom: 6px; font-size: 0.92rem; font-weight: 500; }
.jq-picker__input {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: #fff; color: var(--ink); font: inherit; font-size: 1rem;
}
.jq-picker__input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
.jq-picker__list {
  position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; max-height: min(50vh, 360px);
  overflow-y: auto; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 18px 40px -20px rgba(15, 15, 16, 0.4);
}
.jq-picker__list [role="option"] { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: var(--radius); cursor: pointer; }
.jq-picker__list [role="option"]:hover, .jq-picker__list [aria-selected="true"] { background: var(--stone); }
.jq-picker__list [aria-selected="true"] { box-shadow: inset 3px 0 0 var(--amber); }
.jq-picker__list img, .jq-picker__blank { flex: none; width: 40px; height: 40px; object-fit: contain; border-radius: var(--radius); background: var(--stone); }
.jq-picker__list span span, .jq-picker__list [role="option"] > span:last-child { display: grid; min-width: 0; }
.jq-picker__list small { color: var(--muted); font-size: 0.8rem; }
.jq-picker__none { padding: 10px; color: var(--muted); }

/* Quick metres */
.jq-quick { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.jq-quick__row { display: grid; gap: 12px; align-items: end; }
@media (min-width: 720px) { .jq-quick__row { grid-template-columns: 140px 1fr auto; } }

/* Review */
.jq-review { margin-top: clamp(28px, 5vw, 48px); padding: clamp(16px, 3vw, 28px); border-radius: var(--radius-lg); background: var(--stone); }
.jq-empty { color: var(--muted); }
.jq-table-wrap { overflow-x: auto; margin-bottom: 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.jq-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.jq-table th, .jq-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.jq-table thead th { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.jq-table tbody th { font-weight: 600; white-space: nowrap; }
.jq-table tr:last-child > * { border-bottom: 0; }
.jq-num { text-align: right !important; white-space: nowrap; }
.jq-form { display: grid; gap: 16px; }
.jq-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.jq-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; background: var(--cream); border: 1px solid var(--warm); border-radius: var(--radius); }
.jq-confirm[hidden] { display: none; }
.jq-confirm p { margin: 0 auto 0 0; }
.jq-print-details { display: none; margin-bottom: 1rem; font-weight: 500; }

@media (max-width: 480px) {
  .jq-bar { gap: 8px; padding: 8px 10px; }
  .jq-bar__more { display: none; }
  .jq-table { font-size: 0.85rem; }
  .jq-table tbody th { white-space: normal; }
}

@media print {
  .site-header, .site-footer, .skip-link, .breadcrumbs, .jq-bar, .jq-howto, .jq-groups, .jq-tools, .jq-confirm, .form-submit, .form-status, .jq-form, .quote-banner { display: none !important; }
  .page-hero .lede { display: none; }
  .jq-review { background: none; padding: 0; }
  .jq-table-wrap { overflow: visible; border-color: #000; }
  .jq-print-details:not(:empty) { display: block !important; }
}
