/* UPD8 (src/upd8): on top of the portal's styles (/app/styles.css), its colours and its controls. */
:root { --upd8-todo: #8b97a8; --upd8-doing: var(--accent); --upd8-done: var(--ok); --upd8-late: var(--danger); }
input[type=date] { min-height: 38px; padding: 0 9px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.linkish { border: 0; background: none; padding: 0; color: var(--accent-text); cursor: pointer; text-align: left; font: inherit; }
.linkish:hover { text-decoration: underline; }

/* the frame: CR8's side menu (the portal's .app-layout and .side-rail) and its page */
.upd8-main { outline: none; }
.upd8-lang-code { display: inline-grid; place-items: center; min-width: 22px; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.menu.upd8-open { position: fixed; }
.lang-menu { max-height: 70vh; overflow: auto; }
.upd8-loading { display: grid; place-items: center; min-height: 60vh; }
.upd8-gate { max-width: 460px; margin: 12vh auto; text-align: center; }
.upd8-gate .btn-row { justify-content: center; }

/* page heads and tools */
.upd8-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.upd8-bar h1 { margin: 0; font-size: 22px; }
.upd8-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.upd8-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.upd8-filters select { width: auto; min-height: 32px; }
.upd8-seg { display: inline-flex; gap: 2px; }
.upd8-empty { padding: 40px 0; text-align: center; }

/* projects */
.upd8-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.upd8-project { display: block; color: var(--text); }
.upd8-project.card + .card { margin-top: 0; }
.upd8-project:hover { border-color: var(--accent); text-decoration: none; }
.upd8-project h2 { margin: 0 0 6px; font-size: 17px; }
.upd8-meter { height: 6px; margin: 10px 0; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.upd8-meter div { height: 100%; background: var(--upd8-done); }
.upd8-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); align-items: center; }

/* forms and windows */
.upd8-sheet.wide { max-width: min(760px, 100%); }
.upd8-form textarea, .upd8-task textarea { font-family: inherit; font-size: 14px; }
.upd8-pick { display: grid; gap: 6px; }
.upd8-pick-list { max-height: 220px; overflow: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 6px 10px; }
.upd8-pick-list.short { max-height: 160px; }
.upd8-team-mark { color: var(--accent-text); font-size: 10px; }
.upd8-statuses, .upd8-columns { display: grid; gap: 6px; justify-items: start; }
.upd8-status-row { display: grid; grid-template-columns: 1fr 160px auto auto; gap: 6px; width: 100%; align-items: center; }
.upd8-days { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.upd8-line { display: flex; align-items: center; gap: 8px; }
.upd8-line > :first-child { flex: 1; }
.upd8-column-edit { display: grid; gap: 8px; width: 100%; padding: 10px; }
.upd8-column-edit.card + .card { margin-top: 0; }

/* a task */
.upd8-task h3 { margin: 18px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.upd8-task h4 { margin: 8px 0 4px; font-size: 13px; font-weight: 600; }
.upd8-task-title { font-size: 18px; font-weight: 650; }
.upd8-task-grid { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; margin: 10px 0; }
.upd8-task-grid label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; }
.upd8-task-grid select { width: auto; min-width: 150px; }
.upd8-task-grid input[type=number] { width: 110px; }
.upd8-progress { grid-template-columns: auto; }
.upd8-progress input { width: 180px; }
.upd8-crumbs { font-size: 12px; margin-bottom: 6px; }
.upd8-dates { padding-bottom: 8px; }
.upd8-deliverables, .upd8-chains, .upd8-subtasks { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.upd8-deliverables li, .upd8-chains li, .upd8-subtasks li { display: flex; align-items: center; gap: 8px; }
.upd8-inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.upd8-inline input, .upd8-inline select { flex: 1; min-width: 160px; width: auto; }
.upd8-inline .upd8-lag { flex: none; width: 80px; min-width: 0; }
.upd8-danger { justify-content: flex-start; margin-top: 22px; }

/* statuses */
.upd8-status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; border: 1px solid var(--line); }
.upd8-status.todo { color: var(--upd8-todo); }
.upd8-status.doing { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.upd8-status.done { color: var(--upd8-done); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.upd8-late { color: var(--upd8-late); font-weight: 600; }

/* the list */
.upd8-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.upd8-list th { text-align: left; font-size: 12px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.upd8-list td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
.upd8-list tr.parent td:first-child { font-weight: 650; }
.upd8-list tr.overdue td:nth-child(3) { color: var(--upd8-late); }

/* the Gantt chart */
.gantt { position: relative; overflow: auto; max-height: calc(100vh - 190px); border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); }
.gantt-grid { position: relative; overflow: clip; }
.gantt-header { position: sticky; top: 0; z-index: 5; display: flex; height: var(--head); }
.gantt-corner { position: sticky; left: 0; z-index: 6; flex: none; width: var(--left); height: var(--head); background: linear-gradient(var(--panel-2), var(--panel-2)) var(--bg); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.gantt-head { position: relative; flex: none; height: var(--head); background: linear-gradient(var(--panel-2), var(--panel-2)) var(--bg); border-bottom: 1px solid var(--line); }
.gantt-body { position: relative; }
.gantt-names { position: sticky; left: 0; z-index: 3; width: var(--left); height: 100%; background: linear-gradient(var(--panel), var(--panel)) var(--bg); border-right: 1px solid var(--line); }
.gantt-scale { position: relative; height: 50%; }
.gantt-scale.top { border-bottom: 1px solid var(--line-soft); }
.gantt-unit { position: absolute; top: 0; bottom: 0; padding: 3px 5px; overflow: hidden; white-space: nowrap; font-size: 11px; color: var(--muted); border-left: 1px solid var(--line-soft); }
.gantt-scale.top .gantt-unit { font-weight: 650; color: var(--text); }
.gantt-unit.off { background: rgba(127,127,127,.08); }
.gantt-lines { position: absolute; pointer-events: none; }
.gantt-off { position: absolute; top: 0; bottom: 0; background: rgba(127,127,127,.07); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--warn); opacity: .8; }
.gantt-name { position: absolute; left: 0; right: 0; height: var(--row); display: flex; align-items: center; gap: 4px; padding-right: 8px; font-size: 13px; }
.gantt-name.parent .gantt-title, .gantt-name.project .gantt-title { font-weight: 650; }
.gantt-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: none; padding: 0; text-align: left; color: inherit; cursor: pointer; font: inherit; }
.gantt-title:hover { color: var(--accent-text); }
.gantt-note { flex: 0 1 auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.gantt-toggle { border: 0; background: none; color: var(--muted); cursor: pointer; width: 18px; padding: 0; }
.gantt-rowline { position: absolute; left: 0; right: 0; height: 1px; background: var(--line-soft); opacity: .6; }
.gantt-bar { position: absolute; z-index: 2; height: calc(var(--row) - 14px); border-radius: 4px; background: color-mix(in srgb, var(--upd8-todo) 55%, transparent); border: 1px solid var(--upd8-todo); overflow: visible; cursor: pointer; touch-action: none; }
.gantt-bar.doing { background: color-mix(in srgb, var(--upd8-doing) 35%, transparent); border-color: var(--upd8-doing); }
.gantt-bar.done { background: color-mix(in srgb, var(--upd8-done) 40%, transparent); border-color: var(--upd8-done); }
.gantt-bar.overdue { border-color: var(--upd8-late); box-shadow: inset 0 0 0 1px var(--upd8-late); }
.gantt-bar.summary { height: 8px; margin-top: 5px; border-radius: 2px; background: var(--text); border-color: var(--text); opacity: .75; }
.gantt-bar.span { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); border-style: dashed; }
.gantt-bar.can-plan { cursor: grab; }
.gantt-progress { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, currentColor 18%, transparent); border-radius: 3px 0 0 3px; pointer-events: none; }
.gantt-bar.doing .gantt-progress { background: color-mix(in srgb, var(--upd8-doing) 55%, transparent); }
.gantt-grip { position: absolute; top: -1px; right: -1px; bottom: -1px; width: 8px; cursor: ew-resize; border-radius: 0 4px 4px 0; }
.gantt-grip:hover { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.gantt-dot { position: absolute; top: 50%; right: -14px; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--accent); opacity: 0; cursor: crosshair; }
.gantt-bar:hover .gantt-dot, .gantt-milestone:hover .gantt-dot { opacity: 1; }
.gantt-milestone { position: absolute; z-index: 2; width: 14px; height: 14px; margin: -7px 0 0 -7px; transform: rotate(45deg); background: var(--upd8-todo); border: 1px solid var(--text); cursor: pointer; touch-action: none; }
.gantt-milestone.doing { background: var(--upd8-doing); }
.gantt-milestone.done { background: var(--upd8-done); }
.gantt-milestone.overdue { background: var(--upd8-late); }
.gantt-milestone .gantt-dot { transform: rotate(-45deg); right: -16px; top: 2px; }
.gantt-links { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.gantt-link { fill: none; stroke: var(--muted); stroke-width: 1.5; pointer-events: stroke; cursor: pointer; }
.gantt-link:hover { stroke: var(--danger); }
.gantt-arrowhead { fill: var(--muted); }
.gantt-chaining { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; }

/* boards */
.upd8-board-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.upd8-board { display: grid; grid-template-columns: repeat(var(--cols), minmax(240px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; position: relative; }
.upd8-board-empty { grid-column: 1 / -1; text-align: center; }
.upd8-lane { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 8px; min-height: 160px; }
.upd8-lane.over { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.upd8-lane header { display: flex; justify-content: space-between; font-weight: 700; padding: 2px 4px 8px; }
.upd8-cards { display: grid; gap: 8px; }
.upd8-card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--upd8-todo); border-radius: var(--radius-sm); padding: 8px 10px; cursor: grab; }
.upd8-card.doing { border-left-color: var(--upd8-doing); }
.upd8-card.done { border-left-color: var(--upd8-done); opacity: .85; }
.upd8-card.overdue { border-left-color: var(--upd8-late); }
.upd8-card.dragging { opacity: .4; }
.upd8-card-project { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upd8-card-title { display: block; margin: 3px 0 6px; font-weight: 650; color: var(--text); }
.upd8-card-facts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.upd8-card-who { font-size: 11px; margin-top: 4px; }
.upd8-card-moves { display: flex; justify-content: flex-end; gap: 2px; margin-top: 2px; }
.upd8-card-moves .icon-btn { width: 26px; height: 22px; font-size: 13px; }

@media (max-width: 720px) {
  .upd8-status-row { grid-template-columns: 1fr 120px auto auto; }
}

/* repeating tasks and templates */
.upd8-series-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.upd8-series-list li { padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; }
.upd8-series-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; padding: 6px 10px; border-radius: 8px; background: var(--panel-2); }
.upd8-scroll { overflow-x: auto; }
.upd8-template-items td { vertical-align: middle; }
.upd8-template-items input:not([type=number]) { min-width: 160px; width: 100%; }
.upd8-template-items .nowrap { white-space: nowrap; }
.upd8-danger .grow { flex: 1; }

/* working on a task: sign-off, files and links, notes, messages */
.upd8-deliverables > li { display: grid; gap: 2px; align-items: stretch; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.upd8-deliverable { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upd8-deliverable .grow, .upd8-message-head .grow, .upd8-message-form .grow { flex: 1; }
.upd8-deliverable-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.upd8-approval { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-left: 26px; }
.upd8-said { flex-basis: 100%; font-size: 13px; white-space: pre-wrap; }
.upd8-quote { margin: 0 0 10px; padding: 6px 10px; border-left: 3px solid var(--line); color: var(--muted); white-space: pre-wrap; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.upd8-files { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 3px; }
.upd8-files li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.upd8-files.compact { padding-left: 26px; margin: 0; font-size: 13px; }
.upd8-deliverables .upd8-attach { padding-left: 26px; margin: 2px 0 0; }
.upd8-attach .btn { min-height: 28px; }
.upd8-notes textarea { width: 100%; }
.upd8-check { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; }
.upd8-messages { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.upd8-messages li { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--line-soft); }
.upd8-messages li.mine { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.upd8-messages li.muted { background: none; padding: 0; }
.upd8-message-head { display: flex; align-items: baseline; gap: 6px; }
.upd8-message-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.upd8-message-text textarea, .upd8-message-form textarea { width: 100%; }
.upd8-awaiting { margin: 0 0 16px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: var(--radius); background: var(--panel); }
.upd8-awaiting h2 { margin: 0 0 6px; font-size: 15px; }
.upd8-awaiting ul { margin: 0; padding-left: 18px; }

/* deadlines */
.upd8-late { color: var(--upd8-late); font-weight: 600; }
.gantt-deadline { position: absolute; z-index: 3; width: 0; height: 18px; border-left: 2px solid var(--upd8-late); pointer-events: none; }
.gantt-deadline::after { content: ''; position: absolute; top: 0; left: 0; border: 5px solid transparent; border-left: 7px solid var(--upd8-late); }
.gantt-deadline:not(.overdue) { border-color: var(--warn); }
.gantt-deadline:not(.overdue)::after { border-left-color: var(--warn); }

/* the calendar */
.upd8-cal-tools h2 { margin: 0; font-size: 17px; }
.upd8-cal-tools input[type=date] { width: auto; }
.upd8-cal { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.upd8-cal-row { display: grid; grid-template-columns: 64px repeat(var(--cal-days), minmax(0, 1fr)); }
.upd8-cal-heads { border-bottom: 1px solid var(--line); }
.upd8-cal-head { padding: 8px; font-weight: 700; text-align: center; border-left: 1px solid var(--line-soft); }
.upd8-cal-head.today { color: var(--accent-text); }
.upd8-cal-gutter { padding: 8px 6px; font-size: 12px; text-align: right; }
.upd8-cal-allday { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 3%, transparent); }
.upd8-cal-cell { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; padding: 6px; min-height: 40px; border-left: 1px solid var(--line-soft); }
.upd8-cal-day .upd8-cal-cell { flex-direction: row; }
.upd8-cal-week .upd8-cal-cell { flex-direction: column; flex-wrap: nowrap; }
.upd8-chip-work, .upd8-chip-due { display: inline-flex; flex-direction: column; max-width: 100%; padding: 4px 8px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.3; color: var(--text); background: var(--accent-soft); border-left: 3px solid var(--upd8-doing); }
.upd8-chip-work.todo { border-left-color: var(--upd8-todo); }
.upd8-chip-work.done { border-left-color: var(--upd8-done); opacity: .7; }
.upd8-chip-work:hover, .upd8-chip-due:hover { text-decoration: none; filter: brightness(1.05); }
.upd8-chip-title, .upd8-chip-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upd8-chip-sub { color: var(--muted); font-size: 11.5px; }
.upd8-chip-due { flex-direction: row; border-left-color: var(--upd8-late); background: color-mix(in srgb, var(--upd8-late) 12%, transparent); font-weight: 600; }
.upd8-chip-due.done { text-decoration: line-through; opacity: .6; }
.upd8-cal-scroll { overflow: auto; max-height: calc(100vh - 290px); min-height: 320px; }
.upd8-cal-body { position: relative; }
.upd8-cal-hours { position: relative; }
.upd8-cal-hour { height: 48px; position: relative; }
.upd8-cal-hour span { position: absolute; top: -8px; right: 8px; font-size: 11.5px; color: var(--muted); }
.upd8-cal-hour:first-child span { display: none; }
.upd8-cal-col { position: relative; border-left: 1px solid var(--line-soft); }
.upd8-cal-col.today { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.upd8-cal-slot { position: absolute; left: 0; right: 0; height: 48px; border-top: 1px solid var(--line-soft); pointer-events: none; }
.upd8-meeting { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden; padding: 3px 7px; border: 0; border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 22%, var(--bg)); color: var(--text); font: inherit; font-size: 12.5px; line-height: 1.25; text-align: left; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.upd8-meeting:hover { filter: brightness(1.05); }
.upd8-meeting-title { font-weight: 700; }
.upd8-meeting-when, .upd8-meeting-where { color: var(--muted); font-size: 11.5px; }
.upd8-meeting.unanswered { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--bg)) 0 6px, color-mix(in srgb, var(--accent) 22%, var(--bg)) 6px 12px); }
.upd8-meeting.declined, .upd8-meeting.cancelled { opacity: .55; }
.upd8-meeting.cancelled .upd8-meeting-title { text-decoration: line-through; }
.upd8-due { position: absolute; z-index: 3; left: 0; right: 0; height: 0; border-top: 2px dashed var(--upd8-late); }
.upd8-due span { position: absolute; top: -10px; right: 4px; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; border-radius: 9px; background: var(--upd8-late); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.upd8-due.done { border-top-color: var(--upd8-done); }
.upd8-due.done span { background: var(--upd8-done); }
.upd8-due:hover { text-decoration: none; }
.upd8-now { position: absolute; z-index: 4; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); pointer-events: none; }
.upd8-now::before { content: ''; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.upd8-meeting-view p { margin: 0 0 8px; }
.upd8-meeting-time { font-weight: 700; font-size: 15px; }
.upd8-attendees { list-style: none; padding: 0; margin: 0 0 12px; }
.upd8-attendees li { padding: 3px 0; }
.upd8-response.accepted { color: var(--ok); }
.upd8-response.declined { color: var(--danger); }
.upd8-response.tentative { color: var(--warn); }
.upd8-response.none { color: var(--muted); }
.upd8-pre { white-space: pre-wrap; }
.upd8-inline { display: flex; gap: 8px; align-items: center; }
.upd8-inline input { flex: 1; min-width: 0; }
.upd8-howto { padding-left: 18px; }
.upd8-howto li { margin-bottom: 6px; }

/* chat */
.upd8-chat { display: grid; grid-template-columns: 260px minmax(0, 1fr); padding: 0; overflow: hidden; height: calc(100vh - 150px); min-height: 420px; }
.upd8-chat-list { overflow: auto; padding: 12px; border-right: 1px solid var(--line); }
.upd8-chat-new { width: 100%; margin-bottom: 10px; }
.upd8-chat-section h3 { margin: 12px 4px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.upd8-chat-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--text); }
.upd8-chat-item:hover { background: var(--accent-soft); text-decoration: none; }
.upd8-chat-item.active { background: var(--accent-soft); font-weight: 700; }
.upd8-chat-item.unread .upd8-chat-name { font-weight: 800; }
.upd8-chat-mark { width: 14px; text-align: center; color: var(--muted); }
.upd8-chat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upd8-chat-item .badge { position: static; }
.upd8-chat-pane { display: flex; flex-direction: column; min-height: 0; }
.upd8-chat-empty { margin: auto; padding: 24px; text-align: center; }
.upd8-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.upd8-chat-head h2 { flex: 1; margin: 0; font-size: 17px; }
.upd8-chat-scroll { flex: 1; overflow: auto; padding: 12px 16px; }
.upd8-chat-earlier { display: block; margin: 0 auto 10px; }
.upd8-chat-day { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.upd8-chat-day::before, .upd8-chat-day::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.upd8-msg { padding: 6px 10px; border-radius: var(--radius-sm); }
.upd8-msg:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.upd8-msg-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.upd8-msg-author { font-weight: 700; font-size: 14px; }
.upd8-msg.mine .upd8-msg-author { color: var(--accent-text); }
.upd8-msg-tools { margin-left: auto; display: none; gap: 10px; }
.upd8-msg:hover .upd8-msg-tools, .upd8-msg:focus-within .upd8-msg-tools { display: inline-flex; }
.upd8-msg-text { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.upd8-msg.deleted p { font-style: italic; }
.upd8-mention { color: var(--accent-text); font-weight: 700; }
.upd8-chat-edit { padding: 6px 10px; }
.upd8-chat-write { display: flex; gap: 8px; align-items: flex-end; padding: 10px 16px; border-top: 1px solid var(--line); }
.upd8-chat-write textarea { flex: 1; resize: vertical; min-height: 42px; max-height: 40vh; }
@media (max-width: 760px) {
  .upd8-chat { grid-template-columns: 1fr; height: auto; }
  .upd8-chat-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
  .upd8-chat-pane { height: 70vh; }
  .upd8-cal-row { grid-template-columns: 44px repeat(var(--cal-days), minmax(0, 1fr)); }
}

/* calls */
.upd8-call-icon { width: 18px; height: 18px; flex: none; }
.upd8-chat-calltools { display: inline-flex; gap: 6px; }
.upd8-chat-calltools .btn { display: inline-flex; align-items: center; gap: 6px; }
.upd8-meeting-call .btn { display: inline-flex; align-items: center; gap: 6px; }
.upd8-call-line { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ok) 14%, transparent); font-weight: 600; }
.upd8-call { position: fixed; inset: 12px; z-index: 7000; display: flex; flex-direction: column; border-radius: var(--radius); background: #0d1117; color: #f4f3f0; box-shadow: 0 20px 60px rgba(0,0,0,.5); overflow: hidden; }
.upd8-call-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.upd8-call-head .muted, .upd8-call .muted { color: #a1a3a4; }
.upd8-call-grid { flex: 1; min-height: 0; display: grid; gap: 8px; padding: 0 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.upd8-call-grid[data-count="1"] { grid-template-columns: 1fr; }
.upd8-call-grid[data-count="2"] { grid-template-columns: 1fr 1fr; }
.upd8-call-grid.with-screen { grid-template-columns: 3fr 1fr; grid-auto-flow: dense; }
.upd8-call-grid.with-screen .upd8-call-tile.screen { grid-row: span 3; }
.upd8-call-tile { position: relative; min-height: 120px; border-radius: 10px; overflow: hidden; background: #1b222c; display: grid; place-items: center; outline: 3px solid transparent; transition: outline-color .15s; }
.upd8-call-tile.speaking { outline-color: var(--ok); }
.upd8-call-tile video { width: 100%; height: 100%; object-fit: cover; }
.upd8-call-tile.screen video { object-fit: contain; background: #000; }
.upd8-call-tile.me:not(.screen) video { transform: scaleX(-1); }
.upd8-call-face { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 800; background: var(--accent); color: #fff; }
.upd8-call-name { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 16px); padding: 3px 9px; border-radius: 12px; background: rgba(0,0,0,.55); font-size: 13px; }
.upd8-call-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upd8-call-name .upd8-call-icon { width: 14px; height: 14px; color: var(--danger); }
.upd8-call-bar { display: flex; justify-content: center; gap: 12px; padding: 12px; }
.upd8-call-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: #2a3340; color: #fff; cursor: pointer; }
.upd8-call-btn:hover { filter: brightness(1.25); }
.upd8-call-btn.off { background: #5a2a2a; }
.upd8-call-btn.on { background: var(--accent); }
.upd8-call-btn.danger { background: #d83b3b; }
.upd8-call-btn.small { width: 34px; height: 34px; }
.upd8-call-head .upd8-call-btn { width: 36px; height: 36px; }
.upd8-call-devices { position: absolute; right: 20px; bottom: 80px; display: grid; gap: 10px; min-width: 300px; }
.upd8-call-devices label { display: grid; gap: 4px; }
.upd8-call-pill { position: fixed; right: 16px; bottom: 16px; z-index: 7000; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 28px; background: #0d1117; color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.upd8-call-pill-count { min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--ok); color: #000; font-weight: 800; text-align: center; }
.upd8-ring { position: fixed; right: 16px; top: 16px; z-index: 7100; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: min(460px, calc(100vw - 32px)); padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); animation: upd8-ring 1s ease-in-out infinite alternate; }
.upd8-ring > .upd8-call-icon { width: 28px; height: 28px; color: var(--ok); }
.upd8-ring-text { display: grid; flex: 1; min-width: 140px; }
.upd8-ring-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
@keyframes upd8-ring { from { box-shadow: var(--shadow); } to { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 50%, transparent), var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .upd8-ring { animation: none; } }
@media (max-width: 760px) { .upd8-call { inset: 0; border-radius: 0; } .upd8-call-grid { grid-template-columns: 1fr; } .upd8-call-grid.with-screen { grid-template-columns: 1fr; } }

/* a presentation (present.ts): the stage, a strip of cameras, and the side with chat, questions and hands */
.upd8-present-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; padding: 0 12px; }
.upd8-present-main { position: relative; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.upd8-present-stage { flex: 1; min-height: 0; display: grid; }
.upd8-present-stage .upd8-call-tile { min-height: 0; }
.upd8-present-stage .upd8-call-tile video { object-fit: contain; background: #000; }
.upd8-present-wait { display: grid; place-items: center; border-radius: 10px; background: #1b222c; color: #a1a3a4; font-size: 18px; text-align: center; padding: 20px; }
.upd8-present-strip { display: flex; gap: 8px; height: 120px; overflow-x: auto; }
.upd8-present-strip .upd8-call-tile { flex: 0 0 180px; min-height: 0; }
.upd8-present-strip .upd8-call-face { width: 56px; height: 56px; font-size: 20px; }
.upd8-present-reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.upd8-present-float { position: absolute; bottom: 10px; font-size: 32px; animation: upd8-float 3s ease-out forwards; }
@keyframes upd8-float { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-60vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .upd8-present-float { animation-duration: 1.5s; } }
.upd8-present-side { min-height: 0; display: flex; flex-direction: column; border-radius: 10px; background: #161c24; overflow: hidden; }
.upd8-present-tabs { display: flex; border-bottom: 1px solid #2a3340; }
.upd8-present-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; border: 0; background: none; color: #a1a3a4; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.upd8-present-tab.on { color: #fff; border-bottom-color: var(--accent); }
.upd8-present-badge:not(:empty) { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; }
.upd8-present-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.upd8-present-pane[hidden] { display: none; }
.upd8-present-lines { flex: 1; min-height: 0; margin: 0; padding: 10px 12px; list-style: none; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere; }
.upd8-present-line strong { color: #c9d1d9; }
.upd8-present-line strong.role-presenter { color: var(--accent); }
.upd8-present-q { padding: 8px 10px; border-radius: 8px; background: #1f2731; }
.upd8-present-q.answered { opacity: .6; }
.upd8-present-q-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.upd8-present-hand { display: flex; align-items: center; gap: 8px; }
.upd8-present-send { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #2a3340; }
.upd8-present-send input { flex: 1; min-width: 0; }
.upd8-present-react { display: flex; gap: 2px; align-items: center; padding: 0 6px; border-radius: 24px; background: #2a3340; }
.upd8-present-emoji { border: 0; background: none; font-size: 22px; padding: 6px; cursor: pointer; border-radius: 50%; }
.upd8-present-emoji:hover { background: #3a4554; }
.upd8-call-status.live { color: #fff; background: #d83b3b; padding: 1px 8px; border-radius: 10px; font-weight: 700; }
.upd8-guest-link .upd8-inline input { flex: 1; min-width: 0; }
@media (max-width: 900px) {
  .upd8-present-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 40%; }
  .upd8-present-react { display: none; }
}

/* the guest page (watch.ts) */
.upd8-watch { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.upd8-watch-card { width: min(520px, 100%); padding: 28px; border-radius: var(--radius); background: var(--panel); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.upd8-watch-card h1 { margin: 0; font-size: 26px; }
.upd8-watch-brand { font-weight: 900; letter-spacing: .08em; color: var(--accent); }
.upd8-watch-when { font-weight: 600; }
.upd8-watch-card label { display: grid; gap: 6px; }
.upd8-watch-note { padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
