/* Worker marketplace (work.html). Extends site.css; only adds what the marketplace needs. */

.work-page :focus-visible { outline: 3px solid rgba(20, 184, 166, 0.6); outline-offset: 2px; border-radius: 6px; }
.work-page input:focus-visible, .work-page select:focus-visible { outline: 3px solid rgba(20, 184, 166, 0.6); outline-offset: 1px; }
.work-page .btn:focus-visible { border-radius: 999px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.work-main { padding: 2.25rem 0 4.5rem; min-height: 60vh; }
.work-head { align-items: flex-end; margin-bottom: 1.25rem; }
.work-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin-bottom: 0.3rem; }
.work-lead { margin: 0; max-width: 60ch; }
.in-work .work-lead, .in-work .work-summary, .in-work .work-head .kicker { display: none; }
.in-work .work-head { margin-bottom: 0.4rem; }
.in-work .work-main { padding-top: 1.4rem; }
.work-page .card:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }
.work-page .card { overflow-wrap: anywhere; }

/* summary pills in the page header */
.work-summary { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.sum-pill { border: 1px solid var(--border); border-radius: 12px; padding: 0.5rem 0.85rem; background: #fff; min-width: 96px; }
.sum-pill .n { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; line-height: 1.1; color: var(--navy); }
.sum-pill .l { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.15rem; }

/* tabs */
.work-tabs { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-bottom: 1.25rem; }
.work-tabs::-webkit-scrollbar { display: none; }
.work-tabs .tab { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.work-tabs .tab:hover { color: var(--accent-dark); }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.3rem; height: 1.3rem; padding: 0 0.35rem; border-radius: 999px; background: var(--bad); color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1; }
#badge-working { background: var(--accent-dark); }

.panel-title { font-size: 1.35rem; margin: 0 0 0.9rem; outline: none; }
.sub-title { font-size: 1.05rem; margin: 1.6rem 0 0.7rem; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.6rem; }
.sub-head .sub-title { margin: 0 0 0.7rem; }
#work-notice { margin-bottom: 1rem; }
.work-banner { margin-bottom: 1.25rem; }

/* check label */
.check { display: flex; align-items: flex-start; gap: 0.6rem; font-weight: 500; font-size: 0.95rem; cursor: pointer; margin: 0; }
.check input { width: 1.1rem; height: 1.1rem; margin: 0.2rem 0 0; accent-color: var(--accent-dark); flex: none; }

/* toolbar */
.hit-toolbar { display: flex; flex-wrap: wrap; gap: 0.9rem 1.1rem; align-items: flex-end; background: var(--bg-alt); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 0.8rem; }
.hit-toolbar label:not(.check), .tb-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.3rem; }
.tb-search { flex: 1 1 240px; min-width: 0; }
.tb-sort { flex: 0 1 190px; }
.tb-min { flex: 0 1 130px; }
.tb-qual { flex: 0 0 auto; align-self: center; padding-top: 1.1rem; }
.tb-refresh { align-self: flex-end; margin-bottom: 0.15rem; }
.hit-toolbar input, .hit-toolbar select { height: 2.6rem; padding: 0 0.75rem; }
.hit-toolbar input[type="number"] { padding-right: 0.4rem; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; background: #fff; }
.seg button { border: 0; background: transparent; padding: 0.4rem 1rem; border-radius: 999px; font: inherit; font-weight: 700; font-size: 0.9rem; color: var(--text-dim); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.seg button[data-env="production"][aria-pressed="true"] { background: var(--grad-btn); }
.env-note { margin: 0 0 0.3rem; }
#hits-count { margin: 0 0 0.8rem; min-height: 1.2em; }

/* HIT cards */
.hit-card, .work-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem 1.4rem; padding: 1.2rem 1.35rem; margin-bottom: 0.9rem; }
.hit-title { font-size: 1.1rem; margin: 0 0 0.35rem; }
.hit-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; font-size: 0.88rem; color: var(--text-dim); align-items: center; }
.hit-meta .ic { vertical-align: -3px; }
.k { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dimmer); margin-right: 0.25rem; }
.hit-desc { margin: 0.6rem 0 0; color: var(--text); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hit-desc.open { display: block; -webkit-line-clamp: unset; }
.link-btn { background: none; border: 0; padding: 0.15rem 0; margin: 0.1rem 0 0; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--accent-dark); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn[hidden] { display: none; }
.hit-keys { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.6rem; }
.hit-keys .chip { margin: 0; }
.hit-reqs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.4rem; margin-top: 0.7rem; }
.hit-reqs .k { margin-right: 0.15rem; }
.hit-reqs .chip { margin: 0; }
.chip .ic { vertical-align: -2px; margin-right: 0.25rem; }
.chip.req { display: inline-flex; align-items: center; }
.chip.locked { background: #eceff3; color: #5a6673; }
.hit-badges { display: flex; gap: 0.3rem; margin-bottom: 0.4rem; }
.hit-badges .chip { margin: 0; }
.hit-reward { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.hit-reward .amt { font-family: var(--font-head); font-weight: 700; font-size: 1.9rem; line-height: 1; color: var(--accent-dark); }
.hit-reward .per { font-size: 0.75rem; color: var(--text-dimmer); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.25rem; }
.hit-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.7rem; }
.lock-note { font-size: 0.85rem; color: var(--text-dim); display: inline-flex; align-items: flex-start; gap: 0.35rem; min-width: 0; line-height: 1.35; }
.lock-note .ic { flex: none; margin-top: 0.15rem; }
.notice-btn { margin-left: 0.3rem; vertical-align: middle; }

.btn.is-disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn.is-disabled:hover { transform: none; }
.btn.dark:hover { color: #fff; }

/* loading skeleton */
.hit-skel { display: grid; gap: 0.7rem; padding: 1.3rem 1.4rem; margin-bottom: 0.9rem; }
.sk { display: block; height: 0.9rem; border-radius: 6px; background: linear-gradient(90deg, #eef2f4 25%, #f8fafb 50%, #eef2f4 75%); background-size: 200% 100%; animation: sk-shimmer 1.4s ease-in-out infinite; }
@keyframes sk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* empty states */
.empty { text-align: center; padding: 2.2rem 1.4rem; display: grid; justify-items: center; gap: 0.2rem; }
.empty h3 { margin: 0.2rem 0 0.2rem; }
.empty p { max-width: 46ch; margin: 0 0 0.8rem; }
.empty-ic { color: var(--accent-dark); }

/* work view */
.work-back { margin-bottom: 0.8rem; }
.work-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 1.6rem; align-items: center; padding: 1.1rem 1.3rem; margin-bottom: 0.9rem; }
.work-title { font-size: 1.35rem; margin: 0 0 0.35rem; outline: none; max-width: none; }
.work-side { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; justify-content: flex-end; }
.work-clock { display: grid; text-align: right; }
.work-clock .l { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dimmer); font-weight: 700; }
.work-timer { font-family: var(--font-head); font-weight: 700; font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--navy); }
.work-timer.sm { font-size: 1.15rem; }
.work-timer.urgent { color: var(--bad); animation: timer-pulse 1s ease-in-out infinite; }
.work-timer.done { color: var(--ok); font-size: 1.4rem; }
.work-timer.expired { animation: none; }
.work-frame.is-expired { opacity: 0.45; filter: grayscale(1); pointer-events: none; }
@keyframes timer-pulse { 50% { opacity: 0.55; } }
.work-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.work-controls .btn.lg { align-self: stretch; }
.work-page .work-bar .work-controls > .lock-note { max-width: 24ch; }
/* the return note sits in the auto-width column: without a cap its long text takes the whole row and squeezes the title */
.work-controls .work-return-note { max-width: 30ch; margin: 0; line-height: 1.35; }
/* work card: colour by environment, meta as coloured chips, the clock in its own box, and Return where it can be seen */
.work-bar { border-left: 5px solid var(--accent); background: linear-gradient(90deg, rgba(20, 184, 166, 0.10), #fff 48%); }
.work-bar.is-sandbox { border-left-color: #f59e0b; background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), #fff 48%); }
.work-title { color: var(--navy); }
.hit-meta .wm { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.7rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; background: #eef2f6; color: #334155; }
.hit-meta .wm .k { text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.06em; font-weight: 700; opacity: 0.75; }
.hit-meta .wm .ic { vertical-align: 0; flex: none; }
.hit-meta .wm.req { background: #e3edff; color: #1e40af; }
.hit-meta .wm.reward { background: #dcfce7; color: #166534; font-size: 0.98rem; }
.hit-meta .wm.hits { background: #ede9fe; color: #5b21b6; }
.hit-meta .wm.time { background: #e0f2fe; color: #075985; }
.work-bar .work-clock { background: var(--navy); border-radius: 14px; padding: 0.55rem 1.1rem 0.6rem; text-align: center; min-width: 8.6rem; box-shadow: 0 6px 16px rgba(15, 30, 53, 0.2); }
.work-bar .work-clock .l { color: #93a4bb; }
.work-bar .work-clock .work-timer { color: #5eead4; }
.work-bar .work-clock .work-timer.done { color: #86efac; }
.work-bar .work-clock:has(.work-timer.urgent) { background: #7f1d1d; }
.work-bar .work-clock .work-timer.urgent { color: #fecaca; }
.btn.return { background: #fff7ed; color: #c2410c; border: 1.5px solid #fb923c; padding: 0.55rem 1.1rem; font-size: 0.92rem; }
.btn.return:hover { background: #f97316; border-color: #f97316; color: #fff; }
.btn.return.is-disabled:hover { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
.work-return-note.is-warn { display: flex; font-size: 0.82rem; line-height: 1.3; gap: 0.45rem; align-items: flex-start; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 0.5rem 0.65rem; color: #9a3412; }
.work-return-note .ic { flex: none; margin-top: 0.1rem; }
.work-preview-note { margin-bottom: 0.9rem; }
.work-reqs { margin-bottom: 0.9rem; padding: 0.9rem 1.2rem; }
.work-reqs .hit-reqs { margin-top: 0; }
#work-strip { margin: 0; }
#work-strip .notice, #work-msg { margin-bottom: 0.9rem; }
.work-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.7rem 1.2rem; position: relative; }
.strip-actions { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; }
.strip-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(6, 95, 70, 0.15); border-radius: 0 0 10px 10px; overflow: hidden; }
.strip-bar > span { display: block; height: 100%; width: 100%; background: var(--ok); transform-origin: left; animation: strip-run linear forwards; }
@keyframes strip-run { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.work-frame-wrap { border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: auto; resize: vertical; min-height: 220px; max-width: 100%; box-shadow: var(--shadow-sm); }
.work-frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.work-foot { margin: 0.6rem 0 0; }
/* compact timer that slides in once the main bar has scrolled away; it takes no layout space */
.work-mini-anchor { position: sticky; top: 68px; height: 0; z-index: 20; }
.work-mini { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 0.9rem; padding: 0.35rem 1rem; background: #fff; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 12px 12px; box-shadow: var(--shadow); transform: translateY(-110%); opacity: 0; pointer-events: none; transition: transform 0.2s ease, opacity 0.2s ease; }
.work-mini.show { transform: none; opacity: 1; }
.mini-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 0.9rem; }
.mini-reward { font-family: var(--font-head); font-weight: 700; color: var(--accent-dark); }
@media (prefers-reduced-motion: reduce) { .work-mini { transition: none; } }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 0.6rem; background: none; border: 0; padding: 0.15rem 0; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.sw-track { width: 40px; height: 22px; border-radius: 999px; background: #c8d1d8; position: relative; flex: none; transition: background 0.2s; }
.sw-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 30, 53, 0.3); transition: transform 0.2s; }
.switch[aria-checked="true"] .sw-track { background: var(--accent-dark); }
.switch[aria-checked="true"] .sw-knob { transform: translateX(18px); }

/* working list items */
.work-item .wi-side { display: grid; justify-items: end; gap: 0.5rem; }
.wi-clock { text-align: right; }
.wi-clock .l { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dimmer); font-weight: 700; margin-right: 0.3rem; }
.work-item .hit-title { margin-bottom: 0.3rem; }

/* history */
.hist-summary { margin-bottom: 1.4rem; }
.hist-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.hist-stats .stat { padding: 0.95rem 1.1rem; }
.hist-stats .stat .n { font-size: 1.6rem; }
.hist td, .q-table td { font-size: 0.92rem; }
.hist .c-fb { max-width: 34ch; }
.hist td .chip { margin: 0; }

/* qualifications */
.qual-grid { align-items: stretch; }
.qual-card { display: flex; flex-direction: column; }
.qual-card .hit-title { margin-bottom: 0.1rem; }
.qual-desc { margin: 0.6rem 0 0; font-size: 0.95rem; }
.qual-card .hit-actions { margin-top: auto; padding-top: 0.9rem; }
.test-panel { padding: 1.1rem 1.3rem 1.3rem; margin-bottom: 1.4rem; border-color: rgba(20, 184, 166, 0.5); }
.test-panel .work-bar { padding: 0; box-shadow: none; border: 0; position: static; margin-bottom: 0.8rem; }

/* messages */
.msg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.msg { padding: 1.1rem 1.3rem; }
.msg.unread { border-color: rgba(20, 184, 166, 0.55); background: #f4fcfa; }
.msg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.2rem; }
.msg-subject { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.msg .chip { margin: 0; flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2); }
.msg-body { margin: 0.6rem 0 0; white-space: pre-wrap; }

/* profile */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.profile-grid dl.summary { grid-template-columns: auto minmax(0, 1fr); }

/* confirm dialog */
.work-dialog { border: 0; border-radius: 16px; padding: 0; width: min(440px, calc(100% - 2rem)); box-shadow: var(--shadow-md); color: var(--text); }
.work-dialog::backdrop { background: rgba(15, 30, 53, 0.55); }
.work-dialog .inner { padding: 1.5rem; }
.work-dialog h3 { margin: 0 0 0.5rem; }
.dialog-actions { justify-content: flex-end; margin-top: 1.2rem; }

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .hist-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .work-main { padding-top: 1.4rem; }
  .work-lead { display: none; }
  .work-head { align-items: stretch; }
  .work-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .sum-pill { min-width: 0; padding: 0.45rem 0.6rem; }
  .sum-pill .n { font-size: 1.05rem; }
  .sum-pill .l { font-size: 0.62rem; letter-spacing: 0.03em; }
  .hit-toolbar { padding: 0.9rem; gap: 0.75rem; }
  .tb-env, .tb-search { flex: 1 1 100%; }
  .tb-sort, .tb-min { flex: 1 1 calc(50% - 0.5rem); }
  .tb-qual { padding-top: 0; flex: 1 1 auto; }
  .tb-refresh { margin-left: auto; }
  .hit-card, .work-item { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
  .hit-reward { grid-row: 1; align-items: flex-start; text-align: left; flex-direction: row; align-items: baseline; gap: 0.5rem; }
  .hit-reward .amt { font-size: 1.6rem; }
  .work-item .wi-side { justify-items: start; grid-row: 2; grid-template-columns: auto 1fr; align-items: center; gap: 0.6rem 1rem; }
  .wi-clock { text-align: left; }
  .hit-actions .btn { flex: 1 1 auto; }
  .work-bar { grid-template-columns: minmax(0, 1fr); padding: 1rem; gap: 0.7rem; }
  .work-side { justify-content: space-between; align-items: center; }
  .work-clock { text-align: left; }
  .work-controls { align-items: stretch; width: 100%; }
  .work-side.live { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem 1rem; align-items: center; width: 100%; }
  .work-side.live .work-controls { display: contents; }
  .work-side.live .work-clock { grid-column: 1; grid-row: 1; }
  .work-side.live [data-act="return"] { grid-column: 2; grid-row: 1; }
  .work-side.live .switch { grid-column: 1 / -1; grid-row: 2; }
  .work-title { font-size: 1.2rem; }
  .hist-summary { padding: 0.9rem; }
  .strip-actions { width: 100%; }
  .strip-actions .btn { flex: 1 1 auto; }
  .hist-stats { gap: 0.6rem; }
  .hist-stats .stat { padding: 0.75rem; }
  .hist-stats .stat .n { font-size: 1.3rem; }

  /* tables turn into stacked cards on phones so nothing scrolls sideways */
  .hist.table-wrap, .table-wrap:has(.q-table) { border: 0; background: transparent; overflow: visible; }
  .hist table, .q-table { min-width: 0; }
  .hist thead, .q-table thead { display: none; }
  .hist table, .hist tbody, .hist tr, .hist td, .q-table, .q-table tbody, .q-table tr, .q-table td { display: block; width: 100%; }
  .hist tr, .q-table tr { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; margin-bottom: 0.7rem; padding: 0.55rem 0.2rem; box-shadow: var(--shadow-sm); }
  .hist td, .q-table td { border: 0; padding: 0.3rem 0.9rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-align: right; }
  .hist td::before, .q-table td::before { content: attr(data-label); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dimmer); text-align: left; flex: none; }
  .hist td.c-title, .q-table td.c-title { display: block; text-align: left; }
  .hist td.c-title::before, .q-table td.c-title::before { content: none; }
  .hist .c-fb { max-width: none; }
  .msg { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sk, .work-timer.urgent, .strip-bar > span { animation: none; }
  .strip-bar > span { transform: none; }
  .sw-track, .sw-knob { transition: none; }
}

/* ------------------------------------------------------------------ HIT groups table */
.work-idbar { margin: 0 0 0.9rem; }
.work-idbar code { background: var(--bg-alt); padding: 0.1rem 0.45rem; border-radius: 6px; font-size: 0.85rem; user-select: all; color: var(--text); }

.hit-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.5rem 1.2rem; margin: 0.3rem 0 0.7rem; }
.hit-groups-title { margin: 0; font-size: 1.35rem; color: var(--navy); }
.hit-range { font-size: 1rem; font-weight: 500; color: var(--text-dim); margin-left: 0.25rem; }
.hit-head-tools { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.link-btn.tool { text-decoration: none; color: var(--text-dim); font-weight: 600; margin: 0; padding: 0.3rem 0; }
.link-btn.tool:hover { color: var(--accent-dark); text-decoration: underline; }
.tool-sep { width: 1px; height: 1.3rem; background: var(--border); }
.tool-label { font-size: 0.85rem; color: var(--text-dim); margin: 0; }
.tool-select { width: auto; height: 2.1rem; padding: 0 1.8rem 0 0.7rem; }

.hit-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--shadow-sm); }
.hit-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 0.93rem; min-width: 0; }
.hit-table col.col-req { width: 17%; }
.hit-table col.col-num { width: 6.2rem; }
.hit-table col.col-when { width: 6.6rem; }
.hit-table col.col-act { width: 15.8rem; }
.hit-table thead th { background: var(--bg-alt); color: var(--text-dimmer); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; padding: 0.65rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
.hit-table th.c-num, .hit-table td.c-num { text-align: right; }
.hit-table th.c-act { text-align: right; }
.hit-table td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
.hit-table tbody tr:last-child td { border-bottom: 0; }
.hit-row:hover td { background: #f6fbfa; }
.hit-row.is-locked td { background: #f7f8fa; }
.hit-row.is-locked:hover td { background: #f1f4f6; }
.hit-row.is-locked .hit-title-text { color: var(--text-dim); }
.hit-title-text { font-weight: 600; }
.c-num { font-variant-numeric: tabular-nums; }
.c-reward { font-family: var(--font-head); font-weight: 700; color: var(--accent-dark); }
.hit-row.is-locked .c-reward { color: var(--text-dim); }
.c-when { color: var(--text-dim); white-space: nowrap; }

.row-toggle { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; padding: 0; border: 0; background: none; color: var(--text-dimmer); cursor: pointer; border-radius: 50%; vertical-align: middle; margin-right: 0.3rem; }
.row-toggle:hover { color: var(--accent-dark); }
.row-toggle .ic { grid-area: 1 / 1; vertical-align: middle; }
.row-toggle .ic + .ic { display: none; }
.row-toggle[aria-expanded="true"] .ic:first-child { display: none; }
.row-toggle[aria-expanded="true"] .ic + .ic { display: block; }
.req-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent-dark); cursor: pointer; text-align: left; vertical-align: middle; }
.req-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.th-sort { display: inline-flex; align-items: center; gap: 0.35rem; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; font-weight: 700; cursor: pointer; }
.th-sort:hover { color: var(--accent-dark); }
.th-sort .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #b8c2cc; }
.th-sort.on .caret { border-top-color: var(--accent-dark); }
.th-sort.on.asc .caret { border-top: 0; border-bottom: 5px solid var(--accent-dark); }

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.row-actions .btn.sm { white-space: nowrap; }
.qualify-link { display: inline-flex; align-items: center; gap: 0.3rem; background: none; border: 0; padding: 0.4rem 0.5rem; font: inherit; font-weight: 600; font-size: 0.88rem; color: var(--accent-dark); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.qualify-link:hover { color: var(--navy); }

.hit-detail td { background: #fbfcfd; padding: 0.15rem 0.8rem 1rem 3.1rem; }
.hit-detail[hidden] { display: none; }
.hit-desc-full { margin: 0.5rem 0 0.7rem; max-width: 80ch; }
.hit-facts { display: flex; flex-wrap: wrap; gap: 0.4rem 2.2rem; margin: 0 0 0.7rem; }
.hit-facts dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dimmer); font-weight: 700; }
.hit-facts dd { margin: 0.1rem 0 0; }
.hit-detail .hit-keys { margin-top: 0; margin-bottom: 0.6rem; }

.pager { margin: 1.1rem 0 0; }
.pager-row { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; align-items: center; }
.pg { min-width: 2.3rem; height: 2.3rem; padding: 0 0.75rem; border: 1px solid var(--border); background: #fff; border-radius: 8px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.pg:hover:not(:disabled):not(.cur) { border-color: var(--accent); color: var(--accent-dark); }
.pg.cur { background: var(--navy); color: #fff; border-color: var(--navy); cursor: default; }
.pg:disabled { opacity: 0.45; cursor: not-allowed; }
.pg-gap { color: var(--text-dimmer); padding: 0 0.15rem; }
.pager-note { text-align: center; margin: 0.7rem 0 0; }

/* sub navigation (dashboard, qualifications) */
.sub-seg { margin: 0 0 1.1rem; }
.sub-seg button .tab-badge.count { background: var(--accent-dark); margin-left: 0.4rem; height: 1.15rem; min-width: 1.15rem; font-size: 0.68rem; }
.qual-subhead { margin-top: 0; margin-bottom: 1rem; flex-wrap: wrap; }
.qual-subhead .sub-seg { margin: 0; }

/* dashboard overview */
.ov-head { display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.ov-head .sub-seg { margin: 0; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.2rem; align-items: start; }
.ov-main, .ov-side { display: grid; gap: 1.2rem; min-width: 0; }
.ov-card { padding: 1.1rem 1.25rem 1.2rem; }
.ov-title { font-size: 1.2rem; margin: 0 0 0.8rem; color: var(--navy); }
.ov-sub { font-family: var(--font-body, inherit); font-size: 0.82rem; font-weight: 500; color: var(--text-dim); margin-left: 0.4rem; }
.ov-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.8rem; }
.ov-row .ov-title { margin: 0; }
.ov-view { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--text-dim); margin: 0; }
.ov-view select { width: auto; height: 2.1rem; padding: 0 1.8rem 0 0.6rem; }
.dash-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.dash-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 0.92rem; }
.dash-table th, .dash-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); text-align: left; }
.dash-table thead th { background: var(--bg-alt); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dimmer); white-space: nowrap; }
.dash-table tbody th { font-weight: 500; }
.dash-table .c-n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-table tbody tr:last-child > * { border-bottom: 0; }
.dash-table .strong, .kv .strong { font-weight: 700; }
.kv { margin: 0; display: grid; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv dd.big { font-family: var(--font-head); font-size: 1.6rem; color: var(--navy); }
.ov-note { margin: 0.6rem 0 0; }

/* qualification tables */
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.q-head .sub-title { margin: 0; }
.q-tools { display: flex; gap: 1rem; }
.qa-table td.c-title { font-weight: 600; }
.q-detail[hidden] { display: none; }
.q-detail td { background: #fbfcfd; padding: 0.1rem 0.8rem 0.9rem 3.1rem; }
.qual-card.flash { animation: q-flash 2.4s ease 1; }
@keyframes q-flash { 0%, 60% { box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.55); } 100% { box-shadow: var(--shadow-sm); } }

@media (max-width: 1080px) {
  .hit-table col.col-req { width: 15%; }
  .hit-table col.col-act { width: 14.2rem; }
  .hit-table td, .hit-table thead th { padding-left: 0.6rem; padding-right: 0.6rem; }
}

@media (max-width: 900px) {
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
}

/* the table turns into stacked cards on phones and small tablets */
@media (max-width: 860px) {
  .hit-head { align-items: flex-start; }
  .hit-table-wrap { border: 0; background: transparent; overflow: visible; box-shadow: none; }
  .hit-table, .hit-table tbody { display: block; }
  .hit-table thead, .hit-table colgroup { display: none; }
  .hit-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem 0.8rem; margin-top: 0.75rem; padding: 0.85rem 1rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
  .hit-row:has(+ .hit-detail:not([hidden])) { border-radius: var(--radius) var(--radius) 0 0; box-shadow: none; }
  .hit-row.is-locked { background: #f7f8fa; }
  .hit-row td { display: block; border: 0; padding: 0; background: transparent !important; }
  .hit-row .c-req { grid-column: 1 / -1; }
  .hit-row .c-title { grid-column: 1 / -1; }
  .hit-row td.c-num, .hit-row td.c-when { text-align: left; }
  .hit-row td.c-num::before, .hit-row td.c-when::before { content: attr(data-label); display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dimmer); font-weight: 700; }
  .hit-row .c-act { grid-column: 1 / -1; margin-top: 0.4rem; }
  .row-actions { justify-content: stretch; }
  .row-actions .btn { flex: 1 1 auto; }
  .hit-detail { display: block; }
  .hit-detail[hidden] { display: none; }
  .hit-detail:not([hidden]) { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: #fbfcfd; margin-bottom: 0; box-shadow: var(--shadow-sm); }
  .hit-detail td { display: block; padding: 0.1rem 1rem 0.9rem; background: transparent; border: 0; }
  .hit-table tbody tr:last-child td { border-bottom: 0; }

  .qa-table thead { display: none; }
  .qa-table, .qa-table tbody { display: block; }
  .dash-table-wrap:has(.qa-table) { border: 0; background: transparent; overflow: visible; }
  .qa-table .q-row { display: block; border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; background: #fff; margin-top: 0.7rem; padding: 0.5rem 0; }
  .qa-table .q-row:has(+ .q-detail[hidden]) { border-radius: var(--radius); }
  .qa-table .q-row td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border: 0; padding: 0.25rem 0.9rem; text-align: right; }
  .qa-table .q-row td::before { content: attr(data-label); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dimmer); text-align: left; flex: none; }
  .qa-table .q-row td.c-title { display: block; text-align: left; font-weight: 700; }
  .qa-table .q-row td.c-title::before { content: none; }
  .qa-table .q-detail:not([hidden]) { display: block; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: #fbfcfd; }
  .qa-table .q-detail td { display: block; padding: 0.1rem 0.9rem 0.8rem; border: 0; }
  .ov-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .qual-card.flash { animation: none; } }

/* grid children must be allowed to shrink so wide tables scroll inside their card instead of overflowing it */
.ov-main > *, .ov-side > * { min-width: 0; }
.dash-table.wide { min-width: 600px; }
.per-page { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.hit-head { margin-top: 1.1rem; }
.q-detail .hit-desc-full { margin: 0.45rem 0 0.1rem; }
.dash-table tbody th.c-date { white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .dash-table.wide { min-width: 0; }
  .dash-table.wide thead { display: none; }
  .dash-table.wide, .dash-table.wide tbody { display: block; }
  .dash-table-wrap:has(.wide) { border: 0; background: transparent; overflow: visible; }
  .dash-table.wide tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.35rem 0.6rem; padding: 0.75rem 0.85rem; margin-bottom: 0.55rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
  .dash-table.wide tbody th.c-date { grid-column: 1 / -1; padding: 0; border: 0; font-weight: 700; }
  .dash-table.wide td { border: 0; padding: 0; text-align: left; }
  .dash-table.wide td::before { content: attr(data-label); display: block; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dimmer); font-weight: 700; }
}

.req-cell { display: flex; align-items: flex-start; gap: 0.15rem; }
.req-cell .row-toggle { flex: none; margin-right: 0.15rem; }
.req-cell .req-link { padding-top: 0.2rem; overflow-wrap: anywhere; }
@media (max-width: 860px) { .tool-sep { display: none; } .hit-head-tools { gap: 0.4rem 1.1rem; } }

/* the work page uses the width of the screen, and a HIT is shown as wide as the window allows, like on Mechanical Turk */
.work-page .container { width: min(1760px, calc(100% - 2rem)); }
.work-page.in-work .container { width: min(2400px, calc(100% - 1.5rem)); }

/* ---- the work bar in one slim, sticky line, and focus mode while a HIT is open ---- */
.in-work .work-head, .in-work #work-banner, .in-work .work-idbar, .in-work #work-tabs, .in-work #work-pause { display: none; }
.in-work .work-main { padding-top: 0.5rem; }
/* while a HIT is open nothing else on the site is needed: no navigation line above it and no footer below it */
.in-work .site-header, .in-work .site-footer { display: none; }
.in-work .work-bar.slim { top: 0.4rem; }
.work-bar.slim { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.8rem; padding: 0.4rem 0.8rem; margin-bottom: 0.6rem; position: sticky; top: 69px; z-index: 40; border-radius: 12px; border-left-width: 5px; background: linear-gradient(90deg, rgba(20, 184, 166, 0.10), transparent 45%), #fff; box-shadow: 0 2px 10px rgba(15, 30, 53, 0.08); }
.work-bar.slim.is-sandbox { background: linear-gradient(90deg, rgba(245, 158, 11, 0.13), transparent 45%), #fff; }
.work-back-btn { display: inline-flex; align-items: center; gap: 0.3rem; border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 999px; padding: 0.28rem 0.75rem 0.28rem 0.55rem; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; flex: none; }
.work-back-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.work-bar.slim .work-info { display: flex; align-items: center; gap: 0.6rem; flex: 1 1 360px; min-width: 0; }
.work-bar.slim .hit-badges { display: inline-flex; flex: none; }
.work-bar.slim .hit-badges .chip { margin: 0; }
.work-bar.slim .work-title { font-size: 1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 6rem; }
.work-bar.slim .hit-meta { flex-wrap: nowrap; flex: none; gap: 0.35rem; }
.work-bar.slim .hit-meta .wm { padding: 0.12rem 0.55rem; font-size: 0.78rem; }
.work-bar.slim .hit-meta .wm.reward { font-size: 0.85rem; }
.work-bar.slim .work-side { display: flex; align-items: center; gap: 0.7rem; margin-left: auto; flex-wrap: nowrap; flex: none; }
.work-bar.slim .work-clock { display: flex; align-items: center; padding: 0.18rem 0.75rem; border-radius: 10px; min-width: 0; box-shadow: none; }
.work-bar.slim .work-clock .l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.work-bar.slim .work-clock .work-timer { font-size: 1.1rem; }
.work-bar.slim .work-controls { flex-direction: row; align-items: center; gap: 0.7rem; width: auto; }
.work-bar.slim .switch { font-size: 0.82rem; padding: 0; white-space: nowrap; }
.work-bar.slim .btn.return { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.work-bar.slim .btn.primary { padding: 0.4rem 1.1rem; font-size: 0.9rem; }
.work-bar.slim .work-return-note.is-warn, .work-bar.slim .lock-note { flex: 1 1 100%; order: 9; max-width: none; margin: 0.15rem 0 0.05rem; padding: 0.3rem 0.6rem; }
.work-bar.slim .lock-note { display: inline-flex; gap: 0.35rem; align-items: center; font-size: 0.82rem; color: var(--text-dim); }
.work-bar.slim .work-info { overflow: hidden; }
@media (max-width: 1100px) { .work-bar.slim .hit-meta .wm.time { display: none; } }
@media (max-width: 940px) { .work-bar.slim .hit-meta .wm.hits, .work-bar.slim .sw-label { display: none; } }
@media (max-width: 760px) {
  .work-bar.slim { padding: 0.4rem 0.55rem; gap: 0.35rem 0.5rem; top: 65px; }
  .work-back-btn span, .work-bar.slim .btn.return .lbl { display: none; }
  .work-back-btn { padding: 0.3rem 0.5rem; }
  .work-bar.slim .work-info { flex: 1 1 calc(100% - 3.2rem); }
  .work-bar.slim .work-title { flex: 1 1 0; min-width: 0; }
  .work-bar.slim .hit-meta .wm.req { display: none; }
  .work-bar.slim .work-side { flex: 1 1 100%; justify-content: space-between; margin-left: 0; gap: 0.5rem; }
  .work-bar.slim .work-controls { gap: 0.6rem; }
  .work-bar.slim .sw-label { display: inline; }
  .work-bar.slim .btn.return { padding: 0.32rem 0.7rem; }
  .work-bar.slim .work-controls:only-child { flex: 1; }
  .work-bar.slim .btn.primary { flex: 1; }
}
.work-page .work-title:focus, .work-page .work-title:focus-visible { outline: none; }   /* the heading is only focused so screen readers announce it */
