:root {
  --ink: #17201c;
  --muted: #66716b;
  --paper: #f5f2ea;
  --card: #fffdfa;
  --line: #dedbd2;
  --green: #1f6049;
  --green-soft: #e4eee8;
  --red: #c54236;
  --insert: #166b48;
  --insert-bg: #dff1e7;
  --delete: #a13a32;
  --delete-bg: #f4dfdc;
  --yellow: #f4e5a3;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 14%, rgba(220, 228, 214, .55), transparent 29rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, select { font: inherit; }
button { color: inherit; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.hidden { display: none !important; }

.nav { height: 82px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.brand-button { border: 0; padding: 0; background: transparent; cursor: pointer; }
.brand-mark { width: 25px; height: 25px; display: grid; gap: 3px; align-content: center; }
.brand-mark i { display: block; height: 2px; border-radius: 2px; background: var(--red); }
.brand-mark i:nth-child(1) { width: 21px; }
.brand-mark i:nth-child(2) { width: 15px; }
.brand-mark i:nth-child(3) { width: 9px; }
.beta-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #d6d3ca; border-radius: 999px; padding: 7px 12px; color: #59635e; background: rgba(255,255,255,.5); font-size: 12px; font-weight: 600; }
.beta-pill span { width: 6px; height: 6px; border-radius: 99px; background: #37a36b; box-shadow: 0 0 0 3px rgba(55,163,107,.13); }

.hero { text-align: center; padding: 78px 0 70px; }
.eyebrow { color: var(--green); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 700; }
h1 { margin: 17px 0 20px; font-family: var(--serif); font-size: clamp(50px, 6.2vw, 80px); line-height: .98; letter-spacing: -.045em; font-weight: 400; }
h1 em { color: var(--green); font-weight: 400; }
.hero-copy { max-width: 650px; margin: 0 auto 37px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.upload-card { width: min(720px, 100%); margin: 0 auto; padding: 13px; border-radius: 18px; background: var(--card); border: 1px solid rgba(202,198,186,.9); box-shadow: 0 18px 60px rgba(49,57,52,.09), 0 2px 8px rgba(49,57,52,.05); text-align: left; }
.dropzone { width: 100%; min-height: 178px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #c8c6bd; border-radius: 12px; background: #fbfaf6; cursor: pointer; transition: border .2s, background .2s, transform .2s; }
.dropzone:hover, .dropzone.dragging { border-color: var(--green); background: #f3f7f2; transform: translateY(-1px); }
.dropzone.has-file { border-style: solid; border-color: #91b09f; background: #f1f7f3; }
.file-icon { width: 42px; height: 46px; display: grid; place-items: center; margin-bottom: 12px; color: var(--green); }
.file-icon svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.drop-main { font-size: 15px; font-weight: 600; }
.drop-sub { color: #89918d; font-size: 12px; margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; padding: 14px 4px 2px; }
.form-row label { display: grid; gap: 7px; color: #7b847f; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
select { height: 48px; min-width: 220px; padding: 0 42px 0 14px; border: 1px solid #dad7ce; border-radius: 10px; color: var(--ink); background: #fff; font-size: 14px; text-transform: none; letter-spacing: 0; outline: none; }
select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,96,73,.09); }
.primary { min-height: 48px; border: 0; border-radius: 10px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; gap: 11px; background: var(--green); color: white; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 5px 15px rgba(31,96,73,.18); transition: transform .2s, opacity .2s, background .2s; }
.primary:hover:not(:disabled) { transform: translateY(-1px); background: #164f3b; }
.primary:disabled { cursor: not-allowed; opacity: .38; box-shadow: none; }
.primary svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.divider { display: flex; align-items: center; gap: 14px; margin: 15px 4px 8px; color: #9a9f9c; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; height: 1px; background: #e7e4dc; flex: 1; }
.demo-button { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; text-align: left; }
.demo-button:hover { background: #f6f4ed; }
.play { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 99px; background: var(--green-soft); color: var(--green); }
.play svg { width: 13px; fill: currentColor; }
.demo-time { margin-left: auto; color: #919793; font-size: 11px; font-weight: 400; }
.trust-row { margin: 21px auto 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 23px; color: #7b847f; font-size: 11px; }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.loading { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 50px 0 100px; }
.loading-card { width: min(590px, 100%); text-align: center; border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 62px 50px; box-shadow: 0 20px 55px rgba(46,55,50,.07); }
.spinner { width: 38px; height: 38px; display: inline-block; border: 2px solid #dfe6e1; border-top-color: var(--green); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-kicker { margin: 22px 0 7px !important; color: var(--green) !important; font-size: 11px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.loading-card h2 { margin: 0; font-family: var(--serif); font-size: 38px; font-weight: 400; }
.loading-card p { color: var(--muted); font-size: 13px; }
.loading-track { height: 3px; margin-top: 31px; background: #eceae3; border-radius: 99px; overflow: hidden; }
.loading-track span { display: block; width: 40%; height: 100%; background: var(--green); border-radius: inherit; animation: load 2s ease-in-out infinite alternate; }
@keyframes load { from { transform: translateX(-30%); } to { transform: translateX(180%); } }

.results { padding: 48px 0 90px; }
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; border-bottom: 1px solid #d7d4cb; padding-bottom: 26px; }
.back-button { border: 0; padding: 0; margin-bottom: 38px; background: transparent; color: #707974; cursor: pointer; font-size: 12px; }
.back-button:hover { color: var(--green); }
.back-button span { margin-right: 5px; }
.results-head h2 { margin: 10px 0 5px; font-family: var(--serif); font-size: clamp(40px, 5vw, 58px); font-weight: 400; letter-spacing: -.03em; }
.results-head p { margin: 0; color: var(--muted); font-size: 13px; }
.results-stat { min-width: 180px; display: flex; align-items: center; gap: 13px; border-left: 1px solid #cbc8bf; padding-left: 25px; margin-bottom: 5px; }
.results-stat strong { font-family: var(--serif); color: var(--green); font-size: 53px; line-height: 1; font-weight: 400; }
.results-stat span { color: #6f7873; font-size: 11px; line-height: 1.45; text-transform: uppercase; letter-spacing: .06em; }
.legend { display: flex; gap: 22px; align-items: center; padding: 18px 0 22px; color: #757d78; font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 17px; height: 6px; border-radius: 2px; }
.legend-delete { background: var(--delete-bg); border-bottom: 1px solid var(--delete); }
.legend-insert { background: var(--insert-bg); border-bottom: 1px solid var(--insert); }
.legend-note { margin-left: auto; font-style: italic; }
.change-list { display: grid; gap: 17px; }
.change-card { display: grid; grid-template-columns: 1.05fr .95fr; border: 1px solid #d6d3ca; border-radius: 15px; overflow: hidden; background: var(--card); box-shadow: 0 5px 20px rgba(46,55,50,.045); }
.redline-pane, .explain-pane { padding: 28px 30px 30px; }
.redline-pane { border-right: 1px solid #ddd9d0; background: #fffdfa; }
.explain-pane { background: #f8f7f1; }
.pane-label { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; color: #818883; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 700; }
.clause-pill { border: 1px solid #d9d6cc; border-radius: 99px; padding: 5px 9px; color: #58615c; background: #fff; text-transform: none; letter-spacing: 0; font-size: 10px; }
.redline-text { font-family: Georgia, serif; color: #313733; font-size: 15px; line-height: 1.9; }
.redline-text del { color: var(--delete); background: var(--delete-bg); text-decoration-thickness: 1px; text-decoration-color: #c26760; padding: 2px 1px; }
.redline-text ins { color: var(--insert); background: var(--insert-bg); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; padding: 2px 1px; }
.redline-text del + ins { margin-left: .16em; }
.lawyer-comment { margin-top: 22px; border-left: 3px solid #d1b84d; background: #fbf4d5; padding: 11px 13px; color: #665b2c; font-size: 11px; line-height: 1.55; }
.author { display: block; margin-top: 18px; color: #929792; font-size: 10px; }
.single-explanation { position: relative; border: 1px solid #d6dfd8; border-radius: 12px; background: #edf3ee; padding: 22px 48px 22px 21px; }
.single-explanation p { margin: 0; color: #2c4539; font-size: 14px; line-height: 1.72; }
.copy-button { position: absolute; right: 9px; top: 9px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #6c7c73; cursor: pointer; }
.copy-button:hover { background: #dbe7de; color: var(--green); }
.copy-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.error-view { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 50px 0 100px; }
.error-card { width: min(520px, 100%); text-align: center; padding: 50px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.error-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--delete-bg); color: var(--delete); font-family: var(--serif); font-size: 28px; }
.error-card h2 { font-family: var(--serif); font-size: 35px; font-weight: 400; margin: 16px 0 7px; }
.error-card p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 23px; }
footer { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid rgba(205,201,191,.7); color: #858c88; font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 20; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; border-radius: 99px; padding: 9px 14px; background: var(--ink); color: white; font-size: 11px; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1120px); }
  .nav { height: 68px; }
  .hero { padding: 52px 0 48px; }
  h1 { font-size: 48px; }
  .hero-copy { font-size: 15px; }
  .form-row { grid-template-columns: 1fr; }
  select, .primary { width: 100%; }
  .trust-row { align-items: flex-start; flex-direction: column; width: max-content; }
  .results { padding-top: 30px; }
  .results-head { align-items: flex-start; }
  .results-stat { display: none; }
  .legend { flex-wrap: wrap; }
  .legend-note { width: 100%; margin-left: 0; }
  .change-card { grid-template-columns: 1fr; }
  .redline-pane { border-right: 0; border-bottom: 1px solid #ddd9d0; }
  .redline-pane, .explain-pane { padding: 23px 21px; }
  footer { flex-direction: column; justify-content: center; text-align: center; }
}
