/* /talk/ — զրույցի լիարժեք էջ (Վահան 09-18. popup-ի փոխարեն, Codex/Cowork-ի app-shell-ի պես)։
 * Բեռնվում է chat.css-ից ՀԵՏՈ և միայն այս էջում. #chat-dialog.chat-page[open]-ը modal չէ՝
 * ստատիկ երկսյուն շրջանակ է. .chat-sidebar = ձախ սյուն (280px, ամբողջ բարձրությամբ),
 * .chat-top = վերնագիր (աջ սյան վերևում), .chat-workspace = կենտրոն + composer։
 * Տոկենները՝ weave.css-ից (--bg, --card, --line, --gold…)։
 *
 * ՄԵԿ grid (designer 09-18). .chat-shell-ն է ցանցը՝ "side top" / "side main"; .chat-layout-ը
 * display: contents է, որ sidebar-ն ու workspace-ը ուղիղ ցանցի բջիջներ դառնան։ Նախկին
 * երկշերտ լուծումը (shell-grid + layout-grid նույն areas-ով) notice-ը chat-top-ի տակ էր թաքցնում։ */

html, body.ethi-body { height: 100%; }
body.ethi-body { margin: 0; background: var(--bg); color: var(--text); overflow: hidden; }
/* K15 (09-19). Սյունը ԲԱՑԱՀԱՅՏ minmax(0, 1fr) է. տողերը արդեն այդպես էին, սյունը՝ ոչ,
 * ուստի grid-item-ի ավտոմատ նվազագույն չափը (min-width:auto) թույլ էր տալիս վերևի
 * տողին ուռչել բովանդակությամբ — չափված. 37-նիշանոց անունով 390px-ում track-ը
 * դառնում էր 546px։ */
.ethi-app { --ethi-bar: 56px; --ethi-foot: 34px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--ethi-bar) minmax(0, 1fr) var(--ethi-foot); height: 100dvh; }
/* minmax(0,1fr). առանց դրա main-ի min-content-ը (sidebar-ի գումարը) 1fr-ի հատակն էր դառնում,
 * և մնացած տարածքը auto-շարքին էր բաժին ընկնում — bar-ը 73px էր 33px բովանդակությամբ */

/* --- ստորին շերտ. mailto (G7, Georgi 09-19) -------------------------------- */
.ethi-foot {
  display: flex; align-items: center; justify-content: center; height: var(--ethi-foot);
  border-top: 1px solid var(--line); background: var(--card); font-size: 11px;
}
.ethi-foot a { color: var(--muted); text-decoration: none; }
.ethi-foot a:hover { color: var(--text); text-decoration: underline; }

/* --- JS-անջատ ծանուցում (G6, Georgi 09-19) --------------------------------- */
.ethi-noscript { margin: 12px clamp(20px, 6vw, 96px) 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); font-size: 13px; line-height: 1.6; }
.ethi-noscript a { color: var(--gold); }

/* --- վերին շերտ. երեք տարր (K11, 09-19) — նշան · «Զրուցել Էթիի հետ» · մենյու --- */
/* Լեզուն, թեման ու «Գլխավոր»-ը տեղափոխվել են drawer (ձախ սյան ներքև, .ethi-nav) —
 * ներքին քարտեզով։ Կմախքը .site-header-ինն է (weave.css), .ethi-bar-ը միայն
 * app-shell-ի չափերն է տալիս՝ sticky չէ, 56px, կպած grid-ի առաջին շարքին։ */
.ethi-bar {
  position: static; display: flex; align-items: center; gap: 14px; padding: 0 18px; height: var(--ethi-bar);
  border-bottom: 1px solid var(--line); background: var(--card); font-size: 15px;
}
.ethi-lockup { flex: none; }
.ethi-lockup img { width: 22px; height: 22px; }
.ethi-lockup span { font-size: 15px; }
/* K14 (09-19). Դատարկ HTML-ից (build.py), JS-ը լցնում է զրույցի անունով — min-width:0-ն
 * անհրաժեշտ է flex-item-ում, որ text-overflow:ellipsis-ը գործի (առանց դրա item-ը
 * ուռչում է իր բովանդակության չափով և ոչինչ չի կրճատում)։ */
