:root{
  --navy: #0F2A47;
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-soft: #EFF4FF;
  --bg: #F7F9FC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #101828;
  --text-muted: #5B6675;
  --success: #0F9D6E;
  --radius: 10px;
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:'Inter', sans-serif;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
h1,h2{font-family:'Manrope', sans-serif; font-weight:800; margin:0; color:var(--navy);}
.wrap{max-width:920px; margin:0 auto; padding:0 24px;}
.wrap-narrow{max-width:640px; margin:0 auto; padding:0 24px;}

nav{
  position:sticky; top:0; z-index:20;
  background:rgba(247,249,252,0.9);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
}
nav .wrap{display:flex; align-items:center; justify-content:space-between; padding:16px 24px;}
.brand{display:flex; align-items:center; gap:10px;}
.mark{
  width:30px; height:30px; border-radius:8px;
  background:linear-gradient(135deg, var(--blue), var(--navy));
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-family:'Manrope', sans-serif; font-weight:800; font-size:15px;
}
.mark.small{width:26px; height:26px; font-size:13px; border-radius:6px;}
.brand span{font-family:'Manrope', sans-serif; font-weight:800; font-size:18px; color:var(--navy);}
.nav-cta{
  font-family:'Inter', sans-serif; font-size:14px; font-weight:600;
  color:#fff; background:var(--blue); padding:10px 18px; border-radius:8px; text-decoration:none;
}
.nav-cta:hover{background:var(--blue-dark);}

.hero{padding:80px 0 56px; border-bottom:1px solid var(--border);}
.eyebrow{
  font-size:13px; font-weight:600; letter-spacing:0.04em; text-transform:uppercase;
  color:var(--blue);
}
.hero h1{font-size:42px; line-height:1.16; max-width:600px; margin-top:16px;}
.accent{color:var(--blue);}
.hero .sub{margin-top:20px; max-width:480px; color:var(--text-muted); font-size:17px;}
.btn-primary{
  display:inline-block; margin-top:28px;
  font-family:'Inter', sans-serif; font-size:15px; font-weight:600;
  background:var(--blue); color:#fff; border:none; padding:15px 26px; border-radius:8px;
  cursor:pointer; text-decoration:none;
}
.btn-primary:hover{background:var(--blue-dark);}
.btn-full{width:100%; text-align:center;}

.trust-row{display:flex; gap:32px; margin-top:48px; flex-wrap:wrap;}
.trust-item{display:flex; flex-direction:column; gap:2px;}
.trust-item strong{font-size:14px; color:var(--navy);}
.trust-item span{font-size:13px; color:var(--text-muted);}

.form-section{padding:64px 0;}
.form-section h2{font-size:26px;}
.form-section .lead{color:var(--text-muted); margin:10px 0 32px;}
.field{margin-bottom:18px;}
.field label{
  display:block; font-size:13px; font-weight:600; color:var(--navy); margin-bottom:7px;
}
select, textarea, input[type=text]{
  width:100%; background:var(--surface); border:1px solid var(--border); color:var(--text);
  padding:13px 14px; border-radius:8px; font-family:'Inter', sans-serif; font-size:15px;
  resize:vertical;
}
select:focus, textarea:focus, input:focus{
  outline:none; border-color:var(--blue); box-shadow:0 0 0 3px var(--blue-soft);
}
textarea{min-height:110px;}
.link-btn{
  background:none; border:none; color:var(--blue); font-size:14px; font-weight:600;
  cursor:pointer; padding:4px 0; margin-bottom:10px;
}
.field-group{
  padding-top:6px; border-top:1px dashed var(--border); margin-top:6px;
}
.error-msg{
  margin-top:14px; padding:12px 14px; border-radius:8px; background:#FEF2F2;
  border:1px solid #FCA5A5; color:#B91C1C; font-size:14px; display:none;
}
.error-msg.visible{display:block;}

.checkbox-field{display:flex; flex-direction:column; gap:6px;}
.checkbox-label{
  display:flex; align-items:center; gap:10px; font-size:14px; font-weight:600; color:var(--navy);
  cursor:pointer;
}
.checkbox-label input[type=checkbox]{
  width:18px; height:18px; accent-color:var(--blue); cursor:pointer;
}
.checkbox-hint{font-size:12.5px; color:var(--text-muted); margin:0 0 0 28px;}

.output-section{padding:0 0 88px;}
.doc{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden;
  box-shadow: 0 20px 40px rgba(15,42,71,0.08);
  margin-top:20px;
}
.doc-head{
  padding:18px 24px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  background:var(--blue-soft);
  font-size:13px; font-weight:600; color:var(--navy);
}
.doc-body-wrap{position:relative;}
.doc-body{
  padding:28px 24px; font-size:15px; line-height:1.75; white-space:pre-wrap; color:var(--text);
  outline:none;
}
.doc-body.unlocked{cursor:text;}
.doc-body.unlocked:focus{background:var(--blue-soft);}
.doc-fade{
  position:absolute; left:0; right:0; bottom:0; height:130px;
  background:linear-gradient(to bottom, rgba(255,255,255,0), var(--surface) 78%);
  backdrop-filter:blur(3px);
  pointer-events:none;
}
.doc-body.unlocked ~ .doc-fade, .doc-fade.hidden{display:none;}
.doc-foot{
  padding:18px 24px; border-top:1px solid var(--border); display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:var(--bg);
}
.doc-btn{
  font-family:'Inter', sans-serif; font-size:13.5px; font-weight:600;
  padding:11px 18px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--navy);
  cursor:pointer; text-decoration:none;
}
.doc-btn.filled{background:var(--blue); color:#fff; border-color:var(--blue);}
.doc-btn.filled:hover{background:var(--blue-dark);}
.edit-hint{font-size:12.5px; color:var(--text-muted);}

.disclaimer{margin-top:18px; font-size:13px; color:var(--text-muted); max-width:600px;}
.disclaimer a{color:var(--blue);}

.context-box{
  margin-top:16px; padding:16px 18px; background:var(--surface); border:1px solid var(--border);
  border-radius:8px;
}
.context-label{
  font-size:12px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color:var(--blue);
}
.context-box ul{margin:10px 0 0; padding-left:18px;}
.context-box li{font-size:13.5px; line-height:1.6; color:var(--text); margin-bottom:6px;}
.context-disclaimer{font-size:12px; color:var(--text-muted); margin:10px 0 0;}

.detected-badge{
  margin-top:8px; font-size:13px; font-weight:600; color:var(--blue);
  background:var(--blue-soft); padding:8px 12px; border-radius:6px; display:inline-block;
}

.upload-row{margin-top:8px;}
.upload-btn{
  display:inline-flex; align-items:center; gap:6px;
  font-size:13px; font-weight:600; color:var(--blue);
  border:1px dashed var(--blue); background:var(--blue-soft);
  padding:8px 14px; border-radius:6px; cursor:pointer;
}
.upload-btn:hover{background:#E0EAFE;}
.upload-btn.loading{opacity:0.7; cursor:wait;}

.history-section{padding:0 0 48px;}
.history-title{font-size:22px; margin-top:4px;}
.history-section .lead{color:var(--text-muted); margin:8px 0 20px; font-size:14px;}
.history-item{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--surface); border:1px solid var(--border); border-radius:8px;
  padding:14px 16px; margin-bottom:10px; cursor:pointer;
}
.history-item:hover{border-color:var(--blue);}
.history-item-left{display:flex; flex-direction:column; gap:2px;}
.history-item-title{font-size:14px; font-weight:600; color:var(--navy);}
.history-item-meta{font-size:12.5px; color:var(--text-muted);}
.history-status{
  font-size:12px; font-weight:600; padding:4px 10px; border-radius:20px; white-space:nowrap;
}
.history-status.unlocked{background:#DCFCE7; color:#166534;}
.history-status.locked{background:var(--bg); color:var(--text-muted); border:1px solid var(--border);}

footer{border-top:1px solid var(--border); padding:32px 0; margin-top:20px;}
footer .wrap{color:var(--text-muted); font-size:13px;}

@media (max-width:640px){
  .hero h1{font-size:32px;}
  .hero{padding:56px 0 40px;}
}
