:root {
  --tos-navy: #071e34;
  --tos-navy-card: #0b2a47;
  --tos-navy-raised: #153b5c;
  --tos-cyan: #55c2f0;
  --tos-gold: #d9a441;
  --tos-white: #ffffff;
  --tos-surface: #e8f3fa;
  --tos-surface-blue: #d8e6ef;
  --tos-ink: #132033;
  --tos-muted: #566575;
  --tos-border: #d8e6ef;
  --tos-danger: #a42b31;
  --tos-success: #08735b;
  --tos-radius: 12px;
  --tos-shadow: 0 8px 28px rgba(7, 30, 52, .045);
  font-family: Aptos, "Segoe UI", system-ui, sans-serif;
  color: var(--tos-ink);
  background: #f7fbfd;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
a { color: #075b80; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #0d6f9d; outline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Aptos Display", Aptos, "Segoe UI", system-ui, sans-serif; line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 3vw, 2.35rem); letter-spacing: -.025em; }
h2 { font-size: 1.28rem; letter-spacing: -.01em; }
h3 { font-size: 1.06rem; }
p { line-height: 1.55; }
.muted { color: var(--tos-muted); }
.eyebrow { color: #936212; font-size: .76rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow-on-navy { color: var(--tos-gold); }
.text-cyan { color: var(--tos-cyan); }
.app-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.tos-sidebar { background: var(--tos-navy); color: var(--tos-white); display: flex; flex-direction: column; padding: 28px 16px 22px; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: block; padding: 4px 10px 24px; border-bottom: 1px solid rgba(216, 230, 239, .16); }
.sidebar-brand img { width: 210px; height: 72px; object-fit: contain; object-position: left center; display: block; }
.sidebar-brand small { display: block; color: #c9d8e5; font-size: .78rem; letter-spacing: .02em; margin-top: 9px; }
.sidebar-label { color: #88a7bd; text-transform: uppercase; letter-spacing: .13em; font-size: .67rem; font-weight: 700; padding: 28px 15px 9px; }
.sidebar-nav { display: grid; gap: 4px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; color: #d7e4ed; padding: 11px 15px; border-radius: 8px; font-size: .92rem; font-weight: 600; min-height: 43px; }
.sidebar-nav a:hover { color: white; background: var(--tos-navy-raised); text-decoration: none; }
.sidebar-nav a.active { background: var(--tos-navy-card); color: var(--tos-white); box-shadow: inset 3px 0 var(--tos-cyan); }
.nav-mark { display: inline-block; width: 7px; height: 7px; border: 1.5px solid currentColor; border-radius: 50%; flex: none; }
.sidebar-nav a.active .nav-mark { background: var(--tos-cyan); border-color: var(--tos-cyan); }
.sidebar-bottom { margin-top: auto; padding: 20px 11px 0; border-top: 1px solid rgba(216, 230, 239, .16); }
.sidebar-person { color: white; font-weight: 700; overflow-wrap: anywhere; font-size: .91rem; }
.sidebar-email { color: #a9bfd0; font-size: .76rem; overflow-wrap: anywhere; margin: 4px 0 13px; }
.sidebar-signout { color: #cce7f3; font-size: .82rem; }
.tos-workspace { min-width: 0; }
.tos-topbar { background: #fff; border-bottom: 1px solid var(--tos-border); padding: 17px clamp(20px, 3vw, 40px); display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.topbar-title { font-size: .83rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; color: var(--tos-navy); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.language-switch { display: inline-flex; gap: 3px; background: var(--tos-surface); padding: 3px; border-radius: 8px; }
.language-switch a { color: var(--tos-muted); font-size: .74rem; font-weight: 750; border-radius: 6px; padding: 5px 7px; }
.language-switch a[aria-current="true"] { background: #fff; color: var(--tos-navy); box-shadow: 0 1px 4px rgba(7,30,52,.09); }
.topbar-name { font-size: .82rem; color: var(--tos-muted); }
.tos-main { max-width: 1480px; margin: 0 auto; padding: 32px clamp(20px, 3vw, 40px) 70px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 36px 0 16px; }
.section-head h2 { margin: 4px 0 0; }
.section-head p { margin: 0; }
.section-kicker { color: #936212; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; }
.tos-card { background: var(--tos-white); border: 1px solid var(--tos-border); border-radius: var(--tos-radius); box-shadow: var(--tos-shadow); padding: 22px; min-width: 0; }
.tos-card h2, .tos-card h3 { margin-bottom: 15px; }
.tos-card--soft { background: var(--tos-surface); }
.tos-card--navy { background: var(--tos-navy-card); color: white; border-color: #315571; box-shadow: none; }
.tos-card--navy .muted { color: #c9d8e5; }
.tos-button { appearance: none; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; background: var(--tos-cyan); color: var(--tos-navy); font-weight: 750; font-size: .9rem; padding: 10px 16px; min-height: 42px; cursor: pointer; }
.tos-button:hover { background: #76d1f5; text-decoration: none; }
.tos-button--secondary { background: white; border-color: #9cc7dc; color: var(--tos-navy); }
.tos-button--secondary:hover { background: var(--tos-surface); }
.tos-button--navy { background: var(--tos-navy); color: white; }
.tos-button--navy:hover { background: var(--tos-navy-raised); }
.tos-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 100px; padding: 5px 9px; background: var(--tos-surface); color: var(--tos-navy); font-size: .71rem; font-weight: 750; white-space: nowrap; }
.tos-badge--cyan { background: #d9f2fd; color: #075b80; }
.tos-badge--gold { background: #fff0d0; color: #6f4a0e; }
.tos-badge--neutral { background: #edf1f4; color: #4b5d6e; }
.tos-status { display: inline-flex; align-items: center; gap: 7px; color: var(--tos-muted); font-size: .78rem; font-weight: 650; }
.tos-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8195a5; }
.tos-status--connected { color: var(--tos-success); }
.tos-status--connected::before { background: var(--tos-success); }
.tos-status--running { color: #076c8c; }
.tos-status--running::before { background: var(--tos-cyan); }
.tos-status--attention { color: #825611; }
.tos-status--attention::before { background: var(--tos-gold); }
.tos-status--error { color: var(--tos-danger); }
.tos-status--error::before { background: var(--tos-danger); }
.hero { background: var(--tos-navy); color: white; border-radius: 14px; padding: clamp(24px, 3vw, 38px); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .85fr); gap: 24px; align-items: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 5px; background: var(--tos-gold); }
.hero h1 { margin: 10px 0 10px; }
.hero p { color: #d6e4ec; max-width: 58ch; margin-bottom: 0; }
.hero-project { background: #0b2a47; border: 1px solid #315571; padding: 19px; border-radius: 10px; }
.hero-project .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--tos-cyan); font-weight: 700; }
.hero-project strong { display: block; font-size: 1.08rem; margin: 7px 0 5px; }
.hero-project p { font-size: .82rem; color: #c9d8e5; margin: 0 0 15px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.metric-card { padding: 17px 20px; min-height: 112px; }
.metric-label { color: var(--tos-muted); font-size: .78rem; font-weight: 650; }
.metric-value { display: block; font-size: 1.88rem; font-weight: 750; color: var(--tos-navy); margin: 10px 0 2px; line-height: 1; }
.metric-caption { color: var(--tos-muted); font-size: .72rem; }
.metric-card--accent { border-top: 3px solid var(--tos-cyan); }
.metric-card--gold { border-top: 3px solid var(--tos-gold); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tos-project-card { display: block; transition: border-color .15s, transform .15s; }
.tos-project-card:hover { border-color: #89c5e0; transform: translateY(-2px); text-decoration: none; }
.project-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.project-card-title { color: var(--tos-navy); margin: 0; font-size: 1.13rem; }
.project-card-client { color: var(--tos-muted); font-size: .78rem; margin-top: 5px; }
.project-card-meta { display: flex; gap: 7px; flex-wrap: wrap; margin: 22px 0; }
.project-card-footer { border-top: 1px solid var(--tos-border); padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.project-card-counts { color: var(--tos-muted); font-size: .75rem; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .9fr); gap: 16px; }
.content-grid--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tos-list { margin: 0; padding: 0; list-style: none; }
.tos-list li { border-top: 1px solid var(--tos-border); padding: 12px 0; }
.tos-list li:first-child { border-top: 0; padding-top: 0; }
.tos-list li:last-child { padding-bottom: 0; }
.list-title { color: var(--tos-ink); font-weight: 650; font-size: .86rem; }
.list-subtitle { color: var(--tos-muted); font-size: .75rem; margin-top: 3px; }
.list-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.empty-state { color: var(--tos-muted); font-size: .86rem; padding: 14px 0; }
.health-line { display: flex; gap: 9px; align-items: center; margin: 0 0 8px; }
.health-line strong { font-size: .88rem; }
.breadcrumb { display: inline-flex; align-items: center; gap: 8px; font-size: .79rem; font-weight: 650; margin-bottom: 26px; }
.project-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 22px; }
.project-header h1 { margin: 6px 0 7px; }
.project-header p { color: var(--tos-muted); margin-bottom: 0; }
.context-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 17px 22px; }
.context-item { padding: 0 16px; border-left: 1px solid var(--tos-border); min-width: 0; }
.context-item:first-child { padding-left: 0; border-left: 0; }
.context-label { color: var(--tos-muted); font-size: .69rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 750; }
.context-value { display: block; color: var(--tos-navy); font-size: .9rem; font-weight: 700; margin-top: 5px; overflow-wrap: anywhere; }
.project-columns { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; margin-top: 18px; }
.chat-panel { padding: 0; overflow: hidden; }
.chat-header { padding: 19px 22px; border-bottom: 1px solid var(--tos-border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chat-header h2 { margin: 0; }
.chat-header p { margin: 4px 0 0; font-size: .78rem; color: var(--tos-muted); }
.chat-log { min-height: 230px; max-height: 560px; overflow-y: auto; padding: 23px 22px; background: #fbfdff; }
.chat-empty { display: grid; place-content: center; min-height: 180px; max-width: 400px; margin: 0 auto; text-align: center; }
.chat-empty strong { color: var(--tos-navy); font-size: 1.05rem; }
.chat-empty p { color: var(--tos-muted); font-size: .86rem; margin: 8px 0 0; }
.message { max-width: 82%; margin-bottom: 16px; }
.message--user { margin-left: auto; }
.message-label { font-size: .73rem; font-weight: 750; color: var(--tos-muted); margin: 0 0 5px; }
.message--user .message-label { text-align: right; }
.message-body { border-radius: 10px; padding: 13px 16px; background: var(--tos-surface); color: var(--tos-ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.55; }
.message--user .message-body { background: var(--tos-navy-card); color: white; }
.diagnostics { margin-top: 8px; font-size: .73rem; color: var(--tos-muted); }
.diagnostics summary { cursor: pointer; }
.diagnostics pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #edf4f8; padding: 10px; border-radius: 6px; }
.chat-compose { border-top: 1px solid var(--tos-border); padding: 19px 22px 22px; }
.field-label { display: block; font-size: .75rem; font-weight: 750; color: var(--tos-navy); margin-bottom: 7px; }
.tos-select, .tos-textarea, .tos-input { border: 1px solid #a9c5d4; border-radius: 8px; background: white; color: var(--tos-ink); padding: 10px 12px; width: 100%; }
.tos-select { max-width: 350px; margin-bottom: 15px; }
.tos-textarea { display: block; min-height: 116px; resize: vertical; line-height: 1.5; }
.tos-textarea:focus, .tos-input:focus, .tos-select:focus { outline: 2px solid var(--tos-cyan); outline-offset: 2px; border-color: var(--tos-navy); }
.compose-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.project-side { display: grid; gap: 16px; }
.knowledge-form { display: flex; gap: 9px; margin-top: 13px; }
.knowledge-form .tos-input { min-width: 0; }
.expert-line { display: flex; align-items: center; gap: 9px; font-size: .83rem; margin-top: 10px; }
.expert-line:first-of-type { margin-top: 0; }
.expert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tos-cyan); }
.expert-dot--senior { background: var(--tos-gold); }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 46%) minmax(0, 1fr); background: var(--tos-navy); }
.login-copy { padding: clamp(30px, 5vw, 74px); display: flex; flex-direction: column; color: white; min-width: 0; }
.login-logo { width: 310px; height: 104px; object-fit: contain; object-position: left; }
.login-content { margin: auto 0; padding: 60px 0; max-width: 570px; }
.login-content h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); line-height: 1.08; margin: 15px 0 22px; }
.login-content p { color: #d6e4ec; font-size: 1.07rem; max-width: 46ch; }
.login-content .tos-button { margin-top: 22px; padding: 13px 20px; font-size: .98rem; }
.login-trust { color: #b8d0df; font-size: .77rem; margin-top: 17px; }
.login-bottom { color: #aec4d3; font-size: .78rem; display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.login-photo { position: relative; min-height: 100vh; background: url('/static/rabat-office.png') center center / cover no-repeat; }
.login-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,30,52,.13), transparent 30%); }
.login-photo-caption { position: absolute; bottom: 32px; right: 36px; z-index: 1; color: var(--tos-navy); background: rgba(255,255,255,.88); padding: 12px 16px; border-radius: 7px; font-size: .82rem; max-width: 290px; }
.admin-heading { display:flex; align-items:end; justify-content:space-between; gap:20px; }
.admin-heading h1 { margin:5px 0 18px; }
.admin-nav { display:flex; gap:4px; flex-wrap:wrap; border-bottom:1px solid var(--tos-border); margin-bottom:20px; }
.admin-nav a { padding:10px 13px; font-size:.83rem; color:var(--tos-muted); font-weight:700; border-bottom:3px solid transparent; }
.admin-nav a.active { color:var(--tos-navy); border-color:var(--tos-cyan); }
.admin-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; align-items:start; }
.admin-grid--main { grid-template-columns:minmax(0,2.2fr) minmax(280px,1fr); }
.admin-stat { display:block; }
.admin-stat span { color:var(--tos-muted); font-size:.77rem; }
.admin-stat strong { display:block; color:var(--tos-navy); font-size:1.7rem; margin-top:8px; }
.admin-table { width:100%; border-collapse:collapse; font-size:.79rem; }
.admin-table th { text-align:left; color:var(--tos-muted); font-size:.69rem; text-transform:uppercase; letter-spacing:.05em; }
.admin-table td,.admin-table th { padding:10px 9px; border-bottom:1px solid var(--tos-border); vertical-align:top; }
.admin-table td:first-child,.admin-table th:first-child { padding-left:0; }
.admin-table td:last-child,.admin-table th:last-child { padding-right:0; }
.admin-table form { margin:0; }
.admin-table .tos-button { min-height:30px; padding:4px 9px; font-size:.72rem; }
.admin-form { display:grid; gap:11px; font-size:.8rem; }
.admin-form label:not(.admin-check) { display:grid; gap:4px; font-weight:650; }
.admin-form .tos-select { max-width:none; margin:0; }
.admin-form fieldset { border:1px solid var(--tos-border); border-radius:8px; display:grid; gap:7px; max-height:180px; overflow:auto; }
.admin-form legend { font-weight:700; color:var(--tos-navy); }
.admin-check { display:flex; gap:7px; align-items:center; font-size:.8rem; }
.admin-search { display:flex; align-items:end; gap:8px; margin-bottom:15px; }
.admin-search .tos-input { max-width:340px; }
.admin-facts { display:grid; grid-template-columns:1fr 1fr; gap:8px 15px; font-size:.8rem; }
.admin-facts dt { color:var(--tos-muted); }
.admin-facts dd { margin:0; font-weight:700; overflow-wrap:anywhere; }
.space { margin-top:18px; }
.compact-heading { display:flex; justify-content:space-between; align-items:end; gap:16px; margin-bottom:22px; }
.compact-heading h1 { margin:4px 0 5px; }
.compact-heading p { margin:0; }
.chat-workspace { display:grid; grid-template-columns:225px minmax(0,1fr); min-height:calc(100vh - 160px); gap:0; border:1px solid var(--tos-border); border-radius:10px; background:white; overflow:hidden; }
.chat-history { padding:15px 10px; background:#f2f8fb; border-right:1px solid var(--tos-border); min-width:0; }
.chat-history .list-row { padding:0 5px 13px; }
.chat-history .tos-button { padding:4px 8px; min-height:28px; }
.chat-history .tos-input { font-size:.78rem; padding:7px 9px; margin-bottom:10px; }
.history-link { display:block; padding:9px 10px; border-radius:6px; font-size:.78rem; color:var(--tos-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.history-link.active { background:#dff2fa; color:var(--tos-navy); font-weight:700; }
.history-link[hidden] { display:none; }
.chat-main { display:flex; flex-direction:column; min-width:0; min-height:600px; }
.chat-context { display:flex; justify-content:space-between; align-items:start; gap:12px; padding:12px 18px; border-bottom:1px solid var(--tos-border); }
.chat-context .breadcrumb { margin:0 0 7px; }
.chat-context-line { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.chat-context-desc { color:var(--tos-muted); font-size:.72rem; margin-top:5px; max-width:70ch; }
.chat-context .tos-badge { font-size:.68rem; padding:4px 7px; }
.chat-more { position:relative; }
.chat-more summary { cursor:pointer; font-size:1.25rem; list-style:none; }
.chat-more[open] { background:white; box-shadow:var(--tos-shadow); border:1px solid var(--tos-border); border-radius:7px; padding:8px; z-index:2; }
.chat-more form { display:flex; gap:5px; margin-top:6px; }
.chat-more .tos-button { font-size:.7rem; padding:5px 8px; }
.chat-thread { flex:1; overflow-y:auto; max-height:calc(100vh - 310px); min-height:400px; padding:25px clamp(18px,5vw,64px); }
.chat-thread .message { max-width:760px; }
.chat-thread .message--user { margin-left:auto; }
.chat-welcome { display:grid; place-content:center; text-align:center; min-height:350px; color:var(--tos-navy); }
.chat-welcome p { color:var(--tos-muted); max-width:48ch; }
.chat-input { padding:13px 18px 16px; border-top:1px solid var(--tos-border); }
.chat-input-row { display:flex; align-items:end; gap:8px; border:1px solid #9dbbc9; border-radius:9px; padding:6px; }
.chat-input-row:focus-within { border-color:var(--tos-cyan); box-shadow:0 0 0 2px #bce9fb; }
.chat-input textarea { flex:1; resize:vertical; min-height:45px; max-height:160px; border:0; outline:0; padding:9px 3px; min-width:0; font-size:.88rem; }
.chat-input-row .tos-button { white-space:nowrap; }
.attach-button { display:grid; place-items:center; width:37px; height:39px; border-radius:7px; cursor:pointer; font-size:1.4rem; color:var(--tos-navy); }
.attach-button:hover { background:var(--tos-surface); }
.chat-input-meta { display:flex; justify-content:space-between; gap:12px; margin:8px 3px 0; color:var(--tos-muted); font-size:.68rem; }
.chat-input-meta select { border:0; background:transparent; color:var(--tos-muted); max-width:180px; }
.attachment-chips { display:flex; gap:5px; flex-wrap:wrap; margin-bottom:5px; }
.attachment-chip { background:var(--tos-surface); border-radius:5px; padding:4px 7px; font-size:.7rem; }
.attachment-chip button { border:0; background:transparent; cursor:pointer; }
.chat-files { display:flex; gap:6px; flex-wrap:wrap; padding:7px 18px; border-bottom:1px solid var(--tos-border); }
.chat-response-footer { display:flex; flex-wrap:wrap; gap:9px; color:var(--tos-muted); font-size:.69rem; margin-top:5px; }
.feedback-button { background:transparent; border:0; color:#28617a; cursor:pointer; font-size:.7rem; padding:0; }
.feedback-button.selected { font-weight:800; text-decoration:underline; }
@media (max-width: 1120px) {
  .app-layout { grid-template-columns: 208px minmax(0, 1fr); }
  .tos-sidebar { padding-left: 11px; padding-right: 11px; }
  .sidebar-brand img { width: 180px; height: 62px; }
  .project-grid { grid-template-columns: 1fr; }
  .content-grid--thirds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-grid--main { grid-template-columns:1fr; }
}
@media (max-width: 820px) {
  .app-layout { display: block; }
  .tos-sidebar { position: static; height: auto; padding: 12px 18px; }
  .sidebar-brand { padding: 3px 0 9px; border: 0; }
  .sidebar-brand img { width: 170px; height: 58px; }
  .sidebar-brand small, .sidebar-label, .sidebar-bottom { display: none; }
  .sidebar-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 1px; }
  .sidebar-nav a { white-space: nowrap; padding: 8px 11px; min-height: 36px; font-size: .81rem; }
  .nav-mark { display: none; }
  .sidebar-nav a.active { box-shadow: inset 0 -3px var(--tos-cyan); }
  .hero { grid-template-columns: 1fr; }
  .project-columns, .content-grid { grid-template-columns: 1fr; }
  .project-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .context-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .context-item:nth-child(3) { padding-left: 0; border-left: 0; }
  .login-layout { grid-template-columns: 1fr; }
  .login-copy { min-height: 70vh; }
  .login-photo { min-height: 30vh; }
  .admin-grid { grid-template-columns:1fr; }
  .admin-table { display:block; overflow-x:auto; }
  .chat-workspace { grid-template-columns:160px minmax(0,1fr); }
}
@media (max-width: 600px) {
  .tos-topbar { padding: 12px 18px; min-height: 55px; }
  .topbar-name { display: none; }
  .tos-main { padding: 22px 16px 50px; }
  .metric-grid, .content-grid--thirds, .project-side { grid-template-columns: 1fr; }
  .section-head { align-items: start; }
  .project-header { display: block; }
  .project-header .tos-button { margin-top: 15px; }
  .context-bar { padding: 16px; }
  .context-item { padding: 0 10px; }
  .message { max-width: 96%; }
  .chat-header, .chat-log, .chat-compose { padding-left: 16px; padding-right: 16px; }
  .login-copy { min-height: 76vh; padding: 28px 25px; }
  .login-logo { width: 230px; height: 78px; }
  .login-content { padding: 45px 0; }
  .login-photo { min-height: 24vh; }
  .login-photo-caption { right: 14px; bottom: 14px; }
  .compact-heading { display:block; }
  .compact-heading .tos-button { margin-top:12px; }
  .chat-workspace { display:block; }
  .chat-history { border-right:0; border-bottom:1px solid var(--tos-border); max-height:115px; overflow:auto; }
  .chat-history #history-search { display:none; }
  .chat-history nav { display:flex; overflow:auto; }
  .history-link { flex:0 0 auto; max-width:180px; }
  .chat-main { min-height:calc(100vh - 270px); }
  .chat-thread { max-height:none; min-height:300px; }
  .chat-input-meta span { display:none; }
}