/* K15 (09-19). `flex: 0 1 auto`-ը ՊԱՐՏԱԴԻՐ է, ոչ ճաշակ. weave.css:70-ի .nav-now-ը
 * `flex: none` է, ուստի min-width:0-ն ու ellipsis-ը մեռած էին — չափված 390px-ում
 * 37-նիշանոց անունով՝ scrollWidth 551 vs clientWidth 390 (հորիզոնական արտահոսք
 * ամբողջ էջի վրա)։ «Զրույց N · ԺԺ:ՐՐ»-ի ժամանակ պիտակը երբեք այդքան երկար չէր,
 * ուստի թերությունը թաքնված էր անվանման փոփոխության տակ։ */
.ethi-bar .nav-now { flex: 0 1 auto; margin-right: auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; color: var(--muted); }
.ethi-bar .nav-toggle { width: 44px; height: 44px; border-radius: 12px; border-color: var(--line); background: var(--bg2); }
.ethi-bar .nav-toggle:hover { background: var(--card2); border-color: var(--line-strong); }

/* --- ձախ սյան նավիգացիա — drawer-ի «ներքևը» (K12). talk-ը footer չունի ------- */
.ethi-nav { order: 20; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ethi-nav a { display: flex; align-items: center; min-height: 44px; width: 100%; font-size: 13px; color: var(--muted); }
.ethi-nav a:hover { color: var(--text); }
.ethi-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.ethi-nav .nav-lang { padding: 8px 0 2px; font-size: 12px; letter-spacing: 0.04em; color: var(--faint); }
.ethi-nav .nav-lang a { display: inline-block; width: auto; min-height: 0; padding: 11px 3px; font-size: 12px; } /* 44px tap target */
.ethi-nav .nav-lang a[aria-current="true"] { color: var(--text); font-weight: 600; }
.ethi-nav .theme-toggle { margin: 8px 0 0; align-self: flex-start; font-size: 12px; min-height: 44px; padding: 10px 16px; }

/* --- dialog-ը որպես էջ ----------------------------------------------------- */
.ethi-main { min-height: 0; }
#chat-dialog.chat-page[open] {
  position: static; display: block; width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--bg); color: inherit; overflow: hidden;
}
#chat-dialog.chat-page::backdrop { display: none; }

.chat-page .chat-shell {
  height: 100%; display: grid; min-height: 0;
  grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "side top" "side main";
}
.chat-page .chat-shell > .chat-layout { display: contents; }
.chat-page .chat-shell > .chat-top { grid-area: top; }
.chat-page .chat-layout > .chat-sidebar { grid-area: side; }
.chat-page .chat-layout > .chat-workspace { grid-area: main; min-height: 0; min-width: 0; }

.chat-page .chat-top { border-bottom: 1px solid var(--line); background: var(--bg); padding: 14px 28px; min-height: 72px; }
.chat-page .chat-top #chat-close { display: none; } /* էջում փակել չկա — «Վերադառնալ կայք»-ը վերևում է */

/* ձախ սյուն. Codex-ի պես՝ նոր զրույց վերևում, ցանկը, ներքևում՝ note → թիմին ուղարկելը → հաշիվ
 * ԴԻՏԱՎՈՐՅԱԼ min-width: 1101px (09-19). ≤1100-ում այս նույն տարրը drawer-ի պանելն է,
 * և դիրքը/լայնությունը weave.css-ի .drawer[data-drawer]-ից է գալիս։ Առանց այս
 * պատուհանի ethi.css-ի 280px-ը (0,2,0, բեռնվում է ՀԵՏՈ) լուռ հաղթում էր drawer-ին։ */
