/* ==========================================================================
   GPTchatly — index.html stylesheet (2026-09-25)
   Warm paper ground, one elevated chat sheet, teal ink accent.
   Display: Bricolage Grotesque. Text: Source Sans 3.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* ground + surfaces */
  --paper: #ebe5d9;
  --paper-deep: #e1dacb;
  --sheet: #faf8f2;
  --surface: #f3efe6;
  --surface-strong: #ffffff;

  /* ink */
  --ink: #1b2027;
  --ink-2: #4d5764;
  --ink-3: #7d8794;

  /* lines */
  --line: #ddd5c6;
  --line-strong: #c9c0af;

  /* accent (teal ink) */
  --accent: #0f7665;
  --accent-hover: #0c6152;
  --accent-ink: #ffffff;
  --accent-tint: #e2efea;
  --accent-tint-2: #cbe3da;
  --accent-ring: rgba(15, 118, 101, 0.22);

  /* semantic */
  --user-bubble: #dfeee7;
  --code-bg: #f1ece1;
  --danger: #b9432f;
  --danger-tint: #f6e3df;
  --warm-glow: rgba(214, 160, 60, 0.18);

  /* depth */
  --shadow-sheet: 0 24px 48px -28px rgba(24, 28, 32, 0.32), 0 2px 6px -2px rgba(24, 28, 32, 0.08);
  --shadow-pop: 0 18px 40px -16px rgba(24, 28, 32, 0.35), 0 2px 8px -4px rgba(24, 28, 32, 0.12);
  --shadow-lift: 0 8px 18px -12px rgba(24, 28, 32, 0.4);

  /* shape */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* type */
  --font-display: 'Bricolage Grotesque', 'Source Sans 3', system-ui, sans-serif;
  --font-text: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 160ms;
  --dur-med: 280ms;

  /* legacy aliases still referenced by shared scripts */
  --text-color: var(--ink);
  --muted-text: var(--ink-2);
  --border-color: var(--line);

  /* icon masks (stroke icons, 24 grid) */
  --i-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E");
  --i-speak: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5' fill='%23000'/%3E%3Cpath d='M15.54 8.46a5 5 0 0 1 0 7.07'/%3E%3Cpath d='M19.07 4.93a10 10 0 0 1 0 14.14'/%3E%3C/svg%3E");
  --i-stop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='5' y='5' rx='2'/%3E%3C/svg%3E");
  --i-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7'/%3E%3Cpath d='M7 7h10v10'/%3E%3C/svg%3E");
  --i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

body.night-mode {
  --paper: #0f141a;
  --paper-deep: #0a0e13;
  --sheet: #161d25;
  --surface: #1b242e;
  --surface-strong: #212c38;

  --ink: #e9eef5;
  --ink-2: #aab5c2;
  --ink-3: #7f8b99;

  --line: #2a3644;
  --line-strong: #394859;

  --accent: #3cb7a2;
  --accent-hover: #52c7b3;
  --accent-ink: #08201b;
  --accent-tint: #183a35;
  --accent-tint-2: #1f4d45;
  --accent-ring: rgba(60, 183, 162, 0.28);

  --user-bubble: #1d3f3a;
  --code-bg: #111820;
  --danger: #e0705e;
  --danger-tint: #3a2320;
  --warm-glow: rgba(120, 96, 200, 0.16);

  --shadow-sheet: 0 28px 56px -30px rgba(0, 0, 0, 0.7), 0 2px 6px -2px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 22px 48px -18px rgba(0, 0, 0, 0.75), 0 2px 10px -4px rgba(0, 0, 0, 0.5);
  --shadow-lift: 0 10px 22px -12px rgba(0, 0, 0, 0.7);
}

/* --------------------------------------------------------------------------
   2. Base + browser surfaces
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body.night-mode {
  color-scheme: dark;
}

body {
  min-height: 100%;
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-med) ease, color var(--dur-med) ease;
}

/* the ground is lit, not flat */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 55% at 6% 0%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(55% 50% at 100% 100%, var(--warm-glow), transparent 70%);
}

