/* Sign-in page and the frame of the app: sidebar column, main column, header. */

/* ---------- Sign in ---------- */

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: min(380px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--amber);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
}

.auth-brand {
  font-size: 22px;
}

.auth-sub {
  color: var(--text-muted);
  margin: 10px 0 24px;
  font-size: 13.5px;
}

.auth-tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.auth-tabs .tab {
  padding: 0 0 8px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13.5px;
}

.auth-tabs .tab:hover {
  color: var(--text);
}

.auth-tabs .tab.active {
  color: var(--text);
  border-bottom-color: var(--amber);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-card .btn-primary {
  width: 100%;
  height: 38px;
  margin-top: 4px;
}

.auth-note {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- App layout ---------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}


@media (min-width: 901px) {
  /* The sidebar slides shut by animating its grid column to zero width.
     Its content keeps its full width and is clipped, so nothing reflows inside it. */
  .app {
    transition: grid-template-columns var(--sidebar-duration) var(--ease-out);
  }

  .app.sidebar-collapsed {
    grid-template-columns: 0px minmax(0, 1fr);
  }

  .app .sidebar {
    min-width: 0;
    overflow: hidden;
    transition: border-color var(--sidebar-duration) var(--ease-out), visibility 0s;
  }

  .app .sidebar > * {
    min-width: var(--sidebar-width);
  }

  /* The search box has side margins, so it needs the width minus those. */
  .app .sidebar > .sidebar-search {
    min-width: calc(var(--sidebar-width) - 24px);
  }

  /* Hidden for keyboard and screen readers once it is shut, but only after the slide. */
  .app.sidebar-collapsed .sidebar {
    visibility: hidden;
    border-right-color: transparent;
    transition: border-color var(--sidebar-duration) var(--ease-out), visibility 0s linear var(--sidebar-duration);
  }
}

/* ---------- Main ---------- */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  z-index: 5;
}

.chat-heading {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.chat-title {
  flex: 0 1 auto;
  min-width: 120px;
  max-width: 420px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  outline: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 3px 6px;
  margin-left: -6px;
}

.chat-title:hover {
  border-color: var(--line);
}

.chat-title:focus {
  border-color: var(--amber);
}

.chat-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.select-compact {
  appearance: none;
  width: auto;
  max-width: 220px;
  height: 26px;
  padding: 0 24px 0 8px;
  font-size: 12px;
  background-color: transparent;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%),
    linear-gradient(135deg, var(--text-faint) 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-muted);
  outline: none;
}

.select-compact[data-change="chat-model"] {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.select-compact:hover {
  color: var(--text);
}

.select-compact:focus {
  border-color: var(--amber);
}

.select-compact option,
.select option {
  background: var(--panel);
  color: var(--text);
}

.chat-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.mcp-indicator {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  padding: 0 6px;
  white-space: nowrap;
}

/* ---------- Header extras ---------- */

.usage-indicator {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  padding: 0 4px;
  white-space: nowrap;
}

.tools-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.tools-btn svg {
  width: 13px;
  height: 13px;
}

.tools-btn:hover {
  color: var(--text);
  background: var(--hover);
}
