:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #eef3f0;
  --text: #183029;
  --muted: #65756f;
  --line: #d9e4df;
  --brand: #225f4f;
  --brand-strong: #16493c;
  --brand-soft: #dfeee8;
  --ok: #246946;
  --ok-soft: #e4f2e9;
  --warning: #9a5a00;
  --warning-soft: #fff2d2;
  --danger: #9b342f;
  --danger-soft: #fae9e7;
  --shadow: 0 18px 50px rgba(34, 65, 55, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 0%, rgba(68, 133, 109, 0.09), transparent 34rem),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.button-reset {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(217, 228, 223, 0.9);
  background: rgba(245, 247, 246, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
}

.top-nav {
  display: flex;
  gap: 8px;
}

.nav-button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.nav-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.screen {
  padding: 64px 0 90px;
}

.home-screen {
  max-width: 940px;
  margin: 0 auto;
}

.home-hero {
  padding-top: 38px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 26px;
  font-size: clamp(42px, 6vw, 70px);
  line-height: 1;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 8px;
  font-size: 19px;
}

.search-shell {
  position: relative;
}

.search-typeahead {
  position: absolute;
  z-index: 25;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(34, 65, 55, 0.14);
}

.typeahead-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.typeahead-item:last-child {
  border-bottom: 0;
}

.typeahead-item:hover,
.typeahead-item:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.typeahead-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.typeahead-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typeahead-copy small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typeahead-empty {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 14px;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 9px;
  border: 1px solid #cfdcd6;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-box input {
  min-width: 0;
  min-height: 58px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  outline: none;
}

.search-box input::placeholder {
  color: #8a9993;
}

.primary-button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--brand-strong);
}