::selection {
  background: var(--accent-tint-2);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.messages,
.sidebar-scroll,
.dropdown-content,
.apps-panel,
.apps-sheet-content,
#user-input {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.messages::-webkit-scrollbar,
.sidebar-scroll::-webkit-scrollbar,
.dropdown-content::-webkit-scrollbar,
.apps-panel::-webkit-scrollbar,
.apps-sheet-content::-webkit-scrollbar,
#user-input::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.messages::-webkit-scrollbar-thumb,
.sidebar-scroll::-webkit-scrollbar-thumb,
.dropdown-content::-webkit-scrollbar-thumb,
.apps-panel::-webkit-scrollbar-thumb,
.apps-sheet-content::-webkit-scrollbar-thumb,
#user-input::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.messages::-webkit-scrollbar-track,
.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes wave {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   3. Shell layout
   -------------------------------------------------------------------------- */
.container {
  display: flex;
  height: 100%;
  height: 100dvh;
  width: 100%;
  gap: 12px;
  padding: 14px 14px 14px 10px;
  overflow: hidden;
}

.menu-icon {
  display: none;
  position: fixed;
  top: 9px;
  left: 9px;
  z-index: 1100;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  box-shadow: var(--shadow-lift);
  align-items: center;
  justify-content: center;
}

/* ---- sidebar --------------------------------------------------------- */
.sidebar {
  flex: 0 0 288px;
  width: 288px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 4px 2px 2px 6px;
}

.sidebar-top {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 6px 12px 4px;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 6px 16px 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 10px;
  color: var(--ink);
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.brand-subtitle {
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.model-picker {
  display: block;
}

.dropdown {
  position: relative;
  width: 100%;
}

.model-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-strong);
  color: var(--ink);
  text-align: left;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.model-button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.model-button .model-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.model-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.model-value {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.model-button .icon {
  color: var(--ink-3);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: min(58vh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-pop);
  animation: pop var(--dur-fast) var(--ease-out);
}

.dropdown-content > div {
  padding: 0;
}

.dropdown-content > div > a {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: background-color var(--dur-fast) ease;
}

.dropdown-content > div > a:hover {
  background: var(--accent-tint);
  color: var(--accent-hover);
}

#other-models-menu .apps-sidebar-heading {
  padding: 12px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

#other-models-menu .apps-sidebar-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

#new-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.005em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 14px -8px rgba(15, 118, 101, 0.7);
  transition: background-color var(--dur-fast) ease, transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

#new-chat:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 20px -10px rgba(15, 118, 101, 0.8);
}

#new-chat:active {
  transform: translateY(0);
}

.sessions-head,
.studio-head {
  padding: 10px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.sessions:has(#session-list:empty) {
  display: none;
}

#session-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#session-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 6px 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

#session-list li:hover,
#session-list li:focus-within {
  background: var(--surface-strong);
  color: var(--ink);
}

.session-title {
  flex: 1;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#session-list li button {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: 4px !important;
  border-radius: 6px;
  color: var(--ink-3) !important;
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transition: opacity var(--dur-fast) ease, background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

#session-list li:hover button,
#session-list li:focus-within button {
  opacity: 1;
}

#session-list li button:hover {
  color: var(--danger) !important;
  background: var(--danger-tint) !important;
}

.tokens {
  margin: 14px 10px 6px;
}

#remaining-tokens {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.token-meter {
  --fill: 1;
  margin-top: 6px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.token-meter span {
  display: block;
  height: 100%;
  width: calc(var(--fill) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in oklab, var(--accent) 65%, #d6a03c));
  transition: width 600ms var(--ease-out);
}

.studio {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.studio-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.studio-link::after {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--i-arrow) center / contain no-repeat;
  mask: var(--i-arrow) center / contain no-repeat;
  opacity: 0.45;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) ease;
}

.studio-link:hover {
  background: var(--surface-strong);
  color: var(--ink);
}

.studio-link:hover::after {
  opacity: 1;
  transform: translate(1px, -1px);
}

.faq-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.faq-button .icon {
  width: 16px;
  height: 16px;
}

.faq-button .faq-chevron {
  margin-left: auto;
  color: var(--ink-3);
}

.faq-button:hover {
  background: var(--surface-strong);
  border-color: var(--line-strong);
  color: var(--ink);
}

#faq {
  display: none;
}

.chat-gpt-faq {
  margin-top: 8px;
  padding: 6px 2px 8px;
}

