:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #697386;
  --line: #d9e0e7;
  --panel: #ffffff;
  --bg: #f4f7f6;
  --accent: #0b6b62;
  --accent-2: #c65f28;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

button:hover {
  filter: brightness(0.95);
}

button.ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

button.danger {
  background: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 28px;
  line-height: 1.2;
}

h3 {
  font-size: 18px;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(11, 107, 98, 0.12), transparent 28%),
    radial-gradient(circle at 80% 18%, rgba(198, 95, 40, 0.12), transparent 26%),
    linear-gradient(135deg, #f4f7f6 0%, #e8f0ed 100%);
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 50px rgba(23, 37, 84, 0.12);
}

.eyebrow {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.error {
  min-height: 20px;
  color: var(--danger);
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #fff;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-btn {
  justify-content: flex-start;
  width: 100%;
  color: var(--ink);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
}

.nav-btn.active {
  color: #fff;
  background: var(--accent);
}

.privacy-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #c9ddd9;
  border-radius: 8px;
  background: #eef8f6;
  color: #24524d;
  font-size: 13px;
  line-height: 1.5;
}

.sidebar > .ghost {
  margin-top: auto;
}

.workspace {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar select {
  max-width: 260px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.item h4 {
  margin: 0;
  font-size: 16px;
}

.item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.item .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.item button,
.item a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 10px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.agent-panel {
  max-width: 900px;
}

.answer {
  min-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfd;
  color: #26323f;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .split,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar select {
    max-width: none;
  }
}
