:root {
  --bg: #ffffff;
  --sidebar-bg: #f8fafc;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --card-bg: #ffffff;
}
[data-theme="dark"] {
  --bg: #020617;
  --sidebar-bg: #0f172a;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #1e293b;
  --card-bg: #020617;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  height: 100vh;
  width: 100vw;
  display: flex;
  overflow: hidden;          /* prevent body scroll, main will scroll */
}
aside {
  width: 300px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}
aside.hidden {
  transform: translateX(-100%);
  position: absolute;
}
aside h2 {
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 600;
}
aside p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 15px;
}
main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 15px;
  position: relative;
  width: 100%;
  overflow-y: auto;          /* allow scrolling inside main */
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.nav-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}
h1 { font-size: 22px; font-weight: 600; }
.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.chat-frame-container {
  position: relative;
  flex-grow: 1;              /* takes remaining space above buttons */
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 15px;
  min-height: 600px;         /* ensures iframe has some height even when empty */
}
#buffer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  z-index: 5;
}
#buffer i { font-size: 36px; color: #2563eb; margin-bottom: 10px; }
#fallback {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--card-bg);
  color: var(--text);
  text-align: center;
  padding: 2rem;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}
.btn-blue { background-color: #2563eb; }
.btn-green { background-color: #16a34a; }
.btn-orange { background-color: #b45309; } /* WCAG AA compliant */
footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
}
.info-text {
  margin: 10px 0;
  padding: 20px;
  background: var(--sidebar-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.info-text h2 {
  font-size: 20px;
  margin-bottom: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-text p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}
@media (max-width: 850px) {
  aside {
    position: absolute;
    height: 100%;
    box-shadow: 10px 0 15px rgba(0,0,0,0.1);
  }
}