.chat-gpt-faq h3 {
  padding: 14px 8px 6px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.faq-item + .faq-item {
  border-top: 1px solid var(--line);
}

.faq-question {
  position: relative;
  padding: 9px 26px 9px 8px;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
}

.faq-question::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 12px;
  width: 14px;
  height: 14px;
  background: var(--ink-3);
  -webkit-mask: var(--i-chevron) center / contain no-repeat;
  mask: var(--i-chevron) center / contain no-repeat;
  transition: transform var(--dur-fast) ease;
}

.faq-question:hover {
  background: var(--surface-strong);
}

.faq-question:has(+ .faq-answer[style*='block'])::after {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 2px 8px 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.faq-answer a,
.consent-bar a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent);
}

.faq-answer a:hover,
.consent-bar a:hover {
  text-decoration-color: currentColor;
}

.contact-row {
  display: flex;
  gap: 6px;
  padding: 2px 6px 4px;
}

.contact-link {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
}

.contact-link .icon {
  width: 17px;
  height: 17px;
}

.copyright {
  padding: 10px 8px 0;
  font-size: 12px;
  color: var(--ink-3);
}

.consent-bar {
  padding: 4px 8px 0;
}

.consent-bar h5 {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-2);
}

.consent-bar i {
  font-style: normal;
}

/* ---- chat sheet ------------------------------------------------------ */
.chatGPT-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--sheet);
  box-shadow: var(--shadow-sheet), 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  overflow: hidden;
}

body.night-mode .chatGPT-area {
  box-shadow: var(--shadow-sheet), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

/* --------------------------------------------------------------------------
   4. Top bar: apps dock, language, theme
   -------------------------------------------------------------------------- */
.header-controls {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 9px 12px 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.apps-dock-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.apps-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  padding: 3px;
  width: max-content;
  max-width: none;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  overflow: hidden;
}

.apps-tab {
  appearance: none;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-2);
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.apps-tab:hover {
  color: var(--ink);
  background: color-mix(in oklab, var(--surface-strong) 60%, transparent);
}

.apps-tab[aria-selected='true'] {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(24, 28, 32, 0.12), 0 0 0 1px var(--line);
}

.apps-tab:focus-visible {
  outline-offset: -2px;
}

.apps-launcher {
  display: none;
  appearance: none;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-strong);
  color: var(--ink);
  padding: 7px 12px 7px 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}

.apps-launcher .icon {
  width: 16px;
  height: 16px;
}

.apps-launcher:hover {
  border-color: var(--accent);
}

.apps-launcher[aria-expanded='true'] {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.apps-shell-collapsed .apps-launcher {
  display: inline-flex;
}

.apps-shell-collapsed:not(.apps-shell-temp-expanded) .apps-tabs {
  display: none;
}

.apps-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(920px, calc(100vw - 40px));
  max-height: min(64vh, 560px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--sheet);
  box-shadow: var(--shadow-pop);
  animation: pop 200ms var(--ease-out);
}

.apps-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.apps-panel-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.apps-panel-subtitle {
  font-size: 12.5px;
  color: var(--ink-3);
}

.apps-panel-subtitle:empty {
  display: none;
}

.apps-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.apps-standalone-row {
  margin-top: 12px;
}

.apps-standalone-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.apps-standalone-row .apps-card {
  width: 100%;
}

.apps-group-block {
  margin-top: 6px;
}

.apps-group-label {
  margin: 12px 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.apps-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--ink);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.apps-card.featured {
  background: linear-gradient(140deg, var(--accent-tint), var(--surface-strong) 72%);
}

.apps-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}

.apps-card-main-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: inherit;
}

.apps-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.apps-card-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.apps-card-flag {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.apps-card-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.apps-card-open {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  font-size: 0;
  background: var(--ink-3);
  -webkit-mask: var(--i-arrow) center / contain no-repeat;
  mask: var(--i-arrow) center / contain no-repeat;
  transition: background-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}

.apps-card:hover .apps-card-open {
  background: var(--accent);
  transform: translate(1px, -1px);
}

.apps-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-2);
}

.apps-badge,
.apps-chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.apps-badge {
  text-transform: capitalize;
}

.apps-chip::before {
  content: '·';
  margin-right: 6px;
  color: var(--ink-3);
}

.apps-submenu-toggle {
  appearance: none;
  align-self: flex-start;
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.apps-submenu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.apps-card-submenu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}

.apps-card-submenu[hidden] {
  display: none !important;
}

.apps-card-submenu-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}

