:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #18231d;
  --muted: #7d877f;
  --line: #e8e8df;
  --paper: #fbfaf6;
  --white: #fff;
  --forest: #244737;
  --forest-dark: #19382a;
  --sage: #e7eee6;
  --lime: #d9e8a0;
  --terracotta: #bc7656;
  --shadow: 0 24px 70px #17281c14;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #94b278;
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .19;
  pointer-events: none;
}
.ambient-one { top: -28vw; right: -10vw; background: #dae9a6; }
.ambient-two { bottom: -35vw; left: -18vw; background: #c9dcca; }

.auth-layout {
  display: grid;
  grid-template-columns: minmax(340px, .95fr) 1.05fr;
  width: min(1130px, calc(100% - 56px));
  min-height: 690px;
  margin: 38px auto;
  overflow: hidden;
  border: 1px solid #e8e9df;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px 45px;
  background:
    radial-gradient(ellipse at 80% 86%, #66896640, transparent 47%),
    linear-gradient(150deg, #172f24, #274736 70%, #375943);
  color: #f5f2e6;
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -.045em;
  text-decoration: none;
}
.brand-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #f4f3e42f;
  border-radius: 11px;
  background: #f8f4de;
  color: #284633;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
}
.brand-amp { color: #b8cd8a; }

.intro-copy { max-width: 470px; margin: 80px 0 55px; }
.eyebrow {
  display: block;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
}
.auth-intro .eyebrow { color: #bed09e; }
.intro-copy h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 4vw, 54px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: 1.12;
}
.intro-copy h1 span { color: #cbdc9a; }
.intro-copy p {
  max-width: 370px;
  margin: 21px 0 0;
  color: #f5f2e6bd;
  font-size: 14px;
  line-height: 1.7;
}
.privacy-note {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin-top: 28px;
  padding: 10px 13px;
  border: 1px solid #f8f4de26;
  border-radius: 10px;
  color: #f5f2e6dc;
  font-size: 11px;
}
.live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #83a97b;
  box-shadow: 0 0 0 3px #83a97b24;
}
.intro-bottom { color: #f5f2e688; font-family: Georgia, serif; font-size: 13px; font-style: italic; }

.auth-panel { display: grid; align-content: center; padding: 44px; }
.auth-card { width: min(100%, 390px); margin: auto; }
.auth-card h2, .section-heading h2, .chat-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -.04em;
}
.muted, .section-heading p, .chat-heading p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.muted { margin: 9px 0 24px; }
.form-stack { display: grid; gap: 15px; }
.form-stack label, .admin-form label {
  display: grid;
  gap: 7px;
  color: #49554b;
  font-size: 11px;
  font-weight: 700;
}
.form-stack input, .admin-form input {
  width: 100%;
  height: 42px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid #e4e6dd;
  border-radius: 9px;
  background: #fdfdfa;
  color: var(--ink);
  font-size: 12px;
  font-weight: 450;
  transition: border-color .15s, box-shadow .15s;
}
.form-stack input:focus, .admin-form input:focus, .composer textarea:focus {
  border-color: #819d79;
  box-shadow: 0 0 0 3px #819d791c;
  outline: 0;
}
.field-hint { color: #9a9e94; font-size: 10px; font-weight: 450; }
.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: transform .15s, background .15s, border-color .15s;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--forest); color: white; }
.button-primary:hover { background: var(--forest-dark); }
.button-primary:disabled { cursor: wait; opacity: .65; transform: none; }
.button-primary span { font-size: 15px; }
.button-quiet { border-color: var(--line); background: #fff; color: #5e695f; }
.button-quiet:hover { border-color: #cbd2c5; background: #f8f8f3; }
.auth-card .button-primary { width: 100%; min-height: 45px; margin-top: 5px; }
.auth-card .button-primary span { margin-left: auto; }
.switch-auth { margin: 19px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.link-button, .text-button { padding: 0; border: 0; background: transparent; color: var(--forest); cursor: pointer; font-weight: 750; }
.auth-footer { margin: 28px auto 0; color: #9b9e93; font-size: 10px; text-align: center; }
.notice { min-height: 0; margin-top: 8px; color: #9a4b39; font-size: 11px; line-height: 1.5; }
.notice:empty { display: none; }

.site-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: #fbfaf7;
}
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  min-height: 560px;
  flex-direction: column;
  padding: 29px 16px 17px;
  border-right: 1px solid #ecece4;
  background: #fff;
}
.sidebar-brand { padding: 0 9px; color: var(--ink); }
.workspace-tag {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 55px 10px 13px;
  color: #999e91;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .13em;
}
.nav-list { display: grid; gap: 5px; }
.nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #747d73;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  text-align: left;
}
.nav-item:hover { background: #f6f7f1; color: var(--ink); }
.nav-item.active { background: #eef2e9; color: var(--forest); }
.nav-symbol { width: 17px; color: #88947f; font-size: 16px; text-align: center; }
.nav-item.active .nav-symbol { color: var(--forest); }
.sidebar-spacer { flex: 1; }
.sidebar-account { display: flex; align-items: center; gap: 10px; padding: 12px 3px 2px; border-top: 1px solid #eee; }
.avatar {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  place-items: center;
  border-radius: 50%;
  background: #e8eee1;
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: 15px;
}
.account-label { display: grid; min-width: 0; gap: 3px; }
.account-label strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account-label small { color: var(--muted); font-size: 9px; }
.icon-button { margin-left: auto; padding: 7px; border: 0; background: transparent; color: #879083; cursor: pointer; font-size: 15px; }

.main-column { min-width: 0; padding: 0 43px 34px; }
.topbar {
  display: flex;
  min-height: 91px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #ecece5;
}
.topbar .eyebrow { margin-bottom: 4px; }
.topbar h1 { margin: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 500; letter-spacing: -.03em; }
.topbar-right { display: flex; align-items: center; gap: 11px; }
.model-pill, .credit-pill { display: inline-flex; min-height: 32px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: #687366; font-size: 9px; }
.model-pill .live-dot { width: 6px; height: 6px; flex-basis: 6px; }
.model-pill[data-state="offline"] .live-dot { background: #c1715f; box-shadow: 0 0 0 3px #c1715f1e; }
.credit-pill { gap: 6px; border-color: #dce5c8; background: #f4f6ec; color: #647348; }
.credit-pill > span { color: #8c9d56; }
.credit-pill strong { font-size: 11px; }
.credit-pill small { color: #89917e; font-size: 9px; }
.page { min-height: calc(100vh - 126px); padding-top: 30px; }
.chat-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.chat-heading h2, .section-heading h2 { font-size: 26px; }
.chat-heading p, .section-heading p { margin: 7px 0 0; }
.chat-messages {
  display: flex;
  height: min(50vh, 470px);
  min-height: 270px;
  flex-direction: column;
  gap: 17px;
  margin: 18px 0 13px;
  overflow-y: auto;
  padding: 8px 5px 13px;
  scrollbar-color: #dfe2d8 transparent;
  scrollbar-width: thin;
}
.welcome-card { max-width: 460px; margin: auto; padding: 8px 20px 17px; text-align: center; }
.welcome-orb { display: grid; width: 45px; height: 45px; place-items: center; margin: 0 auto 12px; border: 1px solid #e6e9d8; border-radius: 15px; background: #f3f5ea; color: #819151; font-size: 23px; }
.welcome-card h3 { margin: 0; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.welcome-card h3 span { color: #657948; }
.welcome-card p { max-width: 360px; margin: 8px auto 17px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.suggestions button { display: inline-flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid #e7e8df; border-radius: 9px; background: #fff; color: #5c675b; cursor: pointer; font-size: 10px; }
.suggestions button:hover { border-color: #cbd6bc; background: #f8f9f2; }
.suggestions button span { color: #899775; }
.chat-message { display: flex; max-width: 84%; align-items: flex-start; gap: 10px; }
.chat-message.user { align-self: flex-end; flex-direction: row-reverse; }
.message-badge { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border-radius: 50%; background: #edf0e7; color: #657748; font-family: Georgia, serif; font-size: 12px; }
.chat-message.user .message-badge { background: #e9eee8; color: #45624d; }
.message-content { min-width: 0; padding: 11px 14px; border: 1px solid #eaebe5; border-radius: 4px 13px 13px; background: #fff; color: #344037; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-image { display: block; max-width: min(100%, 320px); max-height: 240px; margin-top: 8px; border-radius: 8px; object-fit: contain; }
.chat-message.user .message-content { border-color: #e1e9d6; border-radius: 13px 4px 13px 13px; background: #f1f4ea; }
.message-time { display: block; margin-top: 5px; color: #a0a396; font-size: 9px; }
.composer { padding: 11px 13px 9px; border: 1px solid #e7e8df; border-radius: 13px; background: #fff; box-shadow: 0 5px 20px #18231d08; }
.composer-tools, .composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 9px; color: #979b90; font-size: 9px; }
.composer-tools label { display: flex; align-items: center; gap: 6px; color: #82887e; }
.composer-tools select { max-width: 185px; border: 0; background: transparent; color: #596d50; cursor: pointer; font-size: 10px; font-weight: 700; }
.composer-input { display: flex; align-items: flex-end; gap: 10px; padding-top: 8px; }
.attach-button { display: grid; width: 32px; height: 34px; flex: 0 0 32px; place-items: center; margin-bottom: 4px; border: 1px solid #e8eae1; border-radius: 9px; color: #61764e; cursor: pointer; font-size: 21px; }
.attach-button:hover { background: #f4f6ee; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.image-preview { display: flex; max-width: 300px; align-items: center; gap: 9px; margin: 8px 0 3px 40px; padding: 6px 8px; border: 1px solid #e8eae1; border-radius: 9px; background: #fafbf7; color: #66715f; font-size: 10px; }
.image-preview img { width: 38px; height: 38px; border-radius: 5px; object-fit: cover; }
.image-preview span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview button { border: 0; background: transparent; color: #8b766d; cursor: pointer; font-size: 18px; }
.composer textarea { width: 100%; min-height: 47px; max-height: 160px; resize: vertical; padding: 8px 2px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); font-size: 12px; line-height: 1.55; }
.composer textarea::placeholder { color: #a9aca2; }
.send-button { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; margin-bottom: 4px; border: 0; border-radius: 10px; background: var(--forest); color: #fff; cursor: pointer; font-size: 18px; }
.send-button:hover { background: var(--forest-dark); }
.send-button:disabled { cursor: wait; opacity: .6; }
.composer-foot { padding-top: 2px; }
.inline-error { color: #a75645; text-align: right; }

.section-heading { margin-bottom: 24px; }
.task-list { display: grid; gap: 10px; }
.task-card { display: grid; grid-template-columns: minmax(110px, .25fr) 1fr auto; align-items: center; gap: 17px; padding: 15px 17px; border: 1px solid #e9eae2; border-radius: 11px; background: #fff; }
.task-subject { color: #557052; font-size: 10px; font-weight: 750; }
.task-description { color: #354139; font-size: 12px; line-height: 1.55; }
.task-due { color: #8b9085; font-size: 10px; white-space: nowrap; }
.empty-state { padding: 35px 20px; border: 1px dashed #dfe2d8; border-radius: 11px; color: #888f83; font-size: 12px; text-align: center; }

.profile-card { width: min(460px,100%); padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.profile-credit { display: flex; align-items: center; gap: 12px; margin: 4px 0; padding: 13px; border: 1px solid #e8ebde; border-radius: 10px; background: #f6f7ef; color: #7b8b50; }
.profile-credit > span { font-size: 18px; }
.profile-credit div { display: grid; gap: 3px; }
.profile-credit strong { font-size: 15px; }
.profile-credit small { color: #969a88; font-size: 9px; }

.admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 13px; }
.admin-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.admin-wide { grid-column: 1 / -1; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-heading .eyebrow { margin-bottom: 4px; }
.card-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.admin-form { display: grid; gap: 10px; }
.task-form { grid-template-columns: .8fr 1.8fr .8fr auto auto; align-items: center; }
.admin-form input { height: 38px; }
.user-list { display: grid; gap: 8px; }
.user-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; padding: 9px 0; border-top: 1px solid #f0f0eb; }
.user-meta { display: grid; min-width: 0; gap: 4px; }
.user-meta strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: var(--muted); font-size: 9px; }
.user-actions { display: flex; align-items: center; gap: 7px; }
.user-actions input { width: 61px; height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 7px; font-size: 10px; }
.user-actions button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #52644f; cursor: pointer; font-size: 9px; }
.generated-key { margin-top: 12px; padding: 11px; border: 1px dashed #c4d0b4; border-radius: 9px; background: #f6f8ef; color: #455a39; font-family: Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.generated-key button { display: block; margin-top: 8px; border: 0; background: transparent; color: #4c6942; cursor: pointer; font: 700 10px system-ui, sans-serif; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 5; max-width: min(380px,calc(100vw - 40px)); padding: 11px 14px; transform: translateY(12px); border: 1px solid #dce3d5; border-radius: 10px; background: #fff; box-shadow: var(--shadow); color: #425744; font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .18s,transform .18s; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 850px) {
  .auth-layout { grid-template-columns: minmax(275px,.8fr) 1.2fr; width: min(730px,calc(100% - 28px)); min-height: 620px; margin: 14px auto; }
  .auth-intro { padding: 29px 26px; }
  .auth-panel { padding: 32px 24px; }
  .main-column { padding-right: 25px; padding-left: 25px; }
  .sidebar { width: 210px; }
  .site-shell { grid-template-columns: 210px minmax(0,1fr); }
  .task-form { grid-template-columns: 1fr 1fr; }
  .task-form button { width: fit-content; }
}
@media (max-width: 620px) {
  .auth-layout { display: block; width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; }
  .auth-intro { min-height: 245px; padding: 24px; }
  .intro-copy { margin: 32px 0 8px; }
  .intro-copy h1 { font-size: 34px; }
  .intro-copy p { margin-top: 10px; font-size: 11px; }
  .privacy-note, .intro-bottom { display: none; }
  .auth-panel { min-height: 470px; padding: 30px 22px; }
  .site-shell { display: flex; min-height: 100vh; flex-direction: column; }
  .sidebar { position: sticky; z-index: 3; top: 0; width: 100%; height: auto; min-height: 0; padding: 11px 13px 8px; border-right: 0; border-bottom: 1px solid #ecece4; }
  .sidebar-brand { display: none; }
  .workspace-tag { display: none; }
  .nav-list { display: flex; overflow-x: auto; gap: 5px; scrollbar-width: none; }
  .nav-item { min-height: 38px; flex: 0 0 auto; gap: 6px; padding: 0 10px; font-size: 10px; }
  .nav-symbol { font-size: 13px; }
  .sidebar-spacer { display: none; }
  .sidebar-account { position: absolute; top: 9px; right: 11px; width: auto; padding: 0; border: 0; }
  .sidebar-account .avatar, .account-label { display: none; }
  .icon-button { margin: 0; padding: 6px; }
  .main-column { padding: 0 15px 20px; }
  .topbar { min-height: 78px; gap: 8px; }
  .topbar h1 { font-size: 20px; }
  .topbar .eyebrow { font-size: 8px; }
  .topbar-right { gap: 5px; }
  .model-pill { max-width: 105px; gap: 5px; padding: 0 7px; font-size: 8px; }
  .credit-pill { gap: 4px; padding: 0 7px; font-size: 8px; }
  .page { min-height: calc(100vh - 135px); padding-top: 22px; }
  .chat-heading h2, .section-heading h2 { font-size: 23px; }
  .chat-heading p, .section-heading p { font-size: 10px; }
  .chat-heading .button { min-height: 33px; padding: 0 9px; font-size: 9px; }
  .chat-messages { height: calc(100dvh - 340px); min-height: 220px; margin-top: 9px; }
  .chat-message { max-width: 95%; }
  .message-content { font-size: 10px; }
  .suggestions button { font-size: 9px; }
  .composer { padding: 9px; }
  .composer-tools, .composer-foot { font-size: 8px; }
  .composer-tools select { max-width: 145px; font-size: 9px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-wide { grid-column: auto; }
  .task-form { grid-template-columns: 1fr; }
  .task-card { grid-template-columns: 1fr auto; gap: 5px 12px; padding: 13px; }
  .task-subject { grid-column: 1; }
  .task-description { grid-column: 1 / -1; grid-row: 2; }
  .task-due { grid-column: 2; grid-row: 1; }
}