.search-button {
  min-width: 118px;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.search-suggestions button {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.search-suggestions button:hover {
  border-color: #a9c4b8;
  color: var(--brand-strong);
}

.search-results {
  margin-top: 54px;
  scroll-margin-top: 94px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-kicker {
  margin-bottom: 5px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-button {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font-weight: 750;
}

.answer-card,
.no-result {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.answer-meta {
  margin-bottom: 14px;
}

.answer-card h3 {
  font-size: 24px;
}

.answer-text {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.65;
}

.answer-section {
  margin-top: 22px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.answer-section strong {
  display: block;
  margin-bottom: 8px;
}

.answer-section p:last-child {
  margin-bottom: 0;
}

.answer-risk {
  background: var(--warning-soft);
}

.answer-details {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.answer-details summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 750;
}

.related-results {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.related-results h3 {
  margin: 12px 0 4px;
}

.related-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.related-result:hover {
  border-color: #a9c4b8;
}

.related-result small {
  color: var(--muted);
  white-space: nowrap;
}

.quick-work {
  margin-top: 74px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(34, 65, 55, 0.05);
  cursor: pointer;
  text-align: left;
}

.task-card:hover {
  border-color: #a9c4b8;
  transform: translateY(-1px);
}

.task-card-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.task-card-copy strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-copy small {
  color: var(--muted);
}

.task-type {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-empty {
  display: grid;
  gap: 5px;
  padding: 22px;
  border: 1px dashed #c8d6d0;
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.task-empty strong {
  color: var(--text);
}

.work-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
}

.work-card:hover {
  border-color: #a9c4b8;
  transform: translateY(-1px);
}

.work-card div {
  display: grid;
  gap: 5px;
}

.work-card strong {
  font-size: 20px;
}

.work-card span {
  color: var(--muted);
}

.work-card-arrow {
  font-size: 28px;
  color: var(--brand) !important;
}

.workspace-screen {
  max-width: 1180px;
  margin: 0 auto;
}

.workspace-top {
  margin-bottom: 28px;
}

.back-link {
  margin-bottom: 22px;
  color: var(--brand);
  font-weight: 750;
}

.workspace-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.workspace-title-row h1 {
  margin-bottom: 8px;
  font-size: clamp(40px, 5vw, 60px);
}

.workspace-subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.workspace-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.workspace-progress {
  display: grid;
  justify-items: end;
  gap: 2px;
  margin-right: 4px;
}

.workspace-progress strong {
  font-size: 13px;
}

.workspace-progress span {
  color: var(--muted);
  font-size: 11px;
}

.reset-progress {
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.reset-progress:hover {
  color: var(--danger);
}

.summary-pill,
.section-status,
.legal-detail-label {
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.knowledge-limit-note {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.knowledge-limit-note strong {
  font-size: 13px;
}

.knowledge-limit-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.review-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.summary-pill.ok,
.section-status.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.summary-pill.open,
.section-status.open {
  background: var(--warning-soft);
  color: var(--warning);
}

.summary-pill.attention,
.section-status.attention {
  background: var(--danger-soft);
  color: var(--danger);
}

.workspace-jumps {
  position: sticky;
  top: 70px;
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 28px;
  padding: 10px 0;
  background: rgba(245, 247, 246, 0.93);
  backdrop-filter: blur(14px);
}

.workspace-jumps a {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.workspace-jumps a:hover {
  border-color: #9ebaae;
  color: var(--brand);
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.evaluation-panel {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.evaluation-panel.evaluation-needs_input {
  border-left-color: var(--warning);
}

.evaluation-panel.evaluation-needs_review,
.evaluation-panel.evaluation-blocked {
  border-left-color: var(--danger);
}

.evaluation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.evaluation-head h2 {
  margin: 8px 0 6px;
}

.evaluation-head p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.evaluation-status {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.evaluation-needs_input .evaluation-status {
  background: var(--warning-soft);
  color: var(--warning);
}

.evaluation-needs_review .evaluation-status,
.evaluation-blocked .evaluation-status {
  background: var(--danger-soft);
  color: var(--danger);
}

.evaluation-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.evaluation-counts span {
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.evaluation-counts strong {
  color: var(--text);
}

.finding-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.finding {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  text-decoration: none;
}

.finding:hover {
  border-color: #a9c4b8;
}

.finding-critical,
.finding-high {
  background: #fffafa;
}

.finding strong {
  display: block;
  margin-bottom: 4px;
}

.finding p {
  margin-bottom: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.finding span {
  color: var(--brand);
  font-size: 13px;
}

.finding-arrow {
  font-size: 22px !important;
}

.workspace-card {
  scroll-margin-top: 132px;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 4px solid #c8d4cf;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(34, 65, 55, 0.045);
}

.workspace-card.status-ok {
  border-top-color: var(--ok);
}

.workspace-card.status-open {
  border-top-color: #c7861c;
}

.workspace-card.status-attention {
  border-top-color: var(--danger);
}

.workspace-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.workspace-card h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.field-grid {
  display: grid;
  gap: 16px;
}

.field-row {
  display: grid;
  gap: 7px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #44564f;
  font-size: 13px;
  font-weight: 700;
}

.why-button {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  padding: 0;
  border: 1px solid #cbd7d2;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: help;
  font-size: 11px;
}

.field-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #cbd8d2;
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 95, 79, 0.1);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.segmented button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.segmented button.selected {
  background: var(--surface);
  color: var(--brand-strong);
  box-shadow: 0 2px 8px rgba(34, 65, 55, 0.08);
  font-weight: 800;
}

.legal-links {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.legal-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 11px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.legal-link span:first-child {
  line-height: 1.4;
}

.review-status {
  background: var(--surface-soft);
  color: var(--muted);
}

.review-status.source_checked,
.review-status.hr_reviewed,
.review-status.approved {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.review-status.stale,
.review-status.legal_review_needed {
  background: var(--warning-soft);
  color: var(--warning);
}

.secondary-action {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--brand-strong);
  cursor: pointer;
  font-weight: 750;
}

.secondary-action:hover {
  border-color: #9ebaae;
}

.evaluation-side {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.evaluation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.draft-status {
  display: grid;
  gap: 4px;
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 13px;
}

.draft-status span {
  color: var(--muted);
  line-height: 1.45;
}

.draft-ready {
  background: var(--ok-soft);
  color: var(--ok);
}

.draft-review {
  background: var(--warning-soft);
  color: var(--warning);
}

.draft-unavailable {
  padding: 16px;
  border-radius: 13px;
  background: var(--warning-soft);
}

.draft-unavailable strong {
  display: block;
  margin-bottom: 6px;
}

.draft-unavailable p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.contract-preview {
  margin-top: 20px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.contract-preview h1 {
  margin: 0 0 26px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.contract-preview section {
  margin: 0 0 24px;
}

.contract-preview h2 {
  margin-bottom: 8px;
  font-size: 17px;
}

.contract-preview p {
  margin-bottom: 0;
  line-height: 1.65;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 0 4px;
}

.report-overview p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.report-findings {
  display: grid;
  gap: 10px;
}

.report-finding {
  padding: 14px;
  border-radius: 13px;
  background: var(--surface-soft);
}

.report-finding strong {
  display: block;
  margin-bottom: 5px;
}

.report-finding p {
  margin-bottom: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.report-finding span {
  color: var(--brand);
  font-size: 13px;
}

.report-sections {
  display: grid;
  gap: 18px;
}

.report-section > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.report-section dl {
  margin: 0;
}

.report-section dl > div {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 1fr);
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.report-section dt {
  color: var(--muted);
}

.report-section dd {
  margin: 0;
  text-align: right;
}

.detail-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: 90vh;
  margin: auto 18px auto auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: var(--shadow);
}

.detail-dialog::backdrop {
  background: rgba(13, 27, 23, 0.42);
  backdrop-filter: blur(2px);
}

.detail-panel {
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  background: var(--surface);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin-bottom: 0;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 24px;
}

.detail-status {
  margin-top: 20px;
}

.detail-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.explanation-block {
  padding: 14px 0;
  line-height: 1.6;
}

.explanation-block p {
  margin-bottom: 0;
}

.explanation-block.risk {
  margin: 8px 0;
  padding: 14px;
  border-radius: 13px;
  background: var(--warning-soft);
}

.check-list,
.source-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li,
.source-list li {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.check-list li:last-child,
.source-list li:last-child {
  border-bottom: 0;
}

.check-list span,
.source-list span,
.muted,
.no-result p {
  color: var(--muted);
  line-height: 1.5;
}

.source-list a {
  width: fit-content;
  color: var(--brand);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.source-list a:hover {
  text-decoration: underline;
}

.loading,
.no-result {
  color: var(--muted);
}

.error-screen {
  max-width: 720px;
  margin: 0 auto;
}

.error-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.error-card code {
  display: block;
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: #172821;
  color: #eaf4ef;
  overflow-x: auto;
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .workspace-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-summary {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 62px;
    padding: 0 14px;
  }

  .top-nav {
    gap: 2px;
  }

  .nav-button {
    padding: 0 8px;
    font-size: 13px;
  }

  main {
    width: min(100% - 26px, 1180px);
  }

  .screen {
    padding: 36px 0 68px;
  }

  .home-hero {
    padding-top: 14px;
  }

  h1 {
    font-size: 42px;
  }

  .search-box {
    grid-template-columns: 1fr;
  }

  .search-button {
    width: 100%;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .quick-work {
    margin-top: 52px;
  }

  .work-card {
    padding: 20px;
  }

  .workspace-jumps {
    top: 62px;
  }

  .workspace-card {
    padding: 20px;
  }

  .related-result,
  .legal-link {
    grid-template-columns: 1fr;
  }

  .detail-dialog {
    width: 100%;
    max-height: 93vh;
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
  }

  .detail-panel {
    max-height: 93vh;
  }
}


/* HR lifecycle taxonomy: discovery alongside search, never a mandatory wizard. */
.hr-area-directory {
  margin-top: 56px;
  scroll-margin-top: 95px;
}

.hr-area-intro {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.hr-area-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hr-area-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(34, 65, 55, 0.04);
  cursor: pointer;
  text-align: left;
}

.hr-area-card:hover,
.hr-area-card:focus-visible,
.hr-area-card.selected {
  border-color: var(--brand);
  outline-offset: 3px;
}

.hr-area-card.selected {
  background: var(--brand-soft);
}

.hr-area-code {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
}

.hr-area-card strong {
  font-size: 19px;
}

.hr-area-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.hr-area-card small {
  margin-top: auto;
  color: var(--brand);
  font-weight: 700;
}

.hr-area-detail {
  margin-top: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 90px;
}

.hr-area-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.hr-area-detail-head h3 {
  font-size: 27px;
}

.hr-area-detail-head p:not(.section-kicker) {
  color: var(--muted);
  line-height: 1.5;
}

.hr-area-detail-note,
.hr-area-cross-note,
.hr-area-awaiting {
  color: var(--muted);
  line-height: 1.6;
}

.hr-area-section-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
  padding: 0;
  list-style: none;
  counter-reset: hr-section;
}

.hr-area-section-list li {
  counter-increment: hr-section;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.hr-area-section-list li::before {
  content: counter(hr-section, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
}

.hr-area-section-list strong {
  display: block;
  margin-bottom: 7px;
}

.hr-area-section-list p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.hr-area-existing-tasks {
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.hr-area-existing-tasks h4 {
  margin: 0 0 12px;
}

.hr-area-task-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  cursor: pointer;
  font-weight: 750;
  text-align: left;
}

.hr-area-task-link:hover {
  border-color: var(--brand);
}

.hr-area-task-label {
  display: block;
  color: var(--muted);
}

.hr-area-cross-note {
  margin-top: 16px;
  font-size: 13px;
}

@media (max-width: 850px) {
  .hr-area-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .hr-area-grid,
  .hr-area-section-list {
    grid-template-columns: 1fr;
  }
  .hr-area-card {
    min-height: 0;
  }
  .hr-area-detail {
    padding: 18px;
  }
}


/* Simple SweetHR shell: one shared search, independent tasks, optional areas. */
.app-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: calc(100vh - 70px);
}

.app-sidebar {
  position: sticky;
  top: 70px;
  align-self: start;
  height: calc(100vh - 70px);
  overflow-y: auto;
  padding: 22px 12px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 3px;
}

.sidebar-heading {
  margin: 24px 12px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.sidebar-task-button {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  text-align: left;
}

.sidebar-task-button:hover,
.sidebar-task-button.selected {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.app-sidebar .hr-area-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.app-sidebar .hr-area-card {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.app-sidebar .hr-area-card strong {
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.app-sidebar .hr-area-code {
  justify-content: center;
  padding: 4px 5px;
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: 10px;
}

.app-sidebar .hr-area-card:hover,
.app-sidebar .hr-area-card.selected {
  border-color: transparent;
  color: var(--brand-strong);
  background: var(--brand-soft);
  outline-offset: 2px;
}

.app-main {
  width: min(1060px, calc(100% - 56px));
  min-width: 0;
  margin: 0 auto;
}

.app-main .screen {
  padding: 35px 0 76px;
}

.app-main .home-screen {
  max-width: none;
}

.app-main .quick-work,
.app-main .hr-area-directory,
.app-main .search-results {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.app-main .hr-area-detail {
  margin-top: 0;
}

.header-search {
  width: min(690px, calc(100% - 205px));
  margin: 0 0 0 26px;
}

.site-header .search-box {
  gap: 5px;
  padding: 4px;
  border-radius: 13px;
  box-shadow: none;
}

.site-header .search-box input {
  min-height: 39px;
  padding: 0 12px;
  font-size: 14px;
}

.site-header .search-button {
  min-width: 80px;
  min-height: 39px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13px;
}

.sidebar-toggle {
  display: none;
  margin-left: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 22px;
  line-height: 1;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  background: var(--brand-soft);
}

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 205px minmax(0, 1fr);
  }

  .app-main {
    width: calc(100% - 40px);
  }
}

@media (max-width: 850px) {
  .app-layout {
    display: block;
    min-height: calc(100vh - 112px);
  }

  .site-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 112px;
    padding: 10px 14px;
  }

  .site-header .brand {
    margin-right: auto;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header-search {
    order: 3;
    width: 100%;
    margin: 0;
  }

  .site-header .search-box input,
  .site-header .search-button {
    min-height: 35px;
  }

  .app-sidebar {
    display: none;
    position: fixed;
    top: 112px;
    left: 0;
    bottom: 0;
    z-index: 29;
    width: min(300px, 88vw);
    height: auto;
    padding: 18px 12px;
    border-right: 1px solid var(--line);
    box-shadow: 15px 20px 45px rgba(20, 45, 35, 0.15);
  }

  .app-sidebar.is-open {
    display: block;
  }

  .app-main {
    width: calc(100% - 30px);
  }

  .app-main .screen {
    padding: 26px 0 55px;
  }

  .workspace-jumps {
    top: 112px;
  }
}

@media (max-width: 420px) {
  .site-header .search-box {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .site-header .search-button {
    width: auto;
    min-width: 70px;
    padding: 0 8px;
  }

  .app-main .hr-area-detail {
    padding: 17px;
  }
}


/* User-managed HR tasks: one central list, compact cross-area details. */
.task-creation-actions,
.hr-area-detail-actions,
.hr-task-detail-head,
.hr-task-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.task-creation-actions { justify-content: flex-end; }
.task-browser-hint {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.task-save-warning {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  color: var(--warning);
  background: var(--warning-soft);
  font-size: 14px;
}
.hr-task-list-heading {
  margin: 20px 4px 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.hr-task-progress-track {
  display: block;
  height: 7px;
  width: 100%;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}
.hr-task-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 160ms ease-out;
}
.hr-task-detail {
  max-width: 900px;
  margin: 0 auto;
}
.hr-task-detail-head {
  align-items: flex-start;
  margin-bottom: 20px;
}
.hr-task-detail-head h2 {
  overflow-wrap: anywhere;
}
.hr-task-delete {
  color: var(--danger);
}
.hr-task-form,
.hr-task-checklist {
  display: grid;
  gap: 13px;
  padding: 24px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.hr-task-form > label,
.hr-task-dialog form > label {
  font-size: 14px;
  font-weight: 750;
}
.hr-task-notes {
  min-height: 110px;
  padding: 14px;
  resize: vertical;
  line-height: 1.5;
}
.hr-task-area-options {
  min-width: 0;
  margin: 8px 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.hr-task-area-options legend {
  padding: 0 7px;
  font-size: 14px;
  font-weight: 750;
}
.hr-task-area-options > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.hr-task-area-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}
.hr-task-area-choice input,
.hr-task-checkitem input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}
.hr-task-dialog {
  width: min(540px, calc(100% - 28px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.hr-task-dialog::backdrop {
  background: rgba(12, 31, 23, .45);
}
.hr-task-dialog form {
  display: grid;
  gap: 14px;
}
.hr-task-dialog input[type="text"] {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
}
.hr-task-dialog-actions {
  justify-content: flex-end;
  margin-top: 5px;
}
.hr-task-checklist .section-heading { margin-bottom: 0; }
.hr-task-items { display: grid; gap: 6px; }
.hr-task-checkitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.hr-task-checkitem label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.hr-task-checkitem .completed {
  color: var(--muted);
  text-decoration: line-through;
}
.hr-task-remove-item {
  padding: 0 8px;
  color: var(--muted);
  font-size: 25px;
}
.hr-task-remove-item:hover { color: var(--danger); }
.hr-task-add-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 8px;
}
.hr-task-add-step .field-input { min-width: 0; }
.hr-area-existing-tasks .task-card {
  margin-bottom: 10px;
  padding: 14px 16px;
}
@media (max-width: 680px) {
  .task-creation-actions { justify-content: flex-start; }
  .hr-task-area-options > div { grid-template-columns: 1fr; }
  .hr-task-form, .hr-task-checklist { padding: 17px; }
  .hr-task-dialog { padding: 20px; }
  .hr-task-add-step { grid-template-columns: 1fr; }
}


/* Authentication is a small standalone gate, not an additional HR workspace. */
.auth-login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 16px;
  background: var(--bg, #f7f9f7);
}
.auth-login-card {
  width: min(440px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 20px 65px rgba(15, 40, 30, .08);
}
.auth-login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 32px;
  font-size: 20px;
  font-weight: 800;
}
.auth-login-card h1 {
  font-size: clamp(24px, 3vw, 32px);
  margin: 8px 0 10px;
}
.auth-login-explanation,
.auth-login-footnote {
  color: var(--muted);
  line-height: 1.5;
}
.auth-login-card form {
  display: grid;
  gap: 12px;
  margin: 26px 0;
}
.auth-login-card form label {
  font-size: 13px;
  font-weight: 750;
}
.auth-login-card form input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
}
.auth-login-card form input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.auth-login-card form button { margin-top: 10px; }
.auth-login-card form button:disabled { opacity: .55; cursor: wait; }
.auth-login-footnote { margin: 0; font-size: 12px; }
.auth-login-error {
  padding: 12px;
  border-radius: 9px;
  border: 1px solid #e4a3a3;
  background: #fff4f4;
  color: #8f2020;
  font-size: 13px;
}
.auth-user-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}
.auth-user-controls .text-button { font-size: 13px; }
@media (max-width: 850px) {
  .auth-user-controls { order: 1; margin: 0 0 0 auto; }
  .auth-login-card { padding: 25px; }
}

/* Optional, non-blocking import of browser-only drafts into signed-in accounts. */
.local-import-notice {
  margin: 18px 0 24px;
  padding: 21px 23px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: var(--surface);
}
.local-import-notice h3 {
  margin: 0 0 10px;
  font-size: 17px;
}
.local-import-notice p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.local-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 15px;
}
.local-import-actions button:disabled { opacity: .65; cursor: wait; }
@media (max-width: 680px) {
  .local-import-notice { padding: 16px; }
  .local-import-actions { align-items: stretch; flex-direction: column; }
}

/* Authenticated password rotation dialog. */
.auth-password-dialog { width: min(480px, calc(100% - 32px)); }
.auth-password-dialog form { display: grid; gap: 12px; }
.auth-password-dialog form label { font-size: 13px; font-weight: 750; }
.auth-password-dialog form input {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px;
}
.auth-password-dialog .local-import-actions { justify-content: flex-end; }

/* Organization workspace: separate from personal tasks and legal-search views. */
.org-nav-block {
  display: grid;
  gap: 9px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.org-nav-block select, .org-task-form input, .org-task-form select,
.org-task-form textarea, .org-member-add input, .org-member-add select,
.org-member-role select, .org-create-dialog input {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  font: inherit;
}
.org-nav-block .text-button { text-align: left; justify-self: start; }
.organization-screen { width: min(940px, 100%); }
.org-tasks, .org-members, .org-task-editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-top: 20px;
}
.org-tasks h3, .org-members h3 { margin-bottom: 18px; }
.org-task-editor { background: var(--surface-soft); }
.org-task-form, .org-create-dialog form { display: grid; gap: 16px; }
.org-task-form > label, .org-member-add > label, .org-create-dialog form > label {
  display: grid; gap: 6px; font-size: 14px; font-weight: 650;
}
.org-task-form textarea { resize: vertical; line-height: 1.5; }
.org-fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.org-fieldset legend { padding: 0 6px; font-weight: 700; }
.org-area-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.org-check-choice, .org-check-row label {
  display: flex; align-items: center; gap: 10px;
}
.org-check-choice input, .org-check-row input { width: auto; }
.org-check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; }
.org-add-step { display: flex; gap: 10px; margin-top: 12px; }
.org-task-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.org-danger, .org-error { color: var(--danger); }
.org-error { font-size: 14px; line-height: 1.4; margin: 0; }
.org-feedback { padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; }
.org-member-list { display: grid; gap: 12px; margin-bottom: 20px; }
.org-member-row {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.org-member-row > div { min-width: 0; }
.org-member-row strong, .org-member-row small { display: block; overflow-wrap: anywhere; }
.org-member-row small { color: var(--muted); font-size: 11px; }
.org-member-role { display: grid; gap: 3px; font-size: 12px; flex: 0 0 150px; }
.org-member-add { display: grid; gap: 12px; grid-template-columns: minmax(0,2fr) minmax(0,1fr) auto; align-items: end; }
.org-member-add .primary-button { min-height: 45px; }
.org-create-dialog { width: min(480px,calc(100% - 32px)); }
@media(max-width:720px) {
  .org-tasks, .org-members, .org-task-editor { padding: 16px; }
  .org-member-add { grid-template-columns: 1fr; }
  .org-member-row { flex-wrap: wrap; }
  .org-area-choices { grid-template-columns: 1fr; }
}

/* Administrator account management, isolated from organizational case data. */
.admin-users-screen { width: min(940px,100%); }
.admin-users-card { background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px; margin-top: 18px; }
.admin-users-card h3 { margin: 0 0 14px; }
.admin-users-create-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.admin-users-create-form label, .admin-user-row label, #admin-reset-form label {
  display: grid; gap: 6px; font-size: 14px; font-weight: 650;
}
.admin-users-create-form input, .admin-users-create-form select,
.admin-user-row select, #admin-reset-form input {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--surface); color: var(--text); font: inherit; width: 100%;
}
.admin-users-create-form .primary-button { justify-self: start; }
.admin-users-create-form .org-error { grid-column: 1/-1; }
.admin-users-list { display: grid; gap: 8px; }
.admin-user-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(140px,180px) auto;
  align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-user-meta strong, .admin-user-meta small { display: block; overflow-wrap: anywhere; }
.admin-user-meta small { color: var(--muted); margin-top: 4px; }
.admin-user-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#admin-reset-form { display: grid; gap: 14px; }
@media (max-width:800px) {
  .admin-users-create-form { grid-template-columns: 1fr; }
  .admin-user-row { grid-template-columns: 1fr; gap: 10px; }
}