.apps-card-submenu-link:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}

/* ---- language menu --------------------------------------------------- */
.language-dropdown {
  position: relative;
}

.language-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-strong);
  color: var(--ink-2);
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.language-button:hover,
.language-dropdown.active .language-button {
  border-color: var(--accent);
  color: var(--accent);
}

.language-dropdown .dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  min-width: 196px;
  padding: 6px;
}

.language-dropdown.active .dropdown-content {
  display: block;
}

.language-dropdown .dropdown-content a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 8px;
  border-radius: var(--r-xs);
  color: var(--ink);
  font-size: 13.5px;
  transition: background-color var(--dur-fast) ease;
}

.language-dropdown .dropdown-content a:hover {
  background: var(--accent-tint);
}

.lang-flag {
  flex: none;
  width: 22px;
  height: 15px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12) inset;
}

.lang-code {
  min-width: 34px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.lang-name {
  font-weight: 600;
}

/* ---- theme switch ---------------------------------------------------- */
.theme-switcher {
  position: relative;
  display: flex;
  align-items: center;
}

.theme-switcher input[type='checkbox'] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.slider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 58px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  transition: background-color var(--dur-med) ease, border-color var(--dur-med) ease;
}

.slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: transform var(--dur-med) var(--ease-out);
}

.theme-icon {
  position: relative;
  z-index: 2;
  display: inline-flex;
  width: 14px;
  height: 14px;
  pointer-events: none;
  transition: color var(--dur-med) ease, opacity var(--dur-med) ease;
}

.theme-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-moon svg {
  fill: currentColor;
  stroke: none;
}

.theme-icon-sun {
  color: #b8860b;
  opacity: 1;
}

.theme-icon-moon {
  color: var(--ink-3);
  opacity: 0.6;
}

input[type='checkbox']:checked + .slider {
  background: #2b3b4c;
  border-color: #3c5068;
}

input[type='checkbox']:checked + .slider::before {
  transform: translateX(28px);
  background: #e9eef5;
}

input[type='checkbox']:checked + .slider .theme-icon-sun {
  opacity: 0.5;
}

input[type='checkbox']:checked + .slider .theme-icon-moon {
  opacity: 1;
  color: #101720;
}

input[type='checkbox']:focus-visible + .slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- mobile apps sheet ---------------------------------------------- */
.apps-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.apps-sheet[hidden] {
  display: none !important;
}

.apps-sheet-backdrop {
  appearance: none;
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(10, 14, 19, 0.5);
  cursor: pointer;
}

.apps-sheet-body {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: 78vh;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: var(--sheet);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: sheet-up var(--dur-med) var(--ease-out);
}

.apps-sheet-body::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: var(--line-strong);
}

.apps-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.apps-sheet-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.apps-sheet-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-strong);
  color: var(--ink-2);
}

.apps-sheet-close .icon {
  width: 16px;
  height: 16px;
}

.apps-sheet-content {
  max-height: calc(78vh - 72px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

body.apps-sheet-open {
  overflow: hidden;
}

/* the sheet header already names the category */
.apps-sheet-content .apps-panel-header {
  display: none;
}

.apps-sheet-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 1px 10px;
  margin-bottom: 4px;
  scrollbar-width: none;
}

.apps-sheet-tabs::-webkit-scrollbar {
  display: none;
}

.apps-sheet-tab {
  appearance: none;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.apps-sheet-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   5. Chat stage: messages, welcome, media
   -------------------------------------------------------------------------- */
.chat-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px clamp(16px, 4vw, 44px) 18px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  scroll-behavior: smooth;
}

.messages > * {
  width: min(100%, 860px);
  margin-inline: auto;
}

.message-container {
  position: relative;
  animation: rise 360ms var(--ease-out) both;
}

.message-content {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

/* user: a quiet tinted bubble on the right */
.user .message-content {
  margin-left: auto;
  width: fit-content;
  max-width: min(78%, 640px);
  padding: 11px 16px;
  border-radius: 18px 18px 6px 18px;
  background: var(--user-bubble);
  color: var(--ink);
  white-space: pre-wrap;
}

/* assistant: ink on paper, with the mark in the margin */
.assistant {
  padding-left: 38px;
}

.assistant .message-content {
  max-width: 74ch;
}

.assistant .message-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  background: url('../images/GPTchatly_logo_vector_300px.webp') center / contain no-repeat;
}

.assistant .message-content ul,
.assistant .message-content ol {
  margin: 0.45em 0 0.6em;
  padding-left: 1.35em;
}

.assistant .message-content li {
  margin: 0.2em 0;
}

.assistant .message-content li::marker {
  color: var(--accent);
}

.assistant .message-content p + p {
  margin-top: 0.7em;
}

.assistant .message-content strong {
  font-weight: 700;
}

.assistant .message-content a,
.search-response a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent);
  transition: text-decoration-color var(--dur-fast) ease;
}

