/* /styles/components.css */

/* Chat box */
/* Chat box — participates in equal-height layout, no inner scrollbar */
#chatBox {
  border: 1px solid var(--color-border-strong);
  padding: 1rem;
  background: var(--color-bg);
  border-radius: var(--radius-8);
  box-shadow: var(--shadow-medium);
  flex: 1 1 auto;  /* allow the parent column to control height */
  overflow-y: auto;              /* was: overflow: visible; */
  -webkit-overflow-scrolling: touch; /* optional: smooth scroll on iOS */
  min-height: 0;   /* avoid unintended overflow clipping in flex/grid */
  
}


/* Auth buttons (exact look, tokenized) */
#userAuthControls button {
  background-color: var(--color-bg);           /* was #fff */
  color: var(--color-text);                    /* was black */
  border: 1px solid var(--color-accent);
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 400;
  gap: 6px;
  border-radius: var(--radius-8);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background-color 0.3s ease;
  margin-left: 10px;
}
#userAuthControls button:hover {
  background-color: var(--color-border-subtle); /* was #e0e0e0 */
}
/* Header auth area: right-aligned row + a second row for the Docs button */
/* Header auth area: compact, right-aligned first row + a second row for the Docs button */
#userAuthControls {
  display: flex;
  flex-direction: column;     /* stack items vertically */
  align-items: flex-end;      /* keep them aligned to the right edge */
  justify-content: flex-start;/* start from the top */
  gap: 8px;
  align-self: flex-start;     /* place the stack at the top-right of the header */

  /* NEW: ensure this stack paints above the centered header brand */
  position: relative;
  z-index: var(--z-header, 10);
}

/* Top-right profile photo */
#userAuthControls img,
#userAuthControls .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--color-border-strong);
}
/* Align only the header avatar to the right edge */
#userAuthControls img,
#userAuthControls .avatar {
  align-self: flex-end;  /* put this item on the right within the stack */
  margin-left: auto;     /* if it sits on a row, this nudges it to the right */
  display: block;        /* ensures the auto margin takes effect consistently */
}


/* Theme toggle: keep the look, force it to be the final item in the Auth stack */
#userAuthControls #themeToggle {
  background-color: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-8);
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  align-self: flex-end;
  order: 100;     /* BELOW #googleDocsLoginBtn (order:99) */
  margin-top: 10px; /* small gap from the item above */
}






/* Kill any auto-margins that create a big gap between the name and buttons */
#userAuthControls > * {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* No horizontal shove when stacked */
#userAuthControls button {
  margin-left: 0;
}

/* If a link is used (e.g., Buy Credits as <a>) remove its left margin too */
#userAuthControls .credit-button {
  margin-left: 0;
}

/* Neutralize any stray margins added by other rules */
#userAuthControls > * {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Keep Connect Google Docs as the last item in the stack */
#userAuthControls #googleDocsLoginBtn,
#userAuthControls .connect-google-docs-btn {
  order: 99;
}
/* Pin the theme toggle to the very bottom of the Auth stack */
#userAuthControls #themeToggle {
  order: 100; /* lower items appear later; make this last */
}



/* Put the Docs button on its own next row, right edge — natural width */
#userAuthControls .connect-google-docs-btn,
#userAuthControls #googleDocsLoginBtn {
  grid-row: 2;          /* second row */
  justify-self: end;    /* right-aligned */
  margin-left: 0;
  margin-top: 10px;     /* breathing room under the first row */
}



/* Active tab: image keeps gold border; container does not change */
.dashboard-tab.active,
.assistant-button.active {
  background-color: transparent; /* no tile-wide box */
  color: inherit;                 /* keep label color */
  font-weight: inherit;           /* keep label weight */
  border: none;
  box-shadow: none;
}

/* Make <button class="dashboard-tab"> look identical to <a class="dashboard-tab"> */
#dashboardSidebar .dashboard-tab {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: inherit;
}
/* /styles/layout.css */
#dashboardSidebar span {
  display: block;
  text-align: center;
  font-weight: 400;
  color: var(--color-muted);
  font-size: 12px;
  

  /* NEW: wrap label to fit under the 70px tile */
  width: 90px; 
  margin-inline: auto;         /* center the label block */
  white-space: normal;         /* allow wrapping */
  overflow-wrap: anywhere;     /* break long words if needed */
  line-height: 1.5;           /* tighter, looks better on two lines */
}