@media (min-width: 1101px) {
  .chat-page .chat-sidebar {
    width: 280px; padding: 14px 16px 16px; gap: 10px; border-right: 1px solid var(--line); background: var(--card);
    display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
  }
}
.chat-page .chat-sidebar > label[for="chat-history"], .chat-page .chat-sidebar > select#chat-history {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; /* chat.js-ի համար է, աչքի համար՝ .ethi-list */
}
.chat-page .chat-new { order: -1; font-size: 13px; }
.chat-page .chat-new:hover { border-color: var(--line-strong); background: var(--bg2); }
.chat-page .chat-account-link { order: 10; font-size: 12px; line-height: 1.6; margin-top: 4px; }
.ethi-list h2 { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin: 14px 0 6px; font-weight: 600; }
.ethi-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
/* P3 (Վահան 09-19). ցանկը ամսաթվով խմբավորված է -- Այսօր/Երեկ/Վերջին 7 օր/Ավելի
 * հին -- .ethi-list-root-ի ամեն <li class="ethi-list-group"> մեկ խումբ է, ներսում
 * h3.ethi-list-heading (aria-labelledby-ով կապված .ethi-list-items-ին)։ */
.ethi-list-root { gap: 0; }
.ethi-list-group + .ethi-list-group { margin-top: 4px; }
.ethi-list-heading {
  font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint);
  margin: 10px 4px 4px; font-weight: 600;
}
.ethi-list-group:first-child .ethi-list-heading { margin-top: 2px; }
.ethi-list button {
  width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text); font-size: 13px; line-height: 1.5; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ethi-list button:hover { background: var(--bg2); }
.ethi-list button[aria-current="true"] { background: var(--bg2); font-weight: 600; }
.ethi-list button:disabled { opacity: 0.5; cursor: default; }
.chat-page .chat-sidebar-note { margin-block: auto 0; padding-block: 18px 12px; }
.chat-page .chat-sidebar-note h3 { font-size: 17px; margin-top: 8px; }
.chat-page .chat-sidebar-note p { margin-top: 8px; }
.chat-page .chat-team-button { min-height: 46px; padding: 10px 12px; border-radius: 12px; font-size: 12px; }
.chat-page .chat-sidebar-fine { line-height: 1.6; }

/* կենտրոն. Cowork-ի պես՝ welcome-ը ուղղահայաց կենտրոնում, composer-ը ներքևում լայն ու կլոր */
.chat-page .chat-notice { width: 100%; max-width: 860px; margin: 0 auto; padding: 12px 20px 0; background: transparent; border-bottom: 0; } /* կոմպակտ. նույն 820 սյունը, ինչ composer-ը — ոչ երկրորդ վերնագիր-գոտի */
.chat-page .chat-notice p { font-size: 11px; line-height: 1.7; }
.chat-page .chat-notice .icon-slot { margin-top: 1px; width: 16px; height: 16px; }
.chat-page .chat-scroll { display: flex; flex-direction: column; padding: 24px clamp(20px, 6vw, 96px); max-height: none; }
.chat-page .chat-welcome { width: 100%; max-width: 720px; margin: auto; padding: 16px 0; text-align: center; }
.chat-page .chat-welcome h3, .chat-page .chat-welcome > p { margin-left: auto; margin-right: auto; }
.chat-page .chat-welcome h3 { font-size: clamp(24px, 3vw, 32px); }
.chat-page .chat-prompts { justify-content: center; }
.chat-page #chat-messages { width: 100%; max-width: 820px; margin: 0 auto; }
.chat-page .chat-message[data-role="user"] { max-width: 72%; } /* 90%-ը 820 սյունում ամբողջ լայնությամբ քարտ էր դառնում — «ով է խոսում»-ը դիրքով չէր կարդացվում */
.chat-page .chat-bottom { padding: 8px clamp(20px, 6vw, 96px) 16px; background: var(--bg); border-top: 0; }
/* T2 (09-18). --kb-inset-ը ethi.js-ն է գրում visualViewport-ից (on-screen keyboard) */
.chat-page .chat-bottom { padding-bottom: max(16px, var(--kb-inset, 0px)); }
.chat-page .chat-status { max-width: 820px; margin: 0 auto 8px; }
.chat-page .chat-status:empty { display: none; }
.chat-page .chat-composer { max-width: 820px; margin: 0 auto; border-radius: 20px; padding: 12px 14px; background: var(--card); }
.chat-page .chat-provider { max-width: 820px; margin: 8px auto 0; text-align: center; }
.chat-page .chat-team { max-width: 820px; margin: 0 auto; padding: 24px clamp(20px, 6vw, 96px); width: 100%; }