.assistant .message-content a:hover,
.search-response a:hover {
  text-decoration-color: currentColor;
}

.assistant .message-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.12em 0.4em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--code-bg);
}

.highlighted-code-container {
  position: relative;
  display: block;
  margin: 12px 0;
  padding: 14px 84px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--code-bg);
}

.highlighted-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.copy-button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.search-response p {
  margin-bottom: 0.5em;
}

.search-sources {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 1px solid var(--line-strong);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.search-sources a {
  display: block;
  padding: 2px 0;
}

/* message actions: appear on hover, always on touch */
.message-actions {
  position: static;
  display: flex;
  gap: 2px;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.user .message-actions {
  justify-content: flex-end;
}

.message-container:hover .message-actions,
.message-container:focus-within .message-actions {
  opacity: 1;
  transform: translateY(0);
}

.play-btn,
.stop-btn,
.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-size: 0;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.play-btn::before,
.stop-btn::before,
.copy-btn::before {
  content: '';
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--i-copy) center / contain no-repeat;
  mask: var(--i-copy) center / contain no-repeat;
}

.play-btn::before {
  -webkit-mask-image: var(--i-speak);
  mask-image: var(--i-speak);
}

.stop-btn::before {
  -webkit-mask-image: var(--i-stop);
  mask-image: var(--i-stop);
}

.play-btn:hover,
.stop-btn:hover,
.copy-btn:hover {
  color: var(--accent);
  background: var(--accent-tint);
}

/* thinking */
.assistant.loading {
  min-height: 28px;
}

.assistant.loading .message-content {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
}

.typing-indicator .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: wave 1.3s ease-in-out infinite both;
}

.typing-indicator .dot:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-indicator .dot:nth-child(3) {
  animation-delay: 0.32s;
}

.web-search-wait {
  color: var(--ink-2);
  font-size: 15px;
}

/* welcome: the empty state carries the page's voice */
.GPT-chatly-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px clamp(16px, 5vw, 56px);
  pointer-events: none;
  overflow: auto;
}

/* > *, not :not(:empty): the markup leaves whitespace and a comment in the history */
.chat-stage:has(#conversation-history > *) .GPT-chatly-message {
  display: none !important;
}

.welcome {
  pointer-events: auto;
  width: min(100%, 680px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.welcome > * {
  animation: rise 720ms var(--ease-out) both;
}

.welcome > :nth-child(1) {
  animation-delay: 40ms;
}
.welcome > :nth-child(2) {
  animation-delay: 110ms;
}
.welcome > :nth-child(3) {
  animation-delay: 170ms;
}
.welcome > :nth-child(4) {
  animation-delay: 230ms;
}
.welcome > :nth-child(5) {
  animation-delay: 300ms;
}
.welcome > :nth-child(6) {
  animation-delay: 360ms;
}

.welcome-mark {
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  filter: drop-shadow(0 8px 16px rgba(24, 28, 32, 0.18));
}

.welcome h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.028em;
  text-wrap: balance;
  color: var(--ink);
}

.welcome h2 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-2);
}

.welcome-copy {
  margin-top: 16px;
  max-width: 60ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.welcome-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.starter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease, background-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}

.starter .icon {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
  transition: color var(--dur-fast) ease;
}

.starter:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-tint);
  transform: translateY(-1px);
}

.starter:hover .icon {
  color: var(--accent);
}

.welcome-old {
  margin-top: 22px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: transparent;
  transition: color var(--dur-fast) ease, text-decoration-color var(--dur-fast) ease;
}

.welcome-old:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* loaders + generated image */
.loading-indicator {
  padding: 6px 0 10px;
  text-align: center;
}

.loading-indicator img {
  display: inline-block;
  width: 56px;
  height: 56px;
  border-radius: 12px;
}

