:root {
  --bg: #f4f1ea;
  --surface: #fffdf9;
  --surface-soft: #ece9df;
  --ink: #232b2a;
  --muted: #65706e;
  --line: #d8d8cf;
  --primary: #295f57;
  --primary-dark: #17443e;
  --accent: #b96d4d;
  --danger: #a13f36;
  --shadow: 0 18px 45px rgba(35, 43, 42, 0.08);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(185, 109, 77, 0.12), transparent 28rem),
    radial-gradient(circle at 100% 40%, rgba(41, 95, 87, 0.11), transparent 30rem),
    var(--bg);
  line-height: 1.55;
}

a { color: inherit; }

.site-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(35, 43, 42, 0.08);
}

.brand {
  font-weight: 750;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.privacy-pill,
.status-dot {
  color: var(--primary-dark);
  background: rgba(41, 95, 87, 0.1);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.page-shell {
  width: min(100% - 2rem, 980px);
  margin: 0 auto;
  padding: 3.5rem 0 5rem;
}

.site-footer {
  padding: 2rem 1rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
}

h1, h2 { line-height: 1.14; letter-spacing: -0.035em; }
h1 { margin: 0 0 1rem; font-size: clamp(2rem, 7vw, 4rem); }
h2 { margin: 0 0 0.65rem; font-size: 1.18rem; }
p { margin: 0 0 1rem; }

.eyebrow {
  margin-bottom: 0.65rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lead { color: #45504e; font-size: 1.15rem; }
.muted, .form-hint { color: var(--muted); }
.form-hint { font-size: 0.8rem; }
.error-text, .form-error { color: var(--danger); }
.hidden { display: none !important; }

.card,
.summary-document,
.chat-card {
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid rgba(35, 43, 42, 0.09);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.narrow-card { width: min(100%, 720px); margin: 0 auto; }
.hero-card { padding: clamp(1.5rem, 5vw, 3.5rem); }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.trust-grid article {
  padding: 1rem;
  border-top: 1px solid var(--line);
}

.trust-number {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 800;
}

.trust-grid p { color: var(--muted); font-size: 0.92rem; }

.notice,
.deletion-note,
.summary-offer {
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: rgba(41, 95, 87, 0.08);
  border: 1px solid rgba(41, 95, 87, 0.16);
}

.notice { margin: 2rem 0; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled { opacity: 0.62; cursor: wait; }
.button.primary { color: white; background: var(--primary); }
.button.primary:hover:not(:disabled) { background: var(--primary-dark); }
.button.secondary { color: var(--primary-dark); background: white; border-color: var(--line); }
.full-width { width: 100%; }

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-header h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
.section-header .lead { max-width: 680px; }

.chat-card {
  display: flex;
  min-height: 48vh;
  max-height: 62vh;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  padding: clamp(1rem, 4vw, 2rem);
  scroll-behavior: smooth;
}

.message { display: flex; max-width: 78%; flex-direction: column; gap: 0.3rem; }
.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }
.message-label { color: var(--muted); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; }
.message.user .message-label { text-align: right; }
.message-content {
  padding: 0.9rem 1.05rem;
  border-radius: 16px;
  background: var(--surface-soft);
  white-space: pre-wrap;
}
.message.user .message-content { color: white; background: var(--primary); border-bottom-right-radius: 4px; }
.message.assistant .message-content { border-bottom-left-radius: 4px; }
.message.streaming .message-content::after { content: "▋"; animation: blink 0.8s infinite; }
@keyframes blink { 50% { opacity: 0; } }

.summary-offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
}
.summary-offer p { margin: 0; color: var(--muted); }

.composer { margin-top: 1rem; }
label { display: block; margin-bottom: 0.45rem; font-size: 0.84rem; font-weight: 750; }
textarea {
  width: 100%;
  resize: vertical;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea:focus { outline: 3px solid rgba(41, 95, 87, 0.18); border-color: var(--primary); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; }

.summary-document { overflow: hidden; }
.summary-document section { padding: 1.4rem clamp(1.2rem, 4vw, 2.5rem); border-bottom: 1px solid var(--line); }
.summary-document section:last-child { border-bottom: 0; }
.summary-document .summary-intro { background: rgba(41, 95, 87, 0.08); }
.summary-document ul, .result-list { margin: 0; padding-left: 1.3rem; }
.summary-document li + li { margin-top: 0.55rem; }

.two-column-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.action-card { padding: 1.4rem; }
.action-card textarea { margin-bottom: 1rem; }
.approval-card { display: flex; flex-direction: column; }
.approval-card .button { margin-top: auto; }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.7rem; margin: 1rem 0 1.5rem; font-weight: 500; }
.checkbox-row input { width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; accent-color: var(--primary); }

.waiting-card { text-align: center; }
.waiting-symbol {
  width: 64px;
  height: 64px;
  margin: 0 auto 2rem;
  border: 7px solid rgba(41, 95, 87, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-document { margin-top: 1.5rem; }
.deletion-note { display: flex; gap: 1rem; margin-top: 1rem; }
.deletion-note p { margin: 0.25rem 0; color: var(--muted); }
.deletion-note time { color: var(--muted); font-size: 0.82rem; }
.deletion-check { display: grid; flex: 0 0 auto; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; color: white; background: var(--primary); font-weight: 900; }

@media (max-width: 720px) {
  .page-shell { width: min(100% - 1rem, 980px); padding-top: 1.5rem; }
  .site-header { min-height: 58px; padding: 0 1rem; }
  .privacy-pill { font-size: 0.68rem; }
  .trust-grid, .two-column-actions { grid-template-columns: 1fr; }
  .trust-grid { gap: 0; }
  .section-header { flex-direction: column; }
  .status-dot { align-self: flex-start; }
  .chat-card { min-height: 52vh; max-height: 58vh; border-radius: 16px; }
  .message { max-width: 92%; }
  .summary-offer { align-items: stretch; flex-direction: column; }
  .summary-offer .button { width: 100%; }
  .composer-actions { align-items: stretch; flex-direction: column; }
  .composer-actions .button { width: 100%; }
  .hero-card { padding: 1.35rem; }
}
