:root {
  --ink: #172824;
  --muted: #63716d;
  --paper: #f4f2eb;
  --card: #fffdf8;
  --forest: #174d3b;
  --forest-deep: #103b2e;
  --mint: #dcece4;
  --gold: #c89a48;
  --border: #d8d8ce;
  --danger: #9c3c35;
  --shadow: 0 18px 50px rgb(21 49 40 / 10%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 16%, rgb(204 226 215 / 55%), transparent 28rem),
    linear-gradient(140deg, #f8f5ed, var(--paper));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.site-header {
  height: 78px;
  padding: 0 clamp(24px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(23 40 36 / 10%);
  background: rgb(255 253 248 / 82%);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--forest);
  font-family: Georgia, serif;
  letter-spacing: .04em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 17px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.read-only-badge, .provider-label {
  border: 1px solid #b9d3c5;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--forest);
  background: #edf7f1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.read-only-badge span { color: #3f936b; }

main { max-width: 1500px; margin: 0 auto; padding: clamp(24px, 4vw, 54px); }
.notice {
  max-width: 1000px;
  margin: 0 auto 24px;
  padding: 13px 16px;
  border: 1px solid #c8d8cf;
  border-radius: 12px;
  background: #edf7f1;
}
.notice[data-kind="error"] { color: var(--danger); border-color: #e2beb9; background: #fbefed; }
.notice[data-kind="success"] { color: var(--forest); }

.login-shell {
  min-height: calc(100vh - 186px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  align-items: center;
  gap: clamp(44px, 8vw, 120px);
}
.eyebrow { margin: 0 0 12px; color: var(--forest); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.intro-panel h1, .chat-heading h1 {
  margin: 0;
  max-width: 720px;
  font: 400 clamp(42px, 6vw, 78px)/1.02 Georgia, serif;
  letter-spacing: -.035em;
}
.lede { max-width: 680px; margin: 24px 0 34px; color: #4e5f5a; font-size: clamp(17px, 2vw, 21px); line-height: 1.55; }
.assurance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.assurance-grid div { padding-left: 14px; border-left: 2px solid var(--gold); }
.assurance-grid strong, .assurance-grid span { display: block; }
.assurance-grid strong { font-family: Georgia, serif; font-size: 17px; }
.assurance-grid span { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.35; }

.card { border: 1px solid rgb(23 40 36 / 12%); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.login-card { padding: clamp(28px, 4vw, 44px); }
.login-card h2 { margin: 0 0 28px; font: 400 35px/1.1 Georgia, serif; }
label { display: block; margin: 16px 0 7px; font-size: 13px; font-weight: 750; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input, select { height: 46px; padding: 0 13px; }
textarea { resize: vertical; min-height: 88px; padding: 14px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: #548b75; box-shadow: 0 0 0 3px rgb(84 139 117 / 15%); }

.button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 750;
  transition: transform .12s, background .12s, opacity .12s;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { color: #fff; background: var(--forest); }
.button-primary:hover:not(:disabled) { background: var(--forest-deep); }
.login-card .button-primary { width: 100%; margin-top: 24px; }
.button-secondary { border: 1px solid #b4cbbf; color: var(--forest); background: #f4faf6; }
.button-quiet { color: var(--ink); background: transparent; }
.form-error { margin: 14px 0 0; color: var(--danger); font-size: 13px; }

.workspace {
  min-height: calc(100vh - 186px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgb(23 40 36 / 12%);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.sidebar { padding: 30px; display: flex; flex-direction: column; gap: 28px; border-right: 1px solid var(--border); background: #f1f5ef; }
.sidebar h2 { margin: 0; font: 400 25px/1.2 Georgia, serif; }
.muted { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.client-picker label { margin-top: 0; }
.connection-status { min-height: 36px; margin: 9px 0 13px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.connection-status[data-connected="true"] { color: var(--forest); }
.client-picker .button { width: 100%; }
.add-client { padding-top: 20px; border-top: 1px solid var(--border); }
.add-client summary { cursor: pointer; color: var(--forest); font-size: 13px; font-weight: 750; }
.add-client .button { width: 100%; margin-top: 12px; }
.scope-note { margin-top: auto; padding: 16px; border-radius: 14px; color: #dbe8e2; background: var(--forest-deep); }
.scope-note strong { font-family: Georgia, serif; }
.scope-note p { margin: 7px 0 0; font-size: 12px; line-height: 1.5; }

.chat-panel { min-width: 0; padding: clamp(28px, 5vw, 62px); display: flex; flex-direction: column; }
.chat-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.chat-heading h1 { font-size: clamp(34px, 4vw, 54px); }
.empty-state { flex: 1; display: grid; place-content: center; justify-items: center; padding: 60px 0; text-align: center; }
.lens-icon { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: var(--mint); font: 34px Georgia, serif; }
.empty-state > p { margin: 18px 0; color: var(--muted); }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 720px; }
.suggestions button { border: 1px solid var(--border); border-radius: 999px; padding: 9px 13px; color: #496059; background: #fff; }
.suggestions button:hover { border-color: #7ca38f; }
.answer-panel { flex: 1; margin: 38px 0 28px; padding: clamp(22px, 4vw, 38px); border: 1px solid #d5dfd8; border-radius: 18px; background: #fbfcf8; }
.answer-meta { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.answer-panel p { margin: 22px 0 0; white-space: pre-wrap; line-height: 1.65; }
.composer { margin-top: auto; border: 1px solid #bfcfc6; border-radius: 16px; padding: 9px; background: #fff; box-shadow: 0 8px 26px rgb(26 61 48 / 8%); }
.composer textarea { border: 0; box-shadow: none; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 7px 2px 10px; }
.composer-footer span { color: var(--muted); font-size: 11px; }
.composer-footer .button { min-width: 92px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; padding: 30px 0; }
  .assurance-grid { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .scope-note { margin-top: 0; }
}

@media (max-width: 560px) {
  .site-header { padding: 0 18px; }
  .read-only-badge { display: none; }
  main { padding: 18px; }
  .chat-heading { display: block; }
  .provider-label { display: inline-block; margin-top: 16px; }
  .composer-footer { align-items: flex-end; }
  .composer-footer span { max-width: 200px; }
}