#image-display-container {
  position: relative;
  display: none;
  justify-content: center;
  align-items: center;
  width: min(92%, 560px);
  max-height: 40vh;
  margin: 6px auto 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}

#imgElement {
  max-width: 100%;
  max-height: calc(40vh - 20px);
  object-fit: contain;
  border-radius: 8px;
}

#wait-message {
  padding: 16px 8px;
  font-size: 14px;
  color: var(--ink-2);
}

#close-image-display {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

#download-image-button {
  position: absolute;
  top: 8px !important;
  left: 8px !important;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--r-xs);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   6. Composer
   -------------------------------------------------------------------------- */
.input-area {
  flex: none;
  padding: 10px clamp(16px, 4vw, 44px) 12px;
  border-top: 1px solid var(--line);
  background: var(--sheet);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 6px 6px 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: 0 1px 2px rgba(24, 28, 32, 0.05), 0 10px 26px -18px rgba(24, 28, 32, 0.35);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring), 0 10px 26px -18px rgba(24, 28, 32, 0.35);
}

.input-group {
  display: flex;
  flex: none;
}

#user-input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  caret-color: var(--accent);
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#user-input[contenteditable='true']:empty::before {
  content: attr(data-placeholder);
  pointer-events: none;
  display: block;
  color: var(--ink-3);
  font-weight: 500;
}

.attach-btn,
.send-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}

.attach-btn {
  background: transparent;
  color: var(--ink-3);
}

.attach-btn:hover {
  background: var(--surface);
  color: var(--accent);
}

.send-btn {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 14px -8px rgba(15, 118, 101, 0.8);
}

.send-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.send-btn:active {
  transform: translateY(0);
}

.send-btn .icon {
  stroke-width: 2.2;
}

.composer-hint {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}

.composer-hint kbd {
  font-family: inherit;
  font-weight: 600;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   7. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .sidebar {
    flex-basis: 256px;
    width: 256px;
  }
}

@media (max-width: 768px) {
  .container {
    gap: 0;
    padding: 0;
  }

  .chatGPT-area {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .menu-icon {
    display: flex;
  }

  body:has(.sidebar[style*='left: 0px'])::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1098;
    background: rgba(10, 14, 19, 0.45);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    z-index: 1099;
    width: min(86%, 340px);
    height: 100%;
    height: 100dvh;
    padding: 60px 8px 0 8px;
    background: var(--sheet);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-pop);
    transition: left var(--dur-med) var(--ease-out);
  }

  .brand {
    padding-top: 0;
  }

  .header-controls {
    min-height: 56px;
    gap: 8px;
    padding: 8px 10px 8px 58px;
  }

  .apps-dock-shell {
    width: auto;
  }

  .apps-tabs {
    display: none !important;
  }

  .apps-launcher {
    display: inline-flex !important;
    font-size: 12.5px;
    padding: 7px 11px 7px 9px;
  }

  .apps-panel {
    display: none !important;
  }

  .language-button {
    width: 34px;
    height: 34px;
  }

  .slider {
    width: 50px;
    height: 26px;
    padding: 0 6px;
  }

  .slider::before {
    width: 20px;
    height: 20px;
  }

  input[type='checkbox']:checked + .slider::before {
    transform: translateX(24px);
  }

  .theme-icon,
  .theme-icon svg {
    width: 12px;
    height: 12px;
  }

  .messages {
    gap: 18px;
    padding: 16px 14px 12px;
  }

  .assistant {
    padding-left: 0;
  }

  .assistant .message-content::before {
    display: none;
  }

  .user .message-content {
    max-width: 88%;
  }

  .message-actions {
    opacity: 1;
    transform: none;
  }

  .GPT-chatly-message {
    padding: 16px;
  }

  .welcome-mark {
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
  }

  .welcome h1 {
    font-size: 1.55rem;
  }

  .welcome h2 {
    font-size: 0.95rem;
  }

  .welcome-copy {
    display: none;
  }

  .welcome-starters {
    margin-top: 16px;
  }

  .welcome-old {
    margin-top: 16px;
  }

  .input-area {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .composer {
    border-radius: 22px;
  }

  .composer-hint {
    display: none;
  }
}

@media (hover: none) {
  #session-list li button,
  .message-actions {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .typing-indicator .dot {
    animation: none;
    opacity: 0.7;
  }
}