/* Action row (replaces inline flex row) */
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Inputs */
.composer__input {
  width: 100%;
  border: 1px solid var(--color-border-strong);
  padding: 8px 12px;
  gap: 8px;
  border-radius: var(--radius-8);
  box-shadow: var(--shadow-medium);
}
/* Composer buttons (Send / Speak) – match brand tokens */
.action-row button,
.action-row input[type="button"],
.action-row input[type="submit"] {
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-8);
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.action-row button:hover,
.action-row input[type="button"]:hover,
.action-row input[type="submit"]:hover {
  background: var(--color-bg-subtle);
  border-color: var(--color-accent);
}

.action-row button:focus-visible,
.action-row input[type="button"]:focus-visible,
.action-row input[type="submit"]:focus-visible {
  outline: 1px solid var(--color-accent);
  outline-offset: 2px;
}

/* Modal (profile) */
.modal.modal--profile {
  display: none;                                /* default hidden */
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--color-bg);                  /* was #fff */
  border: 1px solid var(--color-border-strong);
  padding: 6px 10px;
  gap: 8px;
  border-radius: var(--radius-8);
  box-shadow: var(--shadow-medium);
  z-index: var(--z-modal, 1000);
  width: 250px;
}
/* Class-based show helper (CSP-friendly; optional to use now) */
.modal.modal--profile.modal--open {
  display: block;
}

/* Doc viewer — matches chat height, no inner scrollbar */
#docLink {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--color-border-strong);
  padding: 1rem;                /* same as #chatBox */
  gap: 8px;
  border-radius: var(--radius-8);
  box-shadow: var(--shadow-medium);
  height: 100%;
  flex: 1 1 auto;               /* stretch to match left panel height */
  overflow: hidden;             /* clip iframe to rounded corners */
}

.doc-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;                    /* remove inner border */
  border-radius: 0;             /* outer panel supplies rounding */
  box-shadow: none;             /* remove inner shadow */
  background: var(--color-bg);
}



.doc-fallback {
  padding: 1rem;
  background: var(--color-bg-subtle);
}

.doc-open-link {
  margin-top: 10px;
  display: inline-block;
  align-self: flex-start; /* same look; avoids stretching */
}

/* Generic credit-style button (same look you already use) */
.credit-button {
  background-color: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-accent);
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 400;
  border-radius: var(--radius-8);
  gap: 6px;
  margin-left: 10px; /* matches the 10px already used on the buttons */
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background-color 0.3s ease;
}
.credit-button:hover {
  background-color: var(--color-border-subtle);
}
/* ChatBot-only text buttons — NO sidebar, NO system/global buttons */
#chatbotButtons {
  --chatbot-stroke: var(--color-border-strong); /* your gold */
  --chatbot-radius: 12px;                       /* 9999px for full pill if desired */
}

/* Only style actual <button> elements inside the ChatBot bar */
#chatbotButtons button {
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-accent); 
  border-radius: var(--radius-8);
  padding: 6px 10px;
  font-size: 0.9rem;                       
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

/* ChatBot-only states */
#chatbotButtons button:hover {
  background: var(--color-bg-subtle);
  border-color: var(--color-accent);
}

#chatbotButtons button.active {
  background: var(--color-bg);
  border-color: var(--color-accent);
}

#chatbotButtons button:focus-visible {
  outline: 1px solid var(--color-accent);
  outline-offset: 2px;
  border-color: var(--color-accent);
}
/* Disabled: floating placement for theme toggle (kept for reference)
#themeToggle {
  position: fixed;
  right: 12px;
  bottom: 12px;
}
*/
/* Keep the toggle visible, inline with the header controls, and with space */
#themeToggle {
  display: inline-block;
  margin-left: 10px;   /* a little gap after the auth controls */
  vertical-align: middle;
}

/* If the centered logo ever overlaps, this guarantees controls/toggle paint above */
#userAuthControls { position: relative; z-index: 10; }

