:root {
  /* EntitleWorks brand, taken from entitleworks.ai */
  --paper: #f6f7f2;
  --sheet: #ffffff;
  --ink: #123e35;
  --ink-2: #456358;
  --sage: #5f826f;
  --line: #dce7df;
  --lime: #c4f578;
  --link: #086c59;
  --tint: #eaf2ed;
  --tint-2: #f3faf6;
  --focus: #946000;
  --critical: #9d2b25;
  --high: #b5541b;
  --medium: #946000;
  --low: #17725f;
  --radius-lg: 16px;
  --radius-sm: 10px;
  --pill: 40px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--paper); color: var(--ink); border-bottom: 1px solid rgba(18, 62, 53, .125); }
.brand { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.3rem; letter-spacing: -0.04em; }
.brand span { color: var(--sage); }
.top nav { display: flex; gap: 18px; align-items: center; }
.navlink, .linkbtn { color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.navlink:hover, .linkbtn:hover { color: var(--link); text-decoration: underline; }
.credits { color: var(--ink-2); font-size: .9rem; font-variant-numeric: tabular-nums; }

main { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 32px 20px 56px; }
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; box-shadow: 0 8px 32px #102d3608; }
h1 { font-size: 1.85rem; line-height: 1.15; margin: 0 0 20px; font-weight: 650; letter-spacing: -0.03em; }
h2 { font-size: 1.05rem; margin: 30px 0 12px; }
.lede { color: var(--ink-2); max-width: 60ch; margin: 0 0 24px; }
.hint, .meta { color: var(--ink-2); font-size: .92rem; }
.msg { color: var(--critical); min-height: 1.5em; margin: 12px 0 0; }

.btn { display: inline-block; font: inherit; font-weight: 650; padding: 12px 24px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--sheet); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.btn.primary:hover { background: #b6ec62; border-color: #b6ec62; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 7px 14px; font-size: .9rem; }

/* The two jobs: the one decision that matters most, so it gets the space. */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.task { text-align: left; font: inherit; color: var(--ink); background: var(--sheet); border: 2px solid var(--line); border-radius: var(--radius-lg); padding: 20px; cursor: pointer; display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; align-items: center; }
.task svg { width: 44px; height: 44px; grid-row: span 2; color: var(--ink); }
.task .t { font-weight: 700; font-size: 1.1rem; }
.task .d { color: var(--ink-2); font-size: .9rem; }
.task[aria-pressed="true"] { border-color: var(--ink); background: var(--tint-2); }

.seg { display: inline-flex; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { font: inherit; padding: 9px 16px; background: var(--sheet); border: 0; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.hats { display: flex; flex-wrap: wrap; gap: 8px; }
.hats button { font: inherit; padding: 10px 16px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--sheet); cursor: pointer; color: var(--ink); }
.hats button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.drop { display: block; border: 2px dashed #bccfc8; border-radius: var(--radius-lg); padding: 22px; cursor: pointer; background: var(--tint-2); }
.drop.over { border-color: var(--ink); background: var(--tint); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop-t { display: block; font-weight: 600; }
.drop-d { display: block; color: var(--ink-2); font-size: .9rem; margin-top: 4px; }
.filelist { list-style: none; padding: 0; margin: 10px 0 0; font-size: .92rem; }
.filelist li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); }
.filelist button { background: none; border: 0; color: var(--critical); cursor: pointer; font: inherit; }

.go { display: flex; gap: 16px; align-items: center; margin-top: 28px; }

.back { display: inline-block; margin-bottom: 14px; }
.progress .bar { height: 10px; background: var(--tint); border-radius: 99px; overflow: hidden; margin: 18px 0 8px; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .6s ease; }
@media (prefers-reduced-motion: reduce) { .progress .bar span { transition: none; } }

.verdict { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; padding: 20px; border-radius: var(--radius-lg); background: var(--tint); margin: 8px 0 22px; }
.risk { font-weight: 800; font-size: 1.05rem; padding: 8px 14px; border-radius: var(--radius-sm); color: #fff; white-space: nowrap; }
.risk.severe, .risk.critical { background: var(--critical); }
.risk.high { background: var(--high); }
.risk.moderate, .risk.medium { background: var(--medium); }
.risk.low { background: var(--low); }
.verdict p { margin: 0 0 8px; }
.verdict ol { margin: 8px 0 0; padding-left: 20px; }

.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0 10px; }
.filter button { font: inherit; font-size: .88rem; padding: 6px 14px; border: 1px solid var(--line); background: var(--sheet); border-radius: 99px; cursor: pointer; }
.filter button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.issues { list-style: none; padding: 0; margin: 0; }
.issue { border-top: 1px solid var(--line); }
.issue > button { width: 100%; text-align: left; background: none; border: 0; font: inherit; color: var(--ink); padding: 14px 0; cursor: pointer; display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: baseline; }
.sev { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; color: #fff; text-align: center; }
.sev.critical { background: var(--critical); } .sev.high { background: var(--high); } .sev.medium { background: var(--medium); } .sev.low { background: var(--low); }
.clause { color: var(--ink-2); font-size: .88rem; white-space: nowrap; }
.issue-body { padding: 0 0 18px 104px; }
.issue-body h4 { margin: 14px 0 4px; font-size: .95rem; }
.issue-body p { margin: 0 0 6px; max-width: 72ch; }
blockquote { margin: 6px 0; padding: 8px 14px; border-left: 3px solid var(--sage); background: var(--tint-2); color: var(--ink-2); font-style: italic; }
.src { font-size: .82rem; color: var(--ink-2); }
.wording { white-space: pre-wrap; background: var(--tint-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .93rem; }

table.grid { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 8px 0 18px; }
table.grid th, table.grid td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); }
table.grid th { color: var(--ink-2); font-weight: 600; }

.section-md h3 { margin: 22px 0 6px; }
.section-md p { max-width: 72ch; }

.history { list-style: none; padding: 0; margin: 0; }
.history li { border-top: 1px solid var(--line); padding: 12px 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; }
.history a { font-weight: 600; text-decoration: none; }
.status { font-size: .85rem; color: var(--ink-2); }

.foot { text-align: center; color: var(--ink-2); font-size: .82rem; padding: 18px; }

@media (max-width: 640px) {
  .panel { padding: 20px; border-radius: 0; border-left: 0; border-right: 0; }
  main { padding: 0 0 40px; }
  .choice { grid-template-columns: 1fr; }
  .issue > button { grid-template-columns: 80px 1fr; }
  .issue > button .clause { grid-column: 2; }
  .issue-body { padding-left: 0; }
  .top { padding: 12px 16px; }
  .top nav { gap: 12px; font-size: .9rem; white-space: nowrap; }
  .top nav a[href="/"] { display: none; }
  .credits { font-size: .8rem; }
  .verdict { grid-template-columns: 1fr; gap: 10px; }
  .risk { justify-self: start; }
}

/* ---------------- workspace */
main:has(#job:not([hidden])) { max-width: 920px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 6px 0 22px; scrollbar-width: none; }
.tabs button { font: inherit; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tabs button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 650; }
.view h2 { margin-top: 8px; }
.meta { margin: 0 0 14px; }

.progress-card { display: grid; grid-template-columns: 1fr auto; gap: 10px 18px; align-items: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); margin: 0 0 24px; }
.progress-card .bar { grid-column: 1; height: 8px; background: var(--tint); border-radius: 99px; overflow: hidden; }
.progress-card .bar span { display: block; height: 100%; width: 0; background: var(--ink); }
.progress-card .btn { grid-column: 2; grid-row: 1 / span 2; }

.card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; margin: 0 0 16px; background: var(--sheet); }
.card h2 { font-size: 1.3rem; margin: 10px 0 10px; line-height: 1.3; }
.card h3 { font-size: .95rem; margin: 18px 0 4px; }
.card p { max-width: 70ch; }
.card-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card-head .count { margin-left: auto; color: var(--ink-2); font-size: .85rem; }
.options { display: grid; gap: 10px; margin-top: 6px; }
.option { display: grid; grid-template-columns: 22px 1fr; gap: 4px 8px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; }
.option:has(input:checked) { border-color: var(--ink); background: var(--tint-2); }
.option input { margin-top: 3px; }
.option .option-t { font-weight: 600; }
.option .wording, .option .hint { grid-column: 2; }
.edit, .note { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn.quiet { border-color: transparent; background: none; color: var(--ink-2); }
.btn.quiet:hover { color: var(--ink); text-decoration: underline; }

.chip { font: inherit; font-size: .82rem; font-variant-numeric: tabular-nums; padding: 2px 9px; border-radius: 99px; border: 1px solid #c5d8d4; background: var(--tint); color: var(--ink); cursor: pointer; margin-right: 4px; }
.chip:hover { background: #dce7df; }
.ref { font: inherit; font-size: inherit; background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pill { font-size: .78rem; padding: 2px 9px; border-radius: 99px; background: #eef1f4; color: var(--ink-2); white-space: nowrap; }
.pill.accepted, .pill.amended, .pill.done, .pill.diarised, .pill.notice-on_time, .pill.strength-strong { background: #e4f1e7; color: var(--low); }
.pill.rejected, .pill.not_applicable { background: #f1eeee; color: #7a6a6a; }
.pill.in_hand, .pill.later, .pill.strength-arguable { background: #f6efdc; color: var(--medium); }
.pill.notice-late, .pill.notice-no_notice_found, .pill.strength-weak { background: #f7e4e2; color: var(--critical); }
.type { font-size: .75rem; color: var(--ink-2); text-transform: capitalize; }

details.all, details.notes { margin-top: 18px; }
details > summary { cursor: pointer; color: var(--link); }
.mini { list-style: none; padding: 0; margin: 8px 0 0; }
.mini button { width: 100%; text-align: left; font: inherit; background: none; border: 0; border-top: 1px solid var(--line); padding: 9px 0; display: grid; grid-template-columns: 82px 1fr auto; gap: 10px; align-items: center; cursor: pointer; color: var(--ink); }

.rows { list-style: none; padding: 0; margin: 0; }
.rows > li { border-top: 1px solid var(--line); }
.row-head { width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; padding: 12px 0; display: grid; grid-template-columns: 90px 1fr auto auto; gap: 12px; align-items: center; cursor: pointer; }
.row-body { padding: 0 0 16px 102px; }
.track { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.track select, .track input { font: inherit; font-size: .9rem; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sheet); }
.action-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 12px 0; align-items: start; }
.action-row p { margin: 0 0 2px; }
.search { font: inherit; width: 100%; max-width: 420px; background: var(--sheet); padding: 9px 12px; border: 1px solid var(--line); border-radius: 99px; }
.chrono { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.chrono .date { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: .9rem; }
.chrono p { margin: 0 0 4px; }
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 12px; }
.levels div { background: var(--tint-2); border-radius: var(--radius-sm); padding: 8px 12px; display: grid; }
.notice-line { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--tint-2); }
.notice-line.late, .notice-line.no_notice_found { background: #fbeeed; }
.notice-line.on_time { background: #edf6ef; }

.export { display: flex; justify-content: space-between; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 12px; }
.export h3 { margin: 0 0 4px; }
.export p { margin: 0; }
.danger { margin-top: 36px; }

.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 4px var(--lime); } to { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; outline: 2px solid var(--ink); } }

.saved { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); margin: 0; padding: 0; font-size: .88rem; color: var(--ink-2); }
.saved:not(:empty) { background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 99px; }

dialog#sheet { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: 80vh; box-shadow: 0 20px 60px rgba(16, 45, 54, .22); color: var(--ink); }
dialog#sheet::backdrop { background: rgba(18, 62, 53, .35); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--sheet); }
.sheet-head h2 { margin: 0; font-size: 1.1rem; }
#sheet-body { padding: 18px 22px 24px; }
.linkbtn.dark { color: var(--link); }
blockquote.plain { font-style: normal; white-space: pre-wrap; }
.linked { list-style: none; padding: 0; margin: 0; }
.linked button { width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 0; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.linked .type { min-width: 84px; }

@media (max-width: 640px) {
  .card { padding: 18px; border-radius: 0; border-left: 0; border-right: 0; }
  .row-head { grid-template-columns: 1fr auto; }
  .row-head .type, .row-head .clause { display: none; }
  .row-body { padding-left: 0; }
  .progress-card { grid-template-columns: 1fr; }
  .progress-card .btn { grid-column: 1; grid-row: auto; }
  .export { flex-direction: column; align-items: stretch; }
  .chrono { grid-template-columns: 1fr; gap: 2px; }
  .action-row { grid-template-columns: 1fr; }
  .levels { grid-template-columns: repeat(3, 1fr); }
  .mini button { grid-template-columns: 70px 1fr; }
  .mini .pill { display: none; }
}

.prose p { margin: 0 0 8px; max-width: 70ch; }
.prose ul, .prose ol { margin: 0 0 8px; padding-left: 20px; }
.inref { font-size: .8rem; white-space: nowrap; }
.inref .ref { margin-left: 3px; }

.setting { border-top: 1px solid var(--line); padding: 8px 0 18px; }
.setting:first-of-type { border-top: 0; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input, .inline-form select { font: inherit; flex: 1 1 260px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sheet); }
.inline-form select { flex: 0 1 260px; }
.person { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 0; }
.person .pill { margin-left: 8px; }
.person p { margin: 2px 0 0; }
@media (max-width: 640px) { .person { grid-template-columns: 1fr; } }

/* ---------------- brand hero (sign-in) */
main:has(#signin:not([hidden])) { max-width: none; padding: 0; }
.hero { background: var(--ink); color: #fff; padding: 72px max(24px, calc((100vw - 980px) / 2)) 64px; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1.02; letter-spacing: -0.06em; font-weight: 650; margin: 18px 0 22px; color: #fff; }
.hero .lime { color: var(--lime); }
.hero .lede { color: #e2ece5; font-size: 1.12rem; max-width: 58ch; }
.hero .msg { color: #ffd2cc; }
.eyebrow { margin: 0; font-size: .82rem; letter-spacing: .02em; color: #e2ece5; display: flex; align-items: center; gap: 10px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.btn.big { padding: 15px 30px; font-size: 1.05rem; }
.how { list-style: none; counter-reset: how; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0; margin: 56px 0 0; }
.how li { counter-increment: how; border-top: 1px solid rgba(255, 255, 255, .18); padding-top: 14px; color: #e2ece5; }
.how li::before { content: counter(how); display: block; color: var(--lime); font-weight: 650; margin-bottom: 6px; }
.how strong { color: #fff; }
#signin-dev input { font: inherit; padding: 10px 12px; border-radius: var(--radius-sm); border: 0; margin-right: 8px; }

/* ---------------- progress stages */
.stages { list-style: none; padding: 0; margin: 16px 0 10px; display: grid; gap: 8px; }
.stages li { display: flex; gap: 12px; align-items: center; color: var(--ink-2); }
.stages li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.stages li.done { color: var(--ink); }
.stages li.done::before { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 3px var(--sheet); }
.stages li.now { color: var(--ink); font-weight: 650; }
.stages li.now::before { border-color: var(--ink); border-top-color: var(--lime); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .stages li.now::before { animation: none; background: var(--lime); } }

/* ---------------- overview tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 18px; }
.tile { text-align: left; font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; cursor: pointer; display: grid; gap: 2px; }
.tile:hover { border-color: var(--ink); }
.tile .n { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile .l { font-size: .85rem; color: var(--ink-2); }
.lead { font-size: 1.05rem; margin: 0 0 6px; }
h3.small { font-size: .9rem; margin: 14px 0 4px; }
.actions-list li { margin-bottom: 6px; }

@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr 1fr 1fr; }
  .tile .n { font-size: 1.3rem; }
  .how { grid-template-columns: 1fr; }
  .hero { padding: 48px 20px 40px; }
}
