.mail-item.tc-row { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px 8px 10px; border-bottom: 1px solid var(--line-soft); }
.tc-row-main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.tc-row-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tc-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13.5px/20px var(--ui); color: var(--ink); }
.tc-row-time { flex: none; font: 11px var(--mono); color: var(--mute); }
.tc-filters { display: flex; gap: 5px; overflow-x: auto; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); scrollbar-width: thin; }
.tc-list-note { padding: 10px 12px; font: 11px var(--mono); color: var(--mute); }
.tc-row-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12.5px/18px var(--ui); color: var(--mute); }

.tc-av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-soft); background: var(--surface-2); font: 600 10px var(--mono); color: var(--mute); }
.tc-av.is-group { border-radius: var(--r); }
.tc-av.is-blank { visibility: hidden; }

.mail-reader:has(.tc-thread) { overflow: hidden; }
.tc-head { flex: none; border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.tc-head-inner { box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: min(calc(100% - var(--tc-scrollbar-width, 0px)), 880px); min-height: 64px; margin: 0 auto; padding: 10px 20px; transform: translateX(calc(var(--tc-scrollbar-width, 0px) / -2)); }
.tc-head-copy { flex: 1; min-width: 0; }
.tc-head-title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 18px/1.3 var(--ui); letter-spacing: -.03em; color: var(--ink); }
.tc-head-sub { font: 12px var(--ui); color: var(--mute); }
.tc-files { position: relative; flex: none; }
.tc-files summary { min-height: 34px; display: flex; align-items: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 600 11px var(--mono); color: var(--ink-2); cursor: pointer; list-style: none; }
.tc-files summary::-webkit-details-marker { display: none; }
.tc-files summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tc-files-menu { position: absolute; z-index: 5; top: calc(100% + 6px); right: 0; display: flex; flex-direction: column; gap: 5px; width: min(300px, 70vw); padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); }

.tc-thread { container-type: inline-size; flex: 1; min-height: 0; overflow-y: auto; background: var(--surface-2); }
.tc-lines { box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; width: min(100%, 880px); min-height: 100%; margin: 0 auto; padding: 16px 20px 20px; }
.tc-older { align-self: center; margin: 4px 0 8px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; }
.tc-empty { margin: auto; font-size: 13px; color: var(--mute); }
.tc-day { display: flex; align-items: center; align-self: stretch; gap: 12px; margin: 18px 0 8px; font: 600 10px var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--mute); }
.tc-day::before, .tc-day::after { content: ''; height: 1px; flex: 1; background: var(--line-soft); }
.tc-event { align-self: center; margin: 6px 0; font: 11.5px var(--ui); color: var(--mute); text-align: center; }
.tc-who { margin: 12px 0 3px 42px; font: 600 12px var(--ui); color: var(--ink-2); }
.tc-who time { margin-left: 6px; font: 400 10.5px var(--mono); color: var(--faint); }
.tc-who.me { align-self: flex-end; margin-left: 0; color: var(--mute); }
.tc-who.me time { margin-left: 0; }

