:root {
  color-scheme: light;
  --ink: #15243b;
  --muted: #627089;
  --line: #e1e7f0;
  --paper: #ffffff;
  --canvas: #f5f7fb;
  --blue: #315ce8;
  --blue-dark: #2447bd;
  --mint: #dff8ed;
  --shadow: 0 20px 55px rgba(27, 48, 85, .09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 80% -20%, #e7edff 0, transparent 38%), var(--canvas);
  color: var(--ink);
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }
.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 72px);
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 750; letter-spacing: -.025em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; color: white; background: linear-gradient(145deg, #5476f2, #2948c9); box-shadow: 0 7px 16px #315ce83d; }
.site-nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.site-nav a:not(.button) { color: #4e5c72; font-size: .94rem; font-weight: 600; }
.site-nav form { margin: 0; }
.user-badge { color: var(--muted); font-size: .85rem; }
.page-shell { width: min(100% - 36px, 760px); margin: 44px auto 72px; }
.page-wide { width: min(100% - 48px, 2140px); }
.site-footer { padding: 24px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .9rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 10px 18px; border: 1px solid transparent; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); text-decoration: none; }
button:not(.button) { padding: 10px 16px; border: 1px solid #d5dce8; border-radius: 10px; background: white; color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
button:not(.button):hover { border-color: #9aacec; background: #f7f9ff; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 8px 18px #315ce832; }
.button-primary:hover { color: white; background: var(--blue-dark); }
.button-outline { color: var(--blue); border-color: #cbd6f7; background: white; }
.button-quiet { color: #526078; border-color: var(--line); background: white; }
.button-small { min-height: 40px; padding: 7px 15px; }
.button-full { width: 100%; }
.pricing-intro { margin: 20px 0 34px; text-align: center; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
.pricing-intro h1 { margin-bottom: 8px; font-size: clamp(2rem, 5vw, 3.15rem); line-height: 1.12; letter-spacing: -.055em; }
.pricing-intro > p:last-child { color: var(--muted); font-size: 1.08rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 22px; }
.plan-card { display: flex; flex-direction: column; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.plan-card-featured { border: 2px solid #7892f5; background: linear-gradient(180deg, #f7f9ff, white 36%); }
.plan-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.plan-heading h2 { margin: 0; font-size: 1.7rem; letter-spacing: -.035em; }
.plan-tag { padding: 5px 10px; border-radius: 999px; color: #58657a; background: #f0f3f8; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.plan-tag-accent { color: #2948c9; background: #e8edff; }
.plan-price { margin: 18px 0 2px; font-size: 2rem; font-weight: 800; letter-spacing: -.04em; }
.plan-price span { color: var(--muted); font-size: .9rem; font-weight: 500; letter-spacing: 0; }
.plan-summary { min-height: 50px; color: var(--muted); }
.feature-list { display: grid; gap: 11px; margin: 12px 0 25px; padding: 0; list-style: none; }
.feature-list li { position: relative; padding-left: 27px; }
.feature-list li::before { position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: #167b54; background: var(--mint); content: "✓"; font-size: .75rem; font-weight: 900; }
.plan-card .button { margin-top: auto; }
.subtle, .fine-print { color: var(--muted); font-size: .83rem; }
.fine-print { margin: 12px 0 0; text-align: center; }
.pricing-note { max-width: 680px; margin: 25px auto 0; color: var(--muted); text-align: center; font-size: .9rem; }
.form-card { width: min(100%, 460px); margin: 20px auto; padding: clamp(24px, 5vw, 38px); border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.form-card h1 { margin-bottom: 22px; font-size: 2rem; letter-spacing: -.04em; }
.field { display: block; margin: 15px 0; color: #46546b; font-size: .9rem; font-weight: 650; }
.field input, input, select, textarea { width: 100%; min-height: 46px; margin-top: 6px; padding: 10px 12px; border: 1px solid #d5dce8; border-radius: 10px; outline: none; background: white; color: var(--ink); font: inherit; }
.field input:focus, input:focus, select:focus, textarea:focus { border-color: #7892f5; box-shadow: 0 0 0 3px #315ce81a; }
.form-note { margin: 16px 0 0; color: var(--muted); text-align: center; }
.err, .ok, .warning { padding: 12px 15px; border-radius: 11px; }
.err { color: #a72f3a; background: #fff0f1; }
.ok { color: #167b54; background: #eaf9f1; }
.warning { color: #8a5a00; background: #fff6dd; }
pre { overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; white-space: pre-wrap; }
.dashboard-heading { margin-bottom: 22px; }
.dashboard-heading h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.35rem); letter-spacing: -.045em; }
.dashboard-layout { display: grid; grid-template-columns: minmax(390px, 440px) minmax(0, 1fr); align-items: start; gap: 28px; }
.contract-sidebar, .panel { border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.contract-sidebar { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; padding: 22px 18px; }
.sidebar-usage { display: grid; gap: 13px; margin-bottom: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f8faff; }
.sidebar-usage > .eyebrow { margin-bottom: -4px; }
.usage-metric { display: grid; gap: 5px; }
.usage-metric-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: #526078; font-size: .8rem; }
.usage-metric-label strong { color: var(--ink); font-size: .78rem; white-space: nowrap; }
.usage-metric progress { display: block; width: 100%; height: 8px; overflow: hidden; appearance: none; border: 0; border-radius: 999px; background: #e2e8f4; }
.usage-metric progress::-webkit-progress-bar { border-radius: 999px; background: #e2e8f4; }
.usage-metric progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, #5476f2, #315ce8); }
.usage-metric progress::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, #5476f2, #315ce8); }
.usage-metric small { margin-top: -3px; color: var(--muted); font-size: .72rem; }
.sidebar-usage .warning { margin: 0; font-size: .8rem; }
.sidebar-usage > .button { margin-top: 1px; }
.sidebar-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.sidebar-heading h2, .panel h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.025em; }
.sidebar-heading .eyebrow { margin-bottom: 2px; }
.file-count, .folder-count { display: inline-grid; place-items: center; min-width: 25px; height: 25px; padding: 0 6px; border-radius: 999px; color: #57657a; background: #eef1f6; font-size: .75rem; font-weight: 750; }
.sidebar-hint { margin: 14px 6px; color: var(--muted); font-size: .81rem; }
.folder-tree { display: grid; gap: 8px; }
.folder-group { min-width: 0; }
.folder-row { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 7px; border-radius: 9px; background: #f5f7fb; cursor: pointer; }
.folder-row[draggable="true"] { cursor: grab; }
.folder-row[draggable="true"]:active { cursor: grabbing; }
.folder-heading { display: flex; align-items: center; gap: 4px; }
.folder-heading .folder-row { flex: 1; min-width: 0; }
.folder-actions { position: relative; flex: 0 0 auto; }
.folder-actions summary { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: .8rem; font-weight: 800; list-style: none; }
.folder-actions summary::-webkit-details-marker { display: none; }
.folder-actions summary:hover { background: #e9edf5; }
.folder-rename-form { position: absolute; z-index: 4; top: 32px; right: 0; display: grid; gap: 7px; width: 220px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 14px 35px rgba(27,48,85,.16); }
.folder-rename-form label { color: var(--muted); font-size: .75rem; font-weight: 650; }
.folder-rename-form input { min-height: 35px; margin: 4px 0 0; padding: 6px 8px; font-size: .8rem; }
.folder-row input, .file-choice input { flex: 0 0 16px; width: 16px; min-height: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--blue); }
.folder-glyph { color: #526fe0; font-size: .95rem; }
.folder-label { min-width: 0; overflow: hidden; flex: 1; font-size: .87rem; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { min-width: 22px; height: 22px; }
.file-list { display: grid; gap: 3px; margin: 3px 0 7px 13px; padding-left: 9px; border-left: 1px solid var(--line); }
.file-entry { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 3px; border-radius: 8px; }
.file-entry:hover { background: #f8f9fc; }
.file-choice { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; padding: 4px 0; cursor: pointer; }
.file-glyph { flex: 0 0 auto; color: #8190a6; font-size: .85rem; }
.file-name { min-width: 0; overflow: hidden; color: #46546b; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.file-size { flex: 0 0 auto; color: #8a96a8; font-size: .68rem; }
.file-actions { position: relative; flex: 0 0 auto; }
.file-actions summary { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: .8rem; font-weight: 800; list-style: none; }
.file-actions summary::-webkit-details-marker { display: none; }
.file-actions summary:hover { background: #e9edf5; }
.action-menu { position: absolute; z-index: 4; top: 32px; right: 0; display: grid; gap: 9px; width: 205px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 14px 35px rgba(27,48,85,.16); }
.action-menu form { margin: 0; }
.action-menu label { display: block; color: var(--muted); font-size: .75rem; font-weight: 650; }
.action-menu input { min-height: 35px; margin: 4px 0 6px; padding: 6px 8px; font-size: .8rem; }
.action-menu .button { min-height: 34px; padding: 6px 11px; font-size: .8rem; }
.button-danger { color: #aa3440; border-color: #f1cdd1; background: #fff7f7; }
.empty-library { padding: 32px 8px; color: var(--muted); text-align: center; }
.empty-library > span { color: #9ba8ba; font-size: 2rem; }
.empty-library p { margin: 6px 0 0; color: var(--ink); font-weight: 700; }
.empty-library small { font-size: .8rem; }
.sidebar-upload-form { margin-top: 18px; padding: 18px 12px 8px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcff; }
.sidebar-upload-form > .eyebrow { margin-bottom: 10px; }
.sidebar-upload-form .field { margin: 10px 0; }
.sidebar-upload-form input[type="file"] { min-height: 40px; padding: 7px; font-size: .8rem; }
.drop-zone { display: grid; justify-items: center; gap: 4px; margin: 13px 0; padding: 22px 13px; border: 1.5px dashed #aab8d2; border-radius: 14px; background: #f8faff; color: #4d5d76; text-align: center; cursor: copy; transition: background .15s,border .15s,transform .15s; }
.drop-zone strong { font-size: .87rem; }
.drop-zone small { max-width: 300px; color: var(--muted); font-size: .73rem; }
.drop-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; color: white; background: var(--blue); font-size: 1.3rem; }
.drop-zone.is-dragover { transform: scale(1.015); border-color: var(--blue); background: #ebf0ff; }
.upload-status { min-height: 1.4em; margin: 4px 0 8px; color: var(--muted); font-size: .77rem; }
.folder-row.is-drop-target { outline: 2px solid var(--blue); background: #e8edff; }
.file-entry[draggable="true"] { cursor: grab; }
.file-entry[draggable="true"]:active { cursor: grabbing; }
.deadline-alerts, .deadline-results { margin: 18px 0; padding: 20px; border: 1px solid #f0d99b; border-radius: 16px; background: #fffaf0; }
.deadline-alerts .eyebrow, .deadline-results .eyebrow { color: #8a5a00; }
.deadline-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.deadline-card { display: grid; gap: 2px; padding: 12px; border: 1px solid #f1e4bf; border-radius: 11px; background: white; }
.deadline-card span { font-size: .88rem; }
.deadline-card small { color: var(--muted); }
.deadline-candidate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr); gap: 20px; padding: 17px 0; border-top: 1px solid #eadfbf; }
.deadline-candidate blockquote { margin: 7px 0; padding-left: 12px; border-left: 3px solid #e3c56b; color: #5e6572; }
.deadline-candidate .warning { margin: 8px 0; }
.reminder-form { display: grid; align-content: start; gap: 4px; }
.reminder-form .field { margin: 0 0 7px; }
.dashboard-main { display: grid; gap: 18px; min-width: 0; }
.panel { padding: clamp(18px, 3vw, 26px); }
.panel > .eyebrow { margin-bottom: 4px; }
.panel-note { margin: 6px 0 16px; color: var(--muted); font-size: .87rem; }
.upload-panel { display: grid; grid-template-columns: minmax(170px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 16px; }
.upload-panel h2 { margin-bottom: 0; }
.upload-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.upload-form .field { min-width: 0; margin: 0; }
.upload-form .field input { margin-top: 4px; }
.upload-form > button { min-height: 44px; white-space: nowrap; }
.analysis-panel h2 { margin-bottom: 0; }
.analysis-panel .panel-note { margin-bottom: 18px; }
.analysis-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.analysis-fields .field { margin: 0 0 14px; }
.analysis-panel .field > span, .situation-field label > span { display: block; }
.situation-field { margin: 0 0 14px; }
.situation-field textarea { display: block; min-height: 130px; resize: vertical; }
.analysis-status { min-height: 1.4em; margin: 10px 0 0; color: var(--muted); font-size: .88rem; }
.analysis-status.is-loading { color: #405cae; }
.analysis-status.is-success { color: #167b54; }
.analysis-status.is-error { padding: 10px 12px; border-radius: 9px; color: #a72f3a; background: #fff0f1; }
.analysis-panel button:disabled { opacity: .7; cursor: progress; }
#analysis-results { scroll-margin-top: 20px; }
.evaluation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.evaluation-card { min-width: 0; padding: 20px; border: 1px solid #cbd6f7; border-radius: 16px; background: linear-gradient(145deg, #f1f4ff, #fff 78%); box-shadow: var(--shadow); }
.evaluation-card .eyebrow { margin-bottom: 10px; line-height: 1.4; }
.evaluation-value { overflow-wrap: anywhere; font-size: 1.02rem; font-weight: 650; }
.evaluation-value strong { color: #213fa9; font-size: 1.35em; font-weight: 850; }
.evaluation-value p, .evaluation-value ul { margin: 0; }
.evaluation-value ul { padding-left: 1.1em; }
.evaluation-value li + li { margin-top: .5em; }
.result-panel { margin-top: 18px; }
.markdown-body { overflow-wrap: anywhere; line-height: 1.72; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { margin: 1.35em 0 .55em; line-height: 1.25; }
.markdown-body h1:first-child, .markdown-body h2:first-child, .markdown-body h3:first-child { margin-top: 0; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote { margin: 0 0 1em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.55em; }
.markdown-body li { padding-left: .15em; }
.markdown-body li > p { margin: 0; }
.markdown-body li + li { margin-top: .35em; }
.markdown-body code { padding: .12em .35em; border-radius: 5px; background: #eef1f6; font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.markdown-body pre code { padding: 0; background: transparent; }
.markdown-body blockquote { padding: 3px 0 3px 16px; border-left: 3px solid #b7c4e9; color: var(--muted); }
.markdown-body table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1em 0; }
.markdown-body th, .markdown-body td { padding: 9px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-body th { background: #f1f4fa; }
.markdown-body pre { max-height: 75vh; }
[hidden] { display: none !important; }
.profile-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 14px 20px;
  border: 1px solid #c9d8fb;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0f4ff, #ffffff);
}
.profile-banner-content { display: grid; gap: 3px; }
.profile-banner-content strong { color: #2041b6; font-size: .95rem; }
.profile-banner-content span { color: var(--muted); font-size: .86rem; }

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 24px;
  margin-top: 10px;
}
.account-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow);
}
.account-divider {
  margin: 22px 0 16px;
  border: none;
  border-top: 1px solid var(--line);
}
.profile-form { display: grid; gap: 6px; }

@media (max-width: 700px) {
  .profile-banner { flex-direction: column; align-items: flex-start; }
  .account-grid { grid-template-columns: 1fr; }
  .evaluation-grid { grid-template-columns: 1fr; }
  .site-header { align-items: flex-start; }
  .site-nav { justify-content: flex-end; flex-wrap: wrap; gap: 10px 14px; }
  .user-badge { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
  .plan-summary { min-height: auto; }
  .dashboard-layout { grid-template-columns: minmax(0, 1fr); }
  .contract-sidebar { position: static; max-height: 420px; }
  .upload-panel { grid-template-columns: minmax(0, 1fr); }
  .upload-form { grid-template-columns: minmax(0, 1fr); }
  .deadline-candidate { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 2181px) {
  .dashboard-layout { grid-template-columns: 460px minmax(0, 1fr); gap: 34px; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .dashboard-layout { grid-template-columns: minmax(300px, 36vw) minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 460px) {
  .site-header { padding: 13px 16px; }
  .brand { font-size: .9rem; }
  .brand-mark { width: 33px; height: 33px; }
  .site-nav { gap: 8px; font-size: .85rem; }
  .site-nav .button { padding: 7px 10px; }
  .page-shell { margin-top: 28px; }
}

.legal-doc { max-width: 760px; margin: 0 auto; line-height: 1.65; }
.legal-doc h2 { margin-top: 1.6em; font-size: 1.15rem; }
.field-check { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; font-size: .9rem; }
.field-check input { width: auto; margin-top: 4px; }

.lang-switch { margin: 0; }
.lang-switch select { font: inherit; font-size: .88rem; font-weight: 600; color: #4e5c72; background: transparent; border: 1px solid #d5dbe5; border-radius: 8px; padding: 5px 8px; cursor: pointer; }

.home-hero { max-width: 760px; margin: clamp(10px, 4vw, 40px) 0 34px; }
.home-hero h1 { margin: 0 0 14px; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.1; }
.home-lead { margin: 0 0 22px; color: var(--muted); font-size: 1.1rem; line-height: 1.6; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.home-section { margin: 0 0 34px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.home-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.home-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.home-card p { margin: 0; color: var(--muted); line-height: 1.55; }