/* --- ≤1100px. ձախ սյունը drawer է — ՆՈՒՅՆ շեմը, ինչ կայքում (K12, 09-19) ------
 * Դիրքավորումը/անիմացիան/overlay-ը ՉԵՆ կրկնվում այստեղ — դրանք weave.css-ի
 * .drawer[data-drawer] բլոկն է, և site.js-ի կառավարիչը։ Այստեղ միայն այն, ինչ
 * talk-ին հատուկ է. grid-ը մեկ սյուն է դառնում, և chat.css-ի ≤700 «երկսյուն
 * grid»-ը հետ է շրջվում (drawer-ում սյուն չկա, ցանկ է)։ */
@media (max-width: 1100px) {
  .chat-page .chat-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .chat-page .chat-sidebar-note, .chat-page .chat-sidebar-fine { display: block; }
  .chat-page .chat-team-button { justify-content: flex-start; }
  /* …բայց composer-ի վերևի կոճակը composer-ի սյունն է կրում՝ նույն 820px-ը,
   * կենտրոնով։ Կարգը կարևոր է. նույն կշիռն է (0,2,0), ուստի վերջինը հաղթում է։ */
  .chat-page .chat-handoff-inline { justify-content: center; max-width: 820px; margin-inline: auto; }
}
@media (max-width: 860px) {
  .chat-page .chat-top { padding: 10px 16px; min-height: 0; }
  .chat-page .chat-notice { padding: 8px 16px; }
  .chat-page .chat-scroll { padding: 16px; }
  .chat-page .chat-top p { display: none; } /* 390-ում երկու bar + notice + composer-ը էկրանի կեսն էին. subtitle-ի իմաստը notice-ն արդեն կրում է */
  .chat-page .chat-welcome { padding: 8px 0; }
  .chat-page .chat-welcome-mark, .chat-page .chat-welcome-mark .chat-eti { width: 56px; height: 56px; }
  .chat-page .chat-welcome-mark { margin-bottom: 12px; }
  .chat-page .chat-welcome h3 { font-size: 22px; }
  .chat-page .chat-welcome > p { font-size: 13px; margin-top: 8px; }
  .chat-page .chat-prompts { margin-top: 14px; gap: 6px; }
  .chat-page .chat-prompts button { min-height: 40px; padding: 7px 12px; }
  .chat-page .chat-provider { margin-top: 6px; }
  .chat-page .chat-message[data-role="user"] { max-width: 86%; } /* designer 09-18. 768-ում 94%-ը ամբողջ սյունն էր լցնում — «ով է խոսում»-ը դիրքով չէր կարդացվում; 390-ը ստորև 94% է */
  .chat-page .chat-message[data-role="assistant"] { padding-left: 14px; }
  .chat-page .chat-bottom { padding: 6px 12px max(12px, env(safe-area-inset-bottom)); }
  .chat-page .chat-bottom { padding-bottom: max(12px, env(safe-area-inset-bottom), var(--kb-inset, 0px)); }
  .chat-page .chat-composer { border-radius: 18px; padding: 10px 12px; }
  .chat-page .chat-team { padding: 16px; }
}
@media (max-width: 520px) {
  .chat-page .chat-message[data-role="user"] { max-width: 94%; }
}