.tc-msg { display: flex; align-items: flex-start; gap: 10px; }
.tc-msg.me { justify-content: flex-end; }
.tc-msg.is-follow { margin-top: 2px; }
.tc-col { display: flex; flex-direction: column; min-width: 0; max-width: min(75%, 560px); }
.tc-msg.me .tc-col { align-items: flex-end; }
.tc-bub { min-width: 0; padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: 18px 18px 18px 5px; background: var(--surface); font: 14.5px/1.55 var(--ui); color: var(--ink-2); overflow-wrap: anywhere; }
.tc-msg.is-follow .tc-bub { border-radius: 18px; }
.tc-msg.me .tc-bub { border-radius: 18px 18px 5px 18px; background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tc-msg.me.is-follow .tc-bub { border-radius: 18px; }
.tc-msg.me .tc-text a[href] { color: inherit; }
.tc-msg.me .tc-text :is(.teams-attachment, pre, blockquote) { color: var(--ink); }
.tc-msg.me :is(.tc-mention, .tc-note) { color: inherit; }

.tc-text > :first-child { margin-top: 0; }
.tc-text > :last-child { margin-bottom: 0; }
.tc-text p, .tc-text ul, .tc-text ol, .tc-text blockquote, .tc-text pre, .tc-text table { margin: 0 0 6px; }
.tc-text ul, .tc-text ol { padding-left: 20px; }
.tc-text h1, .tc-text h2, .tc-text h3, .tc-text h4 { margin: 4px 0 6px; font-size: 14px; }
.tc-text blockquote { padding: 4px 8px; border-left: 1px solid var(--accent); background: var(--surface-2); color: var(--mute); font-size: 12.5px; }
.tc-text pre, .tc-text code { font: 12.5px var(--mono); }
.tc-text pre { overflow-x: auto; padding: 6px 8px; border-radius: var(--r-xs, 4px); background: var(--surface-2); white-space: pre-wrap; }
.tc-text table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 12.5px; }
.tc-text td, .tc-text th { padding: 3px 6px; border: 1px solid var(--line-soft); }
.tc-text img { display: block; max-width: 100%; max-height: 320px; margin-top: 4px; border-radius: var(--r); }
.tc-text a[href] { color: var(--accent); }
.tc-text hr { border: 0; border-top: 1px solid var(--line-soft); }
.tc-text .teams-attachment { display: flex; align-items: center; gap: 8px; margin-top: 5px; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface); font-size: 12px; }
.tc-mention { font-weight: 600; color: var(--accent); }
.tc-plain { margin: 0; white-space: pre-wrap; }
.tc-note { font-size: 12px; font-style: italic; color: var(--mute); }
.tc-deleted { color: var(--faint); }
.tc-flag { display: flex; align-items: center; gap: 8px; margin-top: 2px; font: 11px var(--ui); color: var(--mute); }
.tc-flag button { padding: 0; border: 0; background: none; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }

.tc-compose { flex: none; border-top: 1px solid var(--line-soft); background: var(--surface); }
.tc-compose-inner { box-sizing: border-box; display: flex; flex-direction: column; gap: 7px; width: min(calc(100% - var(--tc-scrollbar-width, 0px)), 880px); margin: 0 auto; padding: 10px 20px 12px; transform: translateX(calc(var(--tc-scrollbar-width, 0px) / -2)); }
.tc-compose-row { display: flex; align-items: flex-end; gap: 8px; padding: 5px; border: 2px solid var(--ink); border-radius: 14px; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.tc-compose-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.tc-compose-text { box-sizing: border-box; flex: 1; min-width: 0; min-height: 34px; overflow-y: auto; max-height: 160px; resize: none; padding: 6px 4px; border: 0; background: transparent; font: 15px/1.4 var(--ui); color: var(--ink); }
html .tc-compose-text:is(:focus, :focus-visible) { outline: none; }
.tc-compose-hint { min-height: 11px; text-align: center; font: 9px/1.2 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--mute); }
.tc-compose-inner > .mail-compose-status.is-error { color: var(--accent); font: 12px var(--ui); letter-spacing: 0; text-transform: none; }
.tc-send { width: 34px; min-width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.tc-send svg { margin: auto; }
.tc-compose-files { display: flex; flex-wrap: wrap; gap: 5px; }

@container (max-width: 480px) {
  .tc-who { margin-left: 0; }
  .tc-msg .tc-av { display: none; }
  .tc-col { max-width: 88%; }
}

@media (max-width: 760px) {
  .tc-head-inner, .tc-lines, .tc-compose-inner { padding-left: 16px; padding-right: 16px; }
  .tc-head-inner { min-height: 56px; }
  .tc-head-title { font-size: 16px; }
  .tc-col { max-width: 85%; }
  .tc-compose-inner { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .tc-compose-text { font-size: 16px; }
  .tc-compose-row .icbtn { width: 44px; min-width: 44px; height: 44px; }
  .tc-send { width: 44px; min-width: 44px; height: 44px; }
  .tc-compose-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tc-compose-row { transition: none; }
}
