/* Thursday AI Chat. Square, ink on paper, one orange thing: the proof. Uses the identity's tokens. */
.taic { --taic-gap: 24px; background: var(--tt-bg, #fff); color: var(--tt-text, #000); font-family: var(--font-ui, system-ui, sans-serif); }
.taic[dir="rtl"], .taic [lang="ur"] { font-family: var(--font-urdu, sans-serif); }
.taic *, .taic *::before, .taic *::after { box-sizing: border-box; }
.taic button { font: inherit; color: inherit; }
.taic :focus-visible { outline: var(--tt-focus-width, 3px) solid var(--tt-focus, #ff4200); outline-offset: 2px; }

.taic__wrap { max-width: var(--tt-max-width, 1440px); margin: 0 auto; padding: 0 var(--tt-margin-desktop, 48px); display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 0 48px; align-items: start; }

/* Rail: the desks */
.taic__rail { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 32px 0 24px; display: flex; flex-direction: column; gap: 16px; }
.taic__rail-head { display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; border-bottom: var(--tt-rule-section-width, 3px) solid var(--tt-text, #000); }
.taic__title { margin: 0; font-family: var(--font-display); font-size: 27px; line-height: 30px; font-weight: 900; letter-spacing: -0.025em; }
.taic[dir="rtl"] .taic__title { font-family: var(--font-urdu); letter-spacing: 0; line-height: 44px; }
.taic__new { align-self: flex-start; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--tt-text, #000); background: transparent; font-size: 15px; font-weight: 600; cursor: pointer; }
.taic__new:hover { background: var(--tt-text); color: var(--tt-bg); }
.taic__desks { display: flex; flex-direction: column; }
.taic__desk { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-top: var(--tt-rule-item-width, 1px) solid var(--tt-border, #e2e2e2); background: transparent; text-align: start; cursor: pointer; }
.taic__desk:first-child { border-top: 0; }
.taic__desk:hover { background: var(--tt-panel, #f2f2f2); }
.taic__desk[aria-selected="true"] { background: var(--tt-text, #000); color: var(--tt-bg, #fff); }
.taic__desk-name { font-size: 16px; line-height: 20px; font-weight: 700; }
.taic__desk-line { font-size: 13px; line-height: 18px; opacity: .72; }
.taic__note { margin: 0; font-size: 13px; line-height: 18px; color: var(--tt-text-secondary, #5c5c5c); }

/* Main column */
.taic__main { min-width: 0; min-height: calc(100vh - 80px); display: flex; flex-direction: column; padding-top: 32px; }
.taic__preview { margin: 0 0 16px; padding: 10px 14px; background: var(--tt-panel, #f2f2f2); border-inline-start: 3px solid var(--tt-orange, #ff4200); font-size: 14px; line-height: 20px; }
.taic__log { flex: 1; display: flex; flex-direction: column; gap: 28px; padding-bottom: 24px; max-width: 820px; width: 100%; }

.taic__empty { display: flex; flex-direction: column; gap: 16px; padding: 24px 0 8px; border-top: var(--tt-rule-section-width, 3px) solid var(--tt-text, #000); }
.taic__empty[hidden] { display: none; }
.taic__empty-label { margin: 0; font-family: var(--font-nav); font-size: 13px; line-height: 20px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.taic[dir="rtl"] .taic__empty-label { letter-spacing: 0; font-family: var(--font-urdu); font-size: 15px; }
.taic__empty-title { margin: 0; font-family: var(--font-display); font-size: 36px; line-height: 40px; font-weight: 900; letter-spacing: -0.025em; max-width: 22ch; }
.taic[dir="rtl"] .taic__empty-title { font-family: var(--font-urdu); font-size: 30px; line-height: 52px; letter-spacing: 0; }
.taic__starters { display: flex; flex-direction: column; border-top: var(--tt-rule-item-width, 1px) solid var(--tt-border, #e2e2e2); }
.taic__starter { display: flex; align-items: center; min-height: 52px; padding: 12px 0; border: 0; border-bottom: var(--tt-rule-item-width, 1px) solid var(--tt-border, #e2e2e2); background: transparent; text-align: start; font-family: var(--font-text); font-size: 18px; line-height: 26px; cursor: pointer; }
.taic[dir="rtl"] .taic__starter { font-family: var(--font-urdu); line-height: 34px; }
.taic__starter::after { content: "→"; margin-inline-start: auto; padding-inline-start: 16px; font-family: var(--font-ui); }
.taic[dir="rtl"] .taic__starter::after { content: "←"; }
.taic__starter:hover span { text-decoration: underline; text-underline-offset: 4px; }

/* Messages */
.taic__msg { display: flex; flex-direction: column; gap: 8px; }
.taic__msg--me { align-items: flex-end; }
.taic__bubble { max-width: 85%; padding: 12px 16px; background: var(--tt-text, #000); color: var(--tt-bg, #fff); font-family: var(--font-text); font-size: 17px; line-height: 26px; white-space: normal; overflow-wrap: anywhere; }
.taic[dir="rtl"] .taic__bubble { font-family: var(--font-urdu); line-height: 34px; }
.taic__tag { font-family: var(--font-nav); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--tt-text-secondary); }
.taic__sent { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.taic__sent span, .taic__file { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 4px 8px; border: 1px solid var(--tt-border, #e2e2e2); font-size: 13px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taic__who { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; font-weight: 700; }
.taic__dot { width: 8px; height: 8px; background: var(--tt-orange, #ff4200); }
.taic__status { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; line-height: 20px; color: var(--tt-text-secondary, #5c5c5c); }
.taic__spin { width: 14px; height: 14px; border: 2px solid currentColor; border-inline-end-color: transparent; animation: taic-spin .9s linear infinite; }
@keyframes taic-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .taic__spin { animation: none; } }

.taic__answer { display: flex; flex-direction: column; gap: 16px; }
.taic__body { font-family: var(--font-text); font-size: 18px; line-height: 30px; overflow-wrap: anywhere; }
.taic[dir="rtl"] .taic__body, .taic__body:lang(ur) { font-family: var(--font-urdu); font-size: 19px; line-height: 38px; }
.taic__body p { margin: 0 0 14px; }
.taic__body p:last-child { margin-bottom: 0; }
.taic__body h3 { margin: 20px 0 6px; font-family: var(--font-display); font-size: 19px; line-height: 24px; font-weight: 700; }
.taic__body ul, .taic__body ol { margin: 0 0 14px; padding-inline-start: 24px; }
.taic__body li { margin: 4px 0; }
.taic__body a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.taic__cites { white-space: nowrap; }
.taic__cite { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-inline-start: 3px; padding: 0 4px; background: var(--tt-text, #000); color: var(--tt-bg, #fff) !important; font-family: var(--font-ui); font-size: 11px; line-height: 1; font-weight: 700; text-decoration: none !important; vertical-align: 2px; }
.taic__cite--web, .taic__cite--link, .taic__cite--official { background: transparent; color: var(--tt-text) !important; box-shadow: inset 0 0 0 1.5px var(--tt-text); }
.taic__cite--doc { background: var(--tt-panel); color: var(--tt-text) !important; }

.taic__level { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; border: 1.5px solid var(--tt-orange, #ff4200); font-size: 14px; line-height: 20px; }
.taic__level b { font-weight: 700; }
.taic__level span:not(.taic__meter) { color: var(--tt-text-secondary); }
.taic__meter { display: inline-flex; gap: 3px; }
.taic__meter i { width: 10px; height: 10px; border: 1.5px solid var(--tt-orange, #ff4200); }
.taic__meter i.on { background: var(--tt-orange, #ff4200); }

.taic__src-wrap { border-top: var(--tt-rule-section-width, 3px) solid var(--tt-text, #000); }
.taic__src-wrap summary { min-height: 44px; display: flex; align-items: center; font-size: 15px; font-weight: 700; cursor: pointer; }
.taic__sources { list-style: none; margin: 0; padding: 0; }
.taic__sources li a, .taic__sources li > div { display: flex; gap: 12px; padding: 10px 0; border-top: var(--tt-rule-item-width, 1px) solid var(--tt-border, #e2e2e2); color: inherit; text-decoration: none; }
.taic__sources li a:hover .taic__src-title { text-decoration: underline; }
.taic__src-n { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 20px; height: 20px; padding: 0 4px; background: var(--tt-text); color: var(--tt-bg); font-size: 12px; font-weight: 700; }
.taic__src-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.taic__src-kind { font-size: 12px; line-height: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.taic[dir="rtl"] .taic__src-kind { text-transform: none; letter-spacing: 0; }
.taic__src-kind--web, .taic__src-kind--link, .taic__src-kind--official { color: var(--tt-text-secondary); }
.taic__src-title { font-size: 16px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.taic__src-meta { font-size: 13px; line-height: 18px; color: var(--tt-text-secondary); }

.taic__checked { margin: 0; font-size: 13px; line-height: 18px; color: var(--tt-text-secondary); }
.taic__checked::before { content: "✓ "; color: var(--tt-orange, #ff4200); font-weight: 700; }
.taic__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.taic__act { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--tt-border, #e2e2e2); background: transparent; font-size: 14px; font-weight: 600; color: inherit; text-decoration: none; cursor: pointer; }
.taic__act:hover { border-color: var(--tt-text); }
.taic__err { margin: 0; padding: 12px 14px; background: var(--tt-panel); border-inline-start: 3px solid var(--tt-text); font-size: 15px; line-height: 22px; }
.taic__cut { margin: 0; font-size: 14px; color: var(--tt-text-secondary); }

/* Composer */
.taic__composer { position: sticky; bottom: 0; z-index: 5; max-width: 820px; width: 100%; padding: 12px 0 16px; background: var(--tt-bg, #fff); display: flex; flex-direction: column; gap: 8px; }
.taic__files { display: flex; flex-wrap: wrap; gap: 6px; }
.taic__files[hidden] { display: none; }
.taic__file-x { border: 0; background: transparent; padding: 0 2px; font-size: 16px; line-height: 1; cursor: pointer; }
.taic__notice { margin: 0; font-size: 13px; line-height: 18px; color: var(--tt-text-secondary); }
.taic__notice[hidden] { display: none; }
.taic__ts:empty { display: none; }
.taic__box { display: flex; align-items: flex-end; border: 1.5px solid var(--tt-text, #000); background: var(--tt-bg, #fff); }
.taic__input { flex: 1; min-width: 0; min-height: 54px; max-height: 200px; margin: 0; padding: 15px 16px; border: 0; background: transparent; color: var(--tt-text); font-family: var(--font-text); font-size: 17px; line-height: 24px; resize: none; }
.taic__input:focus { outline: none; }
.taic[dir="rtl"] .taic__input, .taic__input:lang(ur) { font-family: var(--font-urdu); font-size: 17px; line-height: 28px; padding-block: 12px; }
.taic__new { white-space: nowrap; }
.taic__box:focus-within { box-shadow: 0 0 0 var(--tt-focus-width, 3px) var(--tt-focus, #ff4200); }
.taic__tools { display: flex; align-items: stretch; flex: none; }
.taic__tool { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 54px; border: 0; background: transparent; cursor: pointer; }
.taic__tool:hover { background: var(--tt-panel); }
.taic__tool.is-on { color: var(--tt-orange, #ff4200); }
.taic__tool[hidden] { display: none; }
.taic__send { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 54px; border: 0; background: var(--tt-text, #000); color: var(--tt-bg, #fff); cursor: pointer; }
.taic__composer.is-busy .taic__send svg { display: none; }
.taic__composer.is-busy .taic__send::before { content: ""; width: 14px; height: 14px; background: currentColor; }
.taic__disclaimer { margin: 0; font-size: 12px; line-height: 16px; color: var(--tt-text-secondary); }
.taic__privacy { font-size: 12px; line-height: 17px; color: var(--tt-text-secondary); }
.taic__privacy summary { display: inline-flex; min-height: 24px; align-items: center; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.taic__privacy p { margin: 4px 0 0; max-width: 70ch; }

/* Thursday AI's own stylesheet sets every button's colour on its pages; these win over it. */
#taic .taic__desk[aria-selected="true"], #taic .taic__new:hover { color: var(--tt-bg, #fff); }
#taic .taic__send { color: var(--tt-bg, #fff); }
#taic .taic__tool.is-on { color: var(--tt-orange, #ff4200); }

/* Phone */
@media (max-width: 900px) {
	.taic__wrap { display: block; padding: 0 var(--tt-margin-phone, 20px); }
	.taic__rail { position: static; max-height: none; overflow: visible; padding: 20px 0 0; gap: 12px; }
	.taic__rail-head { flex-direction: row; align-items: center; justify-content: space-between; padding-bottom: 12px; }
	.taic__title { font-size: 22px; line-height: 26px; }
	.taic__new { min-height: 40px; padding: 0 12px; font-size: 14px; }
	.taic__desks { flex-direction: row; gap: 6px; overflow-x: auto; margin: 0 calc(-1 * var(--tt-margin-phone, 20px)); padding: 0 var(--tt-margin-phone, 20px) 4px; scrollbar-width: none; }
	.taic__desks::-webkit-scrollbar { display: none; }
	.taic__desk { flex: none; width: auto; min-height: 40px; padding: 8px 14px; border: 1px solid var(--tt-border, #e2e2e2); justify-content: center; }
	.taic__desk:first-child { border-top: 1px solid var(--tt-border, #e2e2e2); }
	.taic__desk-line { display: none; }
	.taic__desk-name { font-size: 14px; white-space: nowrap; }
	.taic__note { display: none; }
	.taic__main { padding-top: 16px; min-height: 70vh; }
	.taic__empty-title { font-size: 27px; line-height: 31px; }
	.taic[dir="rtl"] .taic__empty-title { font-size: 24px; line-height: 42px; }
	.taic__starter { font-size: 16px; line-height: 23px; }
	.taic__body { font-size: 17px; line-height: 28px; }
	.taic__bubble { max-width: 92%; font-size: 16px; line-height: 24px; }
	.taic__composer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
	.taic__input { font-size: 16px; }
	.taic__tool { width: 42px; }
}
