/* «متعب» — the staff's ChatGPT (mutib*.js). Chat list on the start side, the conversation fills the rest. */
.mt {
  --mt-ink: var(--bo-ink, #1a1f27);
  --mt-line: var(--bo-line, #e6e9ef);
  --mt-soft: var(--bo-surface-2, #f8fafc);
  --mt-accent: var(--bo-orange, #f7931e);
  --mt-blue: var(--bo-blue-d, #1f8fbf);
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: calc(100dvh - 150px);
  min-height: 460px;
  background: var(--bo-surface, #fff);
  border: 1px solid var(--mt-line);
  border-radius: var(--bo-r-lg, 16px);
  box-shadow: var(--bo-shadow);
  overflow: hidden;
  color: var(--mt-ink);
}
.mt .ico { width: 18px; height: 18px; flex: none; }
.mt-ib {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none;
  border: 0; border-radius: var(--bo-r-sm, 8px); background: transparent; color: var(--bo-muted, #6b7484);
  cursor: pointer; transition: background .15s, color .15s;
}
.mt-ib:hover, .mt-ib:focus-visible { background: var(--bo-line-2, #f0f3f7); color: var(--mt-ink); }

/* the chat list */
.mt-side { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--mt-soft); border-inline-end: 1px solid var(--mt-line); min-height: 0; }
.mt-new {
  display: flex; align-items: center; gap: 8px; justify-content: center; height: 40px;
  border: 1px solid var(--mt-line); border-radius: var(--bo-r, 12px); background: #fff; color: var(--mt-ink);
  font: inherit; font-weight: 800; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.mt-new:hover, .mt-new:focus-visible { border-color: var(--mt-accent); box-shadow: 0 0 0 3px rgba(247, 147, 30, .15); }
.mt-q { display: flex; align-items: center; gap: 6px; padding-inline: 10px; height: 36px; border: 1px solid var(--mt-line); border-radius: var(--bo-r-sm, 8px); background: #fff; color: var(--bo-muted); }
.mt-q input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--bo-fs-sm, .82rem); color: var(--mt-ink); }
.mt-list { flex: 1; overflow-y: auto; margin-inline: -4px; padding-inline: 4px; }
.mt-list__g { margin: 12px 8px 4px; font-size: var(--bo-fs-xs, .72rem); font-weight: 800; color: var(--bo-muted-2, #8b93a1); }
.mt-list__empty { margin: 24px 8px; text-align: center; color: var(--bo-muted-2); font-size: var(--bo-fs-sm); }
.mt-item { display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 4px; padding-inline-start: 10px; border-radius: var(--bo-r-sm, 8px); cursor: pointer; transition: background .15s; }
.mt-item:hover, .mt-item:focus-visible { background: var(--bo-line-2, #f0f3f7); outline: 0; }
.mt-item.on { background: #fff3e2; }
.mt-item__t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--bo-fs-sm, .82rem); font-weight: 700; line-height: 1.9; }
.mt-item .mt-ib { width: 26px; height: 26px; opacity: 0; }
.mt-item .mt-ib .ico { width: 15px; height: 15px; }
.mt-item:hover .mt-ib, .mt-item.on .mt-ib, .mt-item .mt-ib:focus-visible { opacity: 1; }

/* the conversation */
.mt-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mt-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--mt-line); }
.mt-menu { display: none; }
.mt-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--bo-fs-md, 1.05rem); }
.mt-pick { display: flex; align-items: center; gap: 6px; padding-inline: 10px 4px; height: 36px; border: 1px solid var(--mt-line); border-radius: 999px; color: var(--mt-accent); max-width: 52%; }
.mt-model { min-width: 0; max-width: 240px; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--bo-fs-sm); font-weight: 700; color: var(--mt-ink); cursor: pointer; }
.mt-msgs { flex: 1; overflow-y: auto; padding: 20px 16px 8px; scroll-behavior: auto; }
.mt-thread { display: flex; flex-direction: column; gap: 18px; max-width: 820px; margin-inline: auto; }
.mt-msg--me { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mt-bub { max-width: min(78%, 640px); padding: 10px 14px; border-radius: 18px; border-start-start-radius: 6px; background: #eef6fb; line-height: 1.75; white-space: normal; overflow-wrap: anywhere; }
.mt-msg--ai { display: flex; gap: 12px; align-items: flex-start; }
.mt-av { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--bo-grad); color: #fff; }
.mt-av .ico { width: 16px; height: 16px; }
.mt-ans { flex: 1; min-width: 0; padding-top: 4px; }
.mt-md { line-height: 1.85; overflow-wrap: anywhere; }
.mt-md > :first-child { margin-top: 0; }
.mt-md > :last-child { margin-bottom: 0; }
.mt-md p { margin: 0 0 .75em; }
.mt-md h3, .mt-md h4, .mt-md h5, .mt-md h6 { margin: 1.1em 0 .4em; line-height: 1.5; }
.mt-md h3 { font-size: 1.2rem; } .mt-md h4 { font-size: 1.08rem; } .mt-md h5, .mt-md h6 { font-size: 1rem; }
.mt-md ul, .mt-md ol { margin: 0 0 .75em; padding-inline-start: 1.4em; }
.mt-md li { margin: .2em 0; }
.mt-md li.mt-sub { margin-inline-start: 1.2em; list-style-type: circle; }
.mt-md a { color: var(--mt-blue); text-decoration: underline; text-underline-offset: 2px; }
.mt-md code { padding: .1em .35em; border-radius: 5px; background: var(--bo-line-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; direction: ltr; unicode-bidi: isolate; }
.mt-md blockquote { margin: 0 0 .75em; padding: 2px 12px; border-inline-start: 3px solid var(--mt-accent); color: var(--bo-ink-2); background: var(--mt-soft); border-radius: 4px; }
.mt-md hr { border: 0; border-top: 1px solid var(--mt-line); margin: 1em 0; }
.mt-tbl { overflow-x: auto; margin: 0 0 .75em; border: 1px solid var(--mt-line); border-radius: var(--bo-r-sm); }
.mt-tbl table { width: 100%; border-collapse: collapse; font-size: var(--bo-fs-sm); }
.mt-tbl th, .mt-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--mt-line); text-align: start; vertical-align: top; }
.mt-tbl th { background: var(--mt-soft); font-weight: 800; }
.mt-tbl tr:last-child td { border-bottom: 0; }
.mt-code { margin: 0 0 .75em; border-radius: var(--bo-r-sm); overflow: hidden; background: #1b2027; color: #e8edf3; }
.mt-code__h { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; background: #242a33; font-size: var(--bo-fs-xs); color: #aab3c0; direction: ltr; }
.mt-code__copy { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.mt-code__copy:hover { color: #fff; }
.mt-code pre { margin: 0; padding: 12px; overflow-x: auto; font-size: .85rem; line-height: 1.6; }
.mt-code pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.mt-tools { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--bo-muted-2); font-size: var(--bo-fs-xs); }
.mt-tools .mt-ib { width: 28px; height: 28px; }
.mt-tools .ico { width: 15px; height: 15px; }
.mt-tag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: #fff3e2; color: var(--bo-orange-d); font-size: var(--bo-fs-xs); font-weight: 700; }
.mt-msg--err .mt-md { padding: 8px 12px; border-radius: var(--bo-r-sm); background: #fdecec; color: var(--bo-red, #dc2626); }
.mt-wait { display: flex; align-items: center; gap: 4px; color: var(--bo-muted); }
.mt-wait span { width: 7px; height: 7px; border-radius: 50%; background: var(--mt-accent); animation: mt-dot 1s infinite ease-in-out; }
.mt-wait span:nth-child(2) { animation-delay: .15s; } .mt-wait span:nth-child(3) { animation-delay: .3s; margin-inline-end: 6px; }
@keyframes mt-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* files in a message and waiting in the box */
.mt-files { display: flex; flex-wrap: wrap; gap: 6px; max-width: min(78%, 640px); }
.mt-thumb { display: block; width: 140px; aspect-ratio: 4 / 3; border-radius: var(--bo-r); overflow: hidden; border: 1px solid var(--mt-line); background: var(--mt-soft); }
.mt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mt-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; padding: 6px 10px; border: 1px solid var(--mt-line); border-radius: var(--bo-r-sm); background: #fff; color: var(--mt-ink); font-size: var(--bo-fs-sm); text-decoration: none; flex-wrap: wrap; }
a.mt-chip:hover { border-color: var(--mt-blue); }
.mt-chip > span { min-width: 0; max-width: 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; }
.mt-chip small { color: var(--bo-muted-2); }
.mt-chip .mt-fnote { flex-basis: 100%; color: var(--bo-amber, #d97706); }
.mt-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 5px; }
.mt-chip--p { padding-inline-end: 2px; }
.mt-chip--p .mt-ib { width: 24px; height: 24px; }

/* the box you write in */
.mt-comp { max-width: 820px; width: calc(100% - 32px); margin: 8px auto 0; padding: 8px; border: 1px solid var(--mt-line); border-radius: 22px; background: #fff; box-shadow: 0 4px 18px rgba(24, 32, 54, .07); transition: border-color .15s, box-shadow .15s; }
.mt-comp:focus-within { border-color: #f5c27a; box-shadow: 0 0 0 3px rgba(247, 147, 30, .12), 0 4px 18px rgba(24, 32, 54, .07); }
.mt-pend { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-pend:not(:empty) { padding: 2px 2px 8px; }
.mt-row { display: flex; align-items: flex-end; gap: 6px; }
.mt-input { flex: 1; min-width: 0; min-height: 36px; max-height: 220px; padding: 7px 4px; border: 0; outline: 0; resize: none; background: transparent; font: inherit; line-height: 1.6; color: var(--mt-ink); }
.mt-send { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: var(--mt-ink); color: #fff; cursor: pointer; transition: background .15s, transform .15s; }
.mt-send:hover { background: #000; }
.mt-send:active { transform: scale(.94); }
.mt-send--stop { background: var(--bo-red, #dc2626); }
.mt-send .ico { width: 18px; height: 18px; }
.mt-send--stop .ico { width: 14px; height: 14px; fill: currentColor; }
.mt-foot { margin: 6px 16px 10px; text-align: center; font-size: var(--bo-fs-xs); color: var(--bo-muted-2); }

/* first screen */
.mt-hello { max-width: 640px; margin: 6vh auto 0; text-align: center; }
.mt-hello__mark { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--bo-grad); color: #fff; box-shadow: 0 8px 22px rgba(247, 147, 30, .3); }
.mt-hello__mark .ico { width: 28px; height: 28px; }
.mt-hello h2 { margin: 14px 0 6px; font-size: var(--bo-fs-xl, 1.55rem); }
.mt-hello p { margin: 0 0 18px; color: var(--bo-muted); line-height: 1.8; }
.mt-warn { padding: 10px 14px; border-radius: var(--bo-r-sm); background: #fff6e5; color: var(--bo-amber) !important; font-weight: 700; }
.mt-sugg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mt-sugg button { padding: 12px 14px; border: 1px solid var(--mt-line); border-radius: var(--bo-r); background: #fff; font: inherit; font-size: var(--bo-fs-sm); text-align: start; line-height: 1.6; color: var(--bo-ink-2); cursor: pointer; transition: border-color .15s, background .15s; }
.mt-sugg button:hover, .mt-sugg button:focus-visible { border-color: var(--mt-accent); background: #fffaf3; }

.mt-drop { position: absolute; inset: 8px; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--mt-accent); border-radius: var(--bo-r-lg); background: rgba(255, 250, 243, .92); font-weight: 800; font-size: 1.1rem; color: var(--bo-orange-d); pointer-events: none; }
.mt-drop[hidden] { display: none; }

@media (max-width: 860px) {
  .mt { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 120px); }
  .mt-side { position: absolute; inset-block: 0; inset-inline-start: 0; z-index: 4; width: min(300px, 86%); transform: translateX(100%); transition: transform .2s; box-shadow: var(--bo-shadow-lg); visibility: hidden; }
  .mt--side .mt-side { transform: none; visibility: visible; }
  .mt-menu { display: inline-grid; }
  .mt-head { padding: 8px 10px; }
  .mt-model { max-width: 150px; }
  .mt-bub, .mt-files { max-width: 90%; }
  .mt-sugg { grid-template-columns: minmax(0, 1fr); }
  .mt-comp { width: calc(100% - 16px); }
  .mt-msgs { padding-inline: 10px; }
}
