﻿:root {
  --bg: #e9eef0;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #17211e;
  --muted: #697770;
  --line: #dce4e0;
  --green: #176b52;
  --green-strong: #10513e;
  --green-soft: #e5f3ed;
  --blue: #315f9f;
  --blue-soft: #eaf0f9;
  --amber: #9b6507;
  --amber-soft: #fff2d8;
  --red: #b42318;
  --red-soft: #fde7e4;
  --sidebar: #ffffff;
  --tenant-accent: #176b52;
  --shadow: 0 3px 12px rgba(25, 38, 33, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Chats 2.0: shared web/mobile collaboration surface. */
.chat-sidebar {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.chat-create-button {
  flex: 0 0 auto;
}

.chat-search {
  display: block;
}

.chat-search > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.chat-search input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.chat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow-x: visible;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.chat-filters button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.chat-filters button.active {
  border-color: #8dbca8;
  background: var(--green-soft);
  color: var(--green);
}

.chat-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  min-height: 62px;
}

#chat-list {
  align-content: start;
}

.chat-row-copy {
  min-width: 0;
}

.chat-row-copy > span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-row-copy strong,
.chat-row-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row-copy strong {
  min-width: 0;
}

.chat-row > time {
  align-self: start;
  padding-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.chat-unread {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 10px;
}

.avatar.group {
  background: #f4e5bb;
  color: #76520c;
}

.avatar.project,
.avatar.task {
  background: #e5eef9;
  color: #315f9f;
}

.chat-list-empty,
.chat-conversation-empty {
  display: grid;
  place-content: center;
  min-height: 160px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.chat-list-empty p,
.chat-conversation-empty p {
  margin: 6px 0 0;
  font-size: 12px;
}

#chat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
}

.chat-head-copy {
  min-width: 0;
}

.chat-head-copy h2,
.chat-head-copy p,
.chat-head-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-head-copy small {
  color: var(--muted);
}

.chat-info-button,
.chat-mobile-back {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
}

.chat-mobile-back {
  display: none;
  font-size: 18px;
}

.message.own {
  margin-left: auto;
  border-color: #b8d8ca;
  background: #f0f8f4;
}

.chat-create-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(820px, calc(100dvh - 28px));
  overflow-y: auto;
}

.chat-type-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
}

.chat-type-picker legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-type-picker label,
.chat-history-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.chat-type-picker label:has(input:checked),
.chat-history-option:has(input:checked) {
  border-color: #7eaf9b;
  background: #f0f8f4;
}

.chat-type-picker input,
.chat-history-option input,
.chat-member-options input,
.chat-department-options input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}

.chat-type-picker span,
.chat-history-option span,
.chat-member-options span,
.chat-department-options span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chat-type-picker small,
.chat-history-option small,
.chat-member-options small,
.chat-department-options small {
  color: var(--muted);
  font-size: 11px;
}

.chat-create-fields {
  display: grid;
  gap: 12px;
}

.chat-create-fields > label:not(.chat-history-option) {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-member-picker {
  display: grid;
  gap: 7px;
}

.chat-member-picker > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.chat-member-picker > div:first-child small {
  color: var(--muted);
  font-size: 11px;
}

.chat-member-options,
.chat-department-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
  max-height: 210px;
  overflow-y: auto;
  border-block: 1px solid var(--line);
}

.chat-member-options label,
.chat-department-options label {
  display: grid;
  grid-template-columns: 18px 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.chat-department-options label {
  grid-template-columns: 18px minmax(0, 1fr);
}

.chat-details-members {
  display: grid;
  max-height: 360px;
  overflow-y: auto;
  border-block: 1px solid var(--line);
}

.chat-details-members > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
}

.chat-details-members > div:last-child {
  border-bottom: 0;
}

.chat-details-members span {
  display: grid;
  gap: 2px;
}

.chat-details-members small {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 760px) {
  .chat-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  #chats-view.active {
    margin: -4px -8px 0;
  }

  .chat-layout {
    display: block;
  }

  .chat-sidebar,
  .chat-box {
    width: 100%;
    max-height: none;
    border-radius: 0;
  }

  .chat-sidebar {
    min-height: calc(100dvh - 112px);
  }

  .chat-box {
    display: none;
    height: calc(100dvh - 100px);
    min-height: 520px;
  }

  #chats-view.chat-mobile-open .chat-sidebar {
    display: none;
  }

  #chats-view.chat-mobile-open .chat-box {
    display: grid;
  }

  #chat-head {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
  }

  .chat-mobile-back {
    display: inline-grid;
  }

  .chat-row {
    min-height: 66px;
  }

  .message,
  .comment {
    width: min(94%, 680px);
  }

  #chat-form {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .chat-type-picker,
  .chat-member-options,
  .chat-department-options {
    grid-template-columns: 1fr;
  }

  .chat-member-picker > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .chat-create-dialog {
    padding: 16px;
  }
}

/* WORKZON Coach and Project Agent integration controls */
.coach-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 26px 28px;
  border: 1px solid #cfd8d3;
  border-left: 5px solid #176b52;
  background: #f8fbf9;
}

.coach-hero h2 {
  margin: 3px 0 7px;
  font-size: 26px;
}

.coach-hero > div > p:last-child {
  max-width: 720px;
  margin: 0;
  color: #52605a;
  font-size: 15px;
  line-height: 1.55;
}

.coach-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.coach-progress-ring {
  display: grid;
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#176b52 calc(var(--coach-progress) * 1%), #dfe7e3 0);
  position: relative;
}

.coach-progress-ring::after {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.coach-progress-ring strong {
  z-index: 1;
  font-size: 17px;
}

.coach-progress > span,
.coach-progress > span strong,
.coach-progress > span small {
  display: block;
}

.coach-progress > span small {
  margin-top: 3px;
  color: #6a756f;
}

.coach-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 18px;
}

#coach-steps {
  display: grid;
  gap: 8px;
}

.coach-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #dde4e0;
  border-radius: 6px;
  background: #fff;
}

.coach-step.suggested {
  border-color: #78a995;
  box-shadow: inset 4px 0 #176b52;
}

.coach-step.completed {
  background: #f7faf8;
}

.coach-step-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #bdcac3;
  border-radius: 50%;
  color: #315c4e;
  font-weight: 800;
}

.coach-step.completed .coach-step-number {
  border-color: #68a78e;
  background: #e4f2eb;
}

.coach-step strong,
.coach-step p {
  display: block;
}

.coach-step p {
  margin: 4px 0 0;
  color: #66716c;
  font-size: 14px;
  line-height: 1.4;
}

.coach-question-card form {
  display: grid;
  gap: 10px;
}

.coach-question-card textarea {
  width: 100%;
  min-height: 128px;
  resize: vertical;
}

#coach-answer {
  margin-top: 16px;
}

.coach-answer {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid #cbd9d2;
  border-radius: 6px;
  background: #f4f8f6;
}

.coach-answer > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #173f33;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.coach-answer p {
  margin: 6px 0 8px;
  color: #44524c;
  line-height: 1.55;
  white-space: pre-wrap;
}

.coach-answer-empty {
  padding: 13px;
  border: 1px dashed #cbd5d0;
  color: #64706a;
  font-size: 14px;
}

.coach-guide {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: min(410px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid #91aa9e;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgb(28 44 37 / 20%);
}

.coach-guide h2 {
  margin: 4px 32px 8px 0;
  font-size: 20px;
}

.coach-guide > p:not(.eyebrow) {
  margin: 0;
  color: #4e5b55;
  font-size: 15px;
  line-height: 1.55;
}

.coach-guide-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.coach-highlight {
  position: relative;
  z-index: 45;
  outline: 4px solid rgb(23 107 82 / 24%);
  outline-offset: 4px;
  box-shadow: 0 0 0 9999px rgb(24 36 31 / 18%);
}

.agent-integration-settings.span-all {
  grid-column: 1 / -1;
}

.integration-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(240px, 1fr) minmax(360px, 1.5fr) auto;
  align-items: end;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid #d8e0dc;
  border-radius: 6px;
  background: #f8faf9;
}

.integration-create-form > label,
.integration-create-form fieldset {
  min-width: 0;
}

.integration-create-form.project-read-account-form {
  grid-template-columns: minmax(0, 320px) minmax(0, max-content);
  padding: 0;
  border: 0;
  background: transparent;
}

.project-read-account-form .integration-records {
  grid-column: 1 / -1;
}

.project-read-account-form > label {
  display: grid;
  gap: 6px;
  color: #45514b;
  font-size: 13px;
  font-weight: 700;
}

.project-read-account-form input:not([type="hidden"]) {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #ccd7d1;
  border-radius: 6px;
  background: #fff;
  color: #24352d;
  font: inherit;
}

@media (max-width: 700px) {
  .integration-create-form.project-read-account-form { grid-template-columns: minmax(0, 1fr); }
}

.integration-create-form label > small {
  display: block;
  margin-top: 4px;
  color: #738079;
}

.integration-create-form select[multiple] {
  min-height: 96px;
}

.integration-create-form.hermes-connection-form {
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr) auto;
}

.hermes-connection-form > label {
  display: grid;
  align-self: stretch;
  gap: 6px;
  color: #45514b;
  font-size: 13px;
  font-weight: 700;
}

.hermes-connection-form > label input {
  width: 100%;
  min-width: 0;
}

.hermes-connection-form > button {
  min-height: 42px;
}

.integration-form-feedback {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 11px;
  border-radius: 5px;
  background: #edf4f1;
  color: #345247;
  font-size: 13px;
  font-weight: 700;
}

.integration-form-feedback[data-tone="error"] {
  background: #fff0ed;
  color: #9b332b;
}

.integration-form-feedback[data-tone="progress"] {
  background: #edf3fb;
  color: #315f9f;
}

.hermes-connection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 12px;
  border: 1px solid #dde4e0;
  border-radius: 6px;
}

.hermes-connection-summary strong,
.hermes-connection-summary small {
  display: block;
}

.hermes-connection-summary small {
  margin-top: 3px;
  color: #6a756f;
  line-height: 1.4;
}

.agent-pairing {
  border-top: 3px solid #2c7a5b;
}

.agent-pairing-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.agent-pairing-step {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #d8e0dc;
  border-radius: 6px;
  background: #f8faf9;
  color: #59655f;
}

.agent-pairing-step span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 50%;
  background: #e5eae7;
  color: #46534c;
  font-weight: 800;
}

.agent-pairing-step strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.agent-pairing-step.complete {
  border-color: #b9d8c9;
  background: #eef8f2;
  color: #1f5f45;
}

.agent-pairing-step.complete span {
  background: #25825e;
  color: #fff;
}

.integration-pairing-note {
  margin: 0;
  color: #6b7771;
}

.integration-pairing-note.success {
  color: #1f704f;
  font-weight: 700;
}

.integration-pairing-note.error {
  color: #a22c24;
  font-weight: 700;
}

.integration-scope-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #cfd8d3;
  border-radius: 5px;
}

.integration-scope-list legend {
  padding: 0 5px;
  color: #53615b;
  font-size: 12px;
  font-weight: 700;
}

.integration-scope-list label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: #3e4a45;
  font-size: 13px;
  line-height: 1.35;
}

.integration-scope-list input {
  margin-top: 2px;
}

.integration-records {
  display: grid;
  gap: 8px;
}

.integration-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #dde4e0;
  border-radius: 6px;
}

.integration-record.disabled {
  opacity: 0.68;
}

.integration-record > div,
.integration-record > div strong,
.integration-record > div small {
  display: block;
  min-width: 0;
}

.integration-record > div small {
  overflow: hidden;
  margin-top: 3px;
  color: #6a756f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-state {
  color: #3b5a4e;
  font-size: 13px;
  font-weight: 700;
}

.text-button.danger {
  color: #a2322a;
}

.webhook-delivery-log {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e0e6e3;
}

.webhook-delivery-log h4 {
  margin: 0 0 9px;
}

.webhook-delivery-log > div {
  display: grid;
  grid-template-columns: 10px minmax(120px, 0.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-top: 1px solid #edf0ee;
  font-size: 13px;
}

.delivery-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a8b0ac;
}

.delivery-status.delivered {
  background: #25825e;
}

.delivery-status.failed,
.delivery-status.retrying {
  background: #bd5a25;
}

.integration-secret-card code {
  display: block;
  overflow-wrap: anywhere;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #cbd5d0;
  border-radius: 5px;
  background: #f1f4f2;
  color: #1e342b;
  font-size: 13px;
  line-height: 1.5;
  user-select: all;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .coach-layout {
    grid-template-columns: 1fr;
  }

  .integration-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .integration-create-form.hermes-connection-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .integration-create-form.hermes-connection-form button {
    justify-self: start;
  }

  .integration-create-form .integration-scope-list {
    grid-column: 1 / -1;
  }

  .agent-pairing-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .coach-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 19px;
  }

  .coach-hero h2 {
    font-size: 22px;
  }

  .coach-step {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .coach-step button {
    grid-column: 2;
    justify-self: start;
  }

  .coach-guide {
    right: 16px;
    bottom: 16px;
  }

  .integration-create-form,
  .integration-record {
    grid-template-columns: 1fr;
  }

  .integration-create-form.hermes-connection-form {
    grid-template-columns: 1fr;
  }

  .agent-pairing-steps {
    grid-template-columns: 1fr;
  }

  .hermes-connection-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .integration-scope-list {
    grid-template-columns: 1fr;
  }

  .integration-record > div small {
    white-space: normal;
  }

  .webhook-delivery-log > div {
    grid-template-columns: 10px 1fr;
  }

  .webhook-delivery-log > div small {
    grid-column: 2;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(49, 95, 159, 0.24);
  outline-offset: 2px;
}

#password-button.attention,
.top-profile-button.attention {
  border-color: #d49a38;
  background: var(--amber-soft);
  color: var(--amber);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0;
}

p {
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #e8eeeb;
}

.auth-panel {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid #c8d4ce;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(18, 35, 29, 0.14);
}

.auth-brand {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.auth-brand small,
.auth-panel p {
  color: var(--muted);
}

.auth-panel h1 {
  font-size: 25px;
}

.auth-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-panel input {
  height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

#login-message {
  min-height: 18px;
  color: var(--red);
  font-size: 12px;
}

.auth-link {
  min-height: 32px;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 800;
  text-align: center;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.auth-legal a {
  color: var(--muted);
}

.auth-legal a:hover {
  color: var(--green);
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.auth-separator::before,
.auth-separator::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.google-auth-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #c8d1cd;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.google-auth-button:hover {
  border-color: #8fa59a;
  background: #f8faf9;
}

.google-auth-button > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #4285f4;
  color: #fff;
  font-weight: 900;
}

.invitation-auth-panel {
  width: min(480px, 100%);
}

.invitation-auth-panel input[readonly] {
  background: var(--surface-soft);
}

.auth-message {
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-message.error,
#login-message.error {
  color: var(--red);
}

.auth-message.success,
#login-message.success {
  color: var(--green);
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 12px 14px;
  background: var(--sidebar);
  color: #f5faf7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #2bb584;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.brand strong,
.brand small,
#sidebar-user strong,
#sidebar-user small {
  display: block;
}

.brand strong {
  font-size: 14px;
}

.brand small,
#sidebar-user small {
  margin-top: 2px;
  color: #9fb1aa;
  font-size: 12px;
}

#nav {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 18px;
  margin-top: 26px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-color: #b8c7c0 transparent;
  scrollbar-width: thin;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group > p {
  margin: 0 0 4px;
  padding: 0 10px;
  color: #82968e;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-btn {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 39px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #c8d5d0;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.nav-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #52665f;
}

.nav-btn[data-view="inbox"] {
  position: relative;
  padding-right: 38px;
}

.nav-unread-badge {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.nav-unread-badge[hidden] { display: none; }

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-btn.active {
  background: #fff;
  color: var(--sidebar);
}

.nav-btn.active .nav-indicator {
  background: #26a77a;
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

#sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar-user strong {
  font-size: 12px;
}

.connector-state {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  color: #9fb1aa;
  font-size: 12px;
  line-height: 1.4;
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.avatar.small {
  width: 27px;
  height: 27px;
  font-size: 12px;
}

.avatar.tiny {
  width: 20px;
  height: 20px;
  font-size: 8px;
}

.avatar.large {
  width: 44px;
  height: 44px;
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 22px 24px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  margin-bottom: 22px;
}

.page-heading p,
.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar-actions,
.toolbar,
.day-intro-actions,
.integration-actions,
.dialog-actions,
.action-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.global-search {
  position: relative;
  width: min(280px, 24vw);
}

.global-search label {
  display: block;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 90;
  width: min(520px, calc(100vw - 28px));
  max-height: min(68vh, 620px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(23, 33, 30, 0.18);
}

.global-search-results section + section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.global-search-results h3 {
  margin: 0 8px 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.global-search-results button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.global-search-results button:hover,
.global-search-results button:focus-visible {
  background: var(--green-soft);
}

.global-search-results button strong {
  font-size: 13px;
}

.global-search-results button small,
.search-empty {
  color: var(--muted);
  font-size: 12px;
}

.search-empty {
  padding: 18px 10px;
  text-align: center;
}

.global-search input,
.quick-form input,
.quick-form select,
.dialog-card input,
.dialog-card select,
.dialog-card textarea,
.inline-add input,
.comment-form textarea,
.description-form textarea,
.task-detail-controls input,
.task-detail-controls select,
#chat-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.global-search input {
  height: 40px;
  padding: 0 12px;
}

.primary,
.ghost,
.chip,
.segmented button,
.text-button,
.agent-link,
.timer,
.drawer-close {
  border-radius: 7px;
  font-weight: 800;
}

.primary,
.ghost,
.chip,
.timer {
  min-height: 40px;
  padding: 0 12px;
}

.primary {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}

.primary:hover {
  border-color: var(--green-strong);
  background: var(--green-strong);
}

.primary.danger {
  border-color: var(--red);
  background: var(--red);
}

.primary.danger:hover {
  border-color: #8f1c14;
  background: #8f1c14;
}

.ghost,
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost:hover,
.chip:hover {
  border-color: #b9c9c1;
  background: var(--surface-soft);
}

.chip {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.chip.active {
  border-color: #a8d4c2;
  background: var(--green-soft);
  color: var(--green);
}

.role-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.role-switch select {
  max-width: 150px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.notification-button {
  white-space: nowrap;
}

#notification-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.surface {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.compact-surface {
  padding: 15px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head p,
.task-detail-head > p:last-child,
.project-detail-hero p,
.cycle-head p,
.settings-card p,
.settings-card small,
.role-row small,
.team-person small,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.section-gap {
  margin-top: 16px;
}

.day-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 108px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border-left: 4px solid var(--green);
  background: #fff;
}

.day-intro h2,
.management-banner h2 {
  margin-bottom: 5px;
  font-size: 24px;
}

.day-intro > div > p:last-child,
.management-banner > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 104px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-card span,
.metric-card small,
.task-facts span,
.project-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 25px;
  line-height: 1;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  align-items: start;
  gap: 14px;
}

.workspace-rail {
  display: grid;
  align-content: start;
  gap: 14px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-dot::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.day-plan,
#answer-list,
#risk-list,
#agent-brief,
#cycle-list,
#cycle-hints,
.selection-list,
.settings-list,
.compact-task-list,
.agent-command-list,
#agent-actions,
#notification-list {
  display: grid;
}

.focus-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 54px auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.focus-item:last-child {
  border-bottom: 0;
}

.day-following {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.day-following summary {
  padding: 14px 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  overflow-wrap: anywhere;
}

#day-following-count {
  margin-left: 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#day-following-list,
#answer-list {
  max-height: 24rem;
  overflow-y: auto;
}

#day-following-list .attention-item {
  grid-template-columns: minmax(0, 1fr);
}

#day-following-list strong,
#answer-list strong {
  overflow-wrap: anywhere;
}

.focus-number {
  color: #9ca9a3;
  font-size: 12px;
  font-weight: 900;
}

.focus-main strong,
.focus-main small {
  display: block;
}

.focus-main strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.focus-main small,
.attention-item small,
.task-card small,
.chat-row small,
.message small,
.comment small,
.compact-task-list small,
.agent-action small,
.agent-command small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.focus-time {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.attention-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.attention-item:last-child {
  border-bottom: 0;
}

.attention-item strong,
.attention-item small {
  display: block;
}

.attention-item strong {
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 1.4;
}

.attention-mark {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
}

.attention-mark.medium {
  background: var(--blue);
}

.attention-mark.high {
  background: var(--amber);
}

.attention-mark.critical {
  background: var(--red);
}

.agent-companion {
  padding: 16px;
  border: 1px solid #b9cce7;
  border-radius: 8px;
  background: var(--blue-soft);
}

.agent-companion > div:first-of-type {
  display: inline-block;
}

.agent-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.agent-companion h2 {
  font-size: 15px;
}

.agent-hint {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(49, 95, 159, 0.16);
  color: #334c70;
  font-size: 12px;
}

.agent-link,
.text-button {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
}

.agent-link {
  margin-top: 12px;
}

.text-button.danger {
  color: var(--red);
}

.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(6, minmax(88px, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8edeb;
}

.segmented button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(24, 40, 34, 0.12);
}

.task-people,
.task-days {
  min-width: 0;
}

.planning-agent-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #bfd8cc;
  border-radius: 7px;
  background: #f3faf7;
}

.planning-agent-summary.warning {
  border-color: #e3c37f;
  background: #fff9e9;
}

.planning-agent-summary strong,
.planning-agent-summary p {
  overflow-wrap: anywhere;
}

.planning-agent-summary p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.planning-total {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.people-board-scroll,
.days-board-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(292px, 324px);
  align-items: start;
  gap: 10px;
  max-width: 100%;
  padding: 1px 1px 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.people-lane,
.day-lane {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f4f7f5;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.people-lane.drag-over,
.day-lane.drag-over {
  border-color: var(--green);
  background: #edf8f3;
  box-shadow: inset 0 0 0 1px var(--green);
}

.people-lane.overloaded,
.day-lane.overdue {
  border-top-color: #c9664f;
}

.people-lane > header,
.day-lane > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 58px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.people-lane > header {
  border-radius: 7px 7px 0 0;
}

.people-lane-person {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.people-lane-person > span {
  display: grid;
  min-width: 0;
}

.people-lane-person strong,
.people-lane-person small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-lane-person small,
.day-lane > header small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.people-task-count,
.day-lane > header > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 5px;
  background: #e5ece9;
  color: #3d4c46;
  font-size: 12px;
  font-weight: 800;
}

.people-load {
  height: 5px;
  margin: 10px 10px 0;
  overflow: hidden;
  border-radius: 3px;
  background: #dfe7e3;
}

.people-load > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4a9b7b;
}

.people-lane.overloaded .people-load > span {
  background: #c95f4b;
}

.people-load-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  padding: 6px 10px 9px;
  color: var(--muted);
  font-size: 11px;
}

.people-load-meta strong {
  color: var(--ink);
}

.overdue-text {
  grid-column: 1 / -1;
  color: #a94f3e;
  font-weight: 700;
}

.people-projects,
.day-lane-tasks {
  display: grid;
  gap: 9px;
  padding: 9px;
}

.people-project-group {
  overflow: hidden;
  border: 1px solid #dce4e0;
  border-radius: 6px;
  background: #fff;
}

.people-project-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 33px;
  padding: 6px 8px;
  border-bottom: 1px solid #e6ece9;
  background: #f8faf9;
  color: #53615b;
  font-size: 11px;
}

.people-project-group > header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-task {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 25px;
  align-items: start;
  gap: 5px;
  min-height: 58px;
  padding: 7px 7px 7px 5px;
  border-bottom: 1px solid #e7ece9;
  background: #fff;
}

.planning-task:last-child {
  border-bottom: 0;
}

.planning-task:hover {
  background: #f6faf8;
}

.planning-task.selected {
  background: #eef7f3;
}

.planning-task.completed {
  opacity: 0.68;
}

.planning-task > button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.planning-task > button > strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.planning-task-select {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.planning-task-select input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.planning-task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.priority-score {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: #e5ece9;
  color: #43514b;
  font-size: 11px;
  font-weight: 900;
}

.priority-score.critical {
  background: #f24632;
  color: #fff;
}

.priority-score.high {
  background: #ec8d19;
  color: #fff;
}

.priority-score.medium {
  background: #d4b92b;
  color: #2c321c;
}

.priority-score.low {
  background: #83b93d;
  color: #fff;
}

.due-signal,
.blocked-mini {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 800;
}

.due-signal {
  background: #e7eef7;
  color: #315f9f;
}

.due-signal.overdue {
  background: #ffebe6;
  color: #a53f2f;
}

.due-signal.today {
  background: #fff1c9;
  color: #77530e;
}

.due-signal.done {
  background: #e5f4ed;
  color: #176b52;
}

.due-signal.muted {
  background: #edf0ef;
  color: #68746f;
}

.blocked-mini {
  background: #f2e8f8;
  color: #6d3e8e;
}

.planning-empty {
  display: grid;
  place-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px dashed #c9d4cf;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.day-lane > header > div {
  display: grid;
  min-width: 0;
}

.day-lane.overdue > header {
  background: #fff7f4;
}

.day-task-project {
  overflow: hidden;
  border: 1px solid #dce4e0;
  border-radius: 6px;
  background: #fff;
}

.day-task-project > small {
  display: block;
  overflow: hidden;
  padding: 5px 7px 0;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-task-project .planning-task {
  border-bottom: 0;
}

.quick-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 150px 150px auto;
  gap: 8px;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.quick-form input,
.quick-form select {
  height: 40px;
  padding: 0 10px;
}

#project-form {
  grid-template-columns: minmax(0, 1fr);
}

#project-form > * {
  min-width: 0;
}

.project-date-field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.flatpickr-wrapper { display: block; width: 100%; min-width: 0; }
.flatpickr-input[readonly] { cursor: pointer; }
.flatpickr-calendar { font-family: inherit; font-size: 14px; border-radius: 8px; text-transform: none; letter-spacing: 0; width: min(307.875px, calc(100vw - 100px)); }
.flatpickr-calendar.meeting-date-popover { position: fixed; inset: auto; margin: 0; width: 308px; overflow: auto; }
.flatpickr-calendar.meeting-date-popover::before,
.flatpickr-calendar.meeting-date-popover::after { display: none; }
.flatpickr-calendar.meeting-date-inline.open { position: relative; top: 6px; margin-bottom: 6px; }
@media (max-height: 480px) {
  .meeting-date-popover .flatpickr-day { height: 34px; line-height: 34px; }
}
.flatpickr-calendar .flatpickr-days, .flatpickr-calendar .dayContainer { width: 100%; min-width: 0; max-width: none; }
.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months {
  width: auto; height: 28px; min-height: 0; padding: 0 2px; border: 0; border-radius: 0;
  background: transparent; color: #182c28; font-size: 15px;
}
.flatpickr-calendar .flatpickr-current-month input.cur-year {
  height: 28px; min-height: 0; border: 0; padding: 0 0 0 4px; font-size: 15px;
  background: transparent; color: #182c28;
}
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus {
  background: #176b52; border-color: #176b52;
}
.project-calendar-actions { display: flex; justify-content: space-between; padding: 8px; gap: 8px; border-top: 1px solid var(--line); }
.project-calendar-actions button { font: inherit; font-size: 13px; padding: 6px 10px; color: #176b52; background: #fff; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }

.project-form-status {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.project-form-status:empty {
  display: none;
}

.project-form-status.error {
  color: var(--red);
}

.project-filter-bar {
  display: flex;
  gap: 7px;
  margin: 0 0 12px;
}

#project-edit-dialog {
  width: min(860px, calc(100vw - 28px));
}

.project-edit-dialog {
  width: 100%;
  max-height: min(90vh, 920px);
  overflow-y: auto;
  overflow-x: hidden;
}

.project-edit-grid textarea[name="stageNames"] {
  min-height: 132px;
}

#task-filters select {
  min-height: 40px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.task-kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(218px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-column {
  min-width: 218px;
  min-height: 480px;
  padding: 10px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--status-color, var(--line));
  border-radius: 8px;
  background: #f1f4f2;
}

.kanban-column.drag-over {
  border-color: #78b89d;
  background: var(--green-soft);
}

.kanban-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  margin-bottom: 8px;
}

.kanban-column h3 {
  margin: 0;
  color: #42504a;
  font-size: 12px;
  text-transform: uppercase;
}

.kanban-column > header span {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kanban-stack {
  display: grid;
  align-content: start;
  gap: 8px;
}

.kanban-final-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 12px;
}

.kanban-final-controls small {
  width: 100%;
  color: var(--muted);
  text-align: center;
}

.task-card-shell {
  position: relative;
  container-type: inline-size;
  min-width: 0;
  border-radius: 7px;
}

.task-card-shell.selected {
  outline: 2px solid #4f9b7d;
  outline-offset: 1px;
}

.task-card-shell.dragging {
  opacity: 0.45;
}

.task-card-select {
  position: absolute;
  top: 12px;
  left: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.task-card-shell:hover .task-card-select,
.task-card-shell.selected .task-card-select,
.task-card-select:focus-within {
  opacity: 1;
}

.task-card-select input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
}

.task-favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: #8b9791;
  font-size: 20px;
  line-height: 1;
}

.task-favorite:hover {
  border-color: #d9b854;
  color: #9b7200;
}

.task-favorite.active {
  color: #b58200;
}

.task-card {
  display: grid;
  min-width: 0;
  gap: 9px;
  width: 100%;
  min-height: 118px;
  padding: 11px;
  border: 1px solid #d6dfda;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.badge-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
}

.task-card:hover {
  border-color: #a8c7ba;
  box-shadow: 0 7px 18px rgba(24, 40, 34, 0.08);
}

.task-card > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
}

.task-tags,
.tag-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.task-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: #edf1ef;
  color: #53615b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.task-tag.blue,
.tag-option.blue {
  background: #e8f0fb;
  color: #315f9f;
}

.task-tag.violet,
.tag-option.violet {
  background: #f0ebfa;
  color: #6948a5;
}

.task-tag.pink,
.tag-option.pink {
  background: #f9eaf0;
  color: #9b4165;
}

.task-tag.cyan,
.tag-option.cyan {
  background: #e5f4f5;
  color: #276f75;
}

.task-tag.red,
.tag-option.red {
  background: var(--red-soft);
  color: var(--red);
}

.task-tag.amber,
.tag-option.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.task-tag.green,
.tag-option.green {
  background: var(--green-soft);
  color: var(--green);
}

.recurrence-mark {
  color: var(--blue);
  font-weight: 800;
}

.task-card-top,
.task-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-card-top {
  min-width: 0;
  min-height: 28px;
  padding: 0 58px 0 24px;
  flex-wrap: wrap;
}

.task-card-top > small {
  flex: 1 1 72px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-card-top > .badge-row {
  min-width: 0;
  max-width: 100%;
}

.task-card-top .badge {
  flex-shrink: 0;
}

@container (max-width: 260px) {
  .task-card-top {
    display: grid;
    justify-content: stretch;
    gap: 6px;
    padding: 0;
  }

  .task-card-top > small {
    min-height: 28px;
    padding: 3px 58px 0 24px;
  }

  .task-card-top > .badge-row {
    justify-content: flex-start;
  }
}

.task-card-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: auto;
}

.task-card-meta small:last-child {
  margin-left: auto;
}

.task-card .task-tag,
.task-table-row .task-tag {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.kanban-empty {
  display: grid;
  place-items: center;
  min-height: 72px;
  border: 1px dashed #cfd9d4;
  border-radius: 7px;
  color: #8a9891;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.low {
  background: var(--green-soft);
  color: var(--green);
}

.badge.medium {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.high {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.critical {
  background: var(--red-soft);
  color: var(--red);
}

.task-list-view {
  overflow-x: auto;
}

.task-table-head-selectable {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  min-width: 1126px;
}

.task-list-menu {
  position: relative;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  align-self: start;
  z-index: 2;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  font-size: 20px;
}
.task-list-menu:hover,
.task-list-menu:focus-visible,
.task-list-menu[aria-expanded="true"] { background: var(--surface-soft); border-color: var(--line); color: var(--ink); }
.task-more-menu.task-list-actions {
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(310px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  padding: 0;
  overflow-y: auto;
}
.task-list-actions:not(:popover-open) { display: none; }
.task-card-shell > .task-list-menu { position: absolute; top: 8px; right: 4px; }
.task-card-shell > .task-favorite { right: 34px; }
.planning-task:has(> .task-list-menu) { grid-template-columns: 18px minmax(0, 1fr) 26px 28px; }
.planning-task > .task-list-menu { width: 28px; padding: 0; }
.task-list-selectable:has(> .task-list-menu) { grid-template-columns: 28px minmax(0, 1fr) 28px; }
.task-meetings { order: 6; margin: 12px 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task-meetings .section-head { margin-bottom: 4px; }
.task-meetings h3 { margin: 0; font-size: 13px; }
.task-meeting-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.task-meeting-row > span { min-width: 0; }
.task-meeting-row strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.task-meeting-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.task-meeting-row > span:last-child { display: flex; flex-wrap: wrap; gap: 6px; }
.task-meeting-row a { font-size: 12px; }
.meeting-task-context { border-left: 3px solid var(--green); padding: 8px 12px; margin: 0 0 12px; font-weight: 700; overflow-wrap: anywhere; }

.task-list-selectable {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: stretch;
  min-width: 1126px;
  border-top: 1px solid var(--line);
}

.task-list-selectable.selected {
  background: var(--green-soft);
}

.task-list-selectable > label {
  display: grid;
  place-items: center;
}

.task-list-selectable > label input,
.timeline-task-label > input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
}

.task-table-head,
.task-table-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(140px, 0.75fr) 140px minmax(130px, 0.65fr) 110px 110px;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.task-table-head {
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.task-table-row {
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 0;
  border-top: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
}

.task-table-row:hover {
  background: var(--surface-soft);
}

.task-table-row > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-table-row > span,
.task-table-row > span > strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-table-row .badge {
  flex-shrink: 0;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}

.task-calendar {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.bulk-actions {
  display: grid;
  grid-template-columns: auto minmax(150px, 0.7fr) minmax(180px, 1fr) 150px auto 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #a8d4c2;
  border-radius: 7px;
  background: var(--green-soft);
}

.bulk-actions[hidden] {
  display: none;
}

.bulk-actions strong {
  font-size: 12px;
  white-space: nowrap;
}

.bulk-actions select,
.bulk-actions input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 9px;
  border: 1px solid #b9d5c9;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.task-timeline {
  overflow-x: auto;
}

.timeline-scroll {
  min-width: max(980px, calc(var(--timeline-days) * 42px + 260px));
}

.timeline-head,
.timeline-row {
  display: grid;
  grid-template-columns: 250px minmax(720px, 1fr);
  align-items: stretch;
}

.timeline-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.timeline-head > strong {
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.timeline-days {
  display: grid;
  grid-template-columns: repeat(var(--timeline-days), minmax(42px, 1fr));
}

.timeline-days > span {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-left: 1px solid #edf0ee;
  color: var(--muted);
}

.timeline-days > span.today {
  background: var(--green-soft);
  color: var(--green);
}

.timeline-days small {
  font-size: 12px;
  text-transform: uppercase;
}

.timeline-days strong {
  font-size: 12px;
}

.timeline-project > header {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: #42504a;
  font-size: 12px;
  font-weight: 900;
}

.timeline-project > header span {
  color: var(--muted);
}

.timeline-row {
  min-height: 48px;
  border-bottom: 1px solid #edf0ee;
}

.timeline-task-label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
}

.timeline-task-label button {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.timeline-task-label strong,
.timeline-task-label small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-task-label strong {
  font-size: 12px;
}

.timeline-task-label small {
  color: var(--muted);
  font-size: 12px;
}

.timeline-track {
  position: relative;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc((100% / var(--timeline-days)) - 1px),
    #edf0ee calc((100% / var(--timeline-days)) - 1px),
    #edf0ee calc(100% / var(--timeline-days))
  );
}

.timeline-bar {
  position: absolute;
  top: 11px;
  height: 26px;
  min-width: 24px;
  overflow: hidden;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: var(--timeline-color);
  color: #fff;
  text-align: left;
}

.timeline-bar.blocked {
  box-shadow: inset 0 0 0 2px #9f1f18;
}

.timeline-bar span {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day {
  min-width: 200px;
  min-height: 420px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f4f2;
}

.calendar-day > header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-day > div {
  display: grid;
  gap: 8px;
}

.content-split,
.chat-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
}

.selection-list {
  gap: 7px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 38px auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.project-row:hover,
.project-row.active {
  border-color: #a8c7ba;
  background: var(--green-soft);
}

.project-row strong,
.project-row small {
  display: block;
}

.project-row strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.project-row small {
  color: var(--muted);
  font-size: 12px;
}

.project-row-progress {
  overflow: hidden;
  height: 6px;
  border-radius: 3px;
  background: #dfe7e3;
}

.project-row-progress i,
.progress i,
.bar i {
  display: block;
  height: 100%;
  background: var(--green);
}

.project-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.project-detail-hero h2 {
  font-size: 21px;
}

.project-detail-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.project-more-menu {
  width: min(300px, calc(100vw - 72px));
}

.dialog-warning {
  margin: 0;
  padding: 12px;
  border: 1px solid #efb9b4;
  border-radius: 7px;
  background: var(--red-soft);
  color: #7f1d16;
  font-size: 13px;
  line-height: 1.5;
}

.project-stats,
.task-facts,
.team-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.project-stats > div,
.task-facts > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.project-stats strong,
.task-facts strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(105px, 1fr));
  gap: 7px;
  overflow-x: auto;
  margin: 14px 0;
}

.stage {
  min-width: 105px;
  min-height: 84px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.stage span,
.stage strong,
.stage small {
  display: block;
}

.stage span,
.stage small {
  color: var(--muted);
  font-size: 12px;
}

.stage strong {
  margin: 7px 0 4px;
  font-size: 12px;
}

.stage.current {
  border-color: #9bcab6;
  background: var(--green-soft);
}

.stage.done {
  opacity: 0.72;
}

.project-section {
  margin-top: 18px;
}

.member-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 3px 9px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  font-size: 12px;
  font-weight: 700;
}

.compact-task-list {
  gap: 6px;
}

.compact-task-list > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.compact-task-list > button:last-child {
  border-bottom: 0;
}

.compact-task-list strong,
.compact-task-list small {
  display: block;
}

.compact-task-list strong {
  margin-bottom: 2px;
  font-size: 12px;
}

.cycle-card {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cycle-card:last-child {
  border-bottom: 0;
}

.cycle-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.cycle-head > strong {
  color: var(--green);
  font-size: 24px;
}

.progress {
  overflow: hidden;
  height: 7px;
  border-radius: 4px;
  background: #e4eae7;
}

.cycle-meta {
  display: flex;
  gap: 14px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rail-note {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: #42504a;
  font-size: 12px;
}

.rail-note:last-child {
  border-bottom: 0;
}

.chat-layout {
  grid-template-columns: 310px minmax(0, 1fr);
  height: calc(100dvh - 136px);
  min-height: 560px;
  max-height: calc(100dvh - 136px);
}

.chat-sidebar,
.chat-box {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chat-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

#chat-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.chat-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 56px;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.chat-row:hover,
.chat-row.active {
  background: var(--green-soft);
}

.chat-row strong,
.chat-row small {
  display: block;
}

.chat-row strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.chat-box {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
}

#chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.agent-chat-context {
  display: grid;
  grid-template-columns: auto minmax(190px, auto);
  align-items: center;
  gap: 4px 8px;
  max-width: 440px;
}

.agent-chat-context > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.agent-chat-context select {
  min-height: 36px;
}

.agent-chat-context small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.chat-context-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #bfd7cb;
  border-radius: 4px;
  background: #eef8f2;
  color: #176246;
  font-size: 12px;
  font-weight: 800;
}

#messages {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 15px 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.message,
.comment {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  width: min(860px, 92%);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.message.agent,
.comment.agent {
  border-color: #c3d2e9;
  background: var(--blue-soft);
}

.message strong,
.message small,
.comment strong,
.comment small {
  display: block;
}

.message strong,
.comment strong {
  font-size: 13px;
}

.message p,
.comment p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.55;
}

.message p a {
  color: var(--blue);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.message mark {
  padding: 1px 3px;
  border-radius: 3px;
  background: #d9ebff;
  color: #245384;
}

.message-agent-source {
  display: inline-flex;
  width: fit-content;
  margin-top: 7px;
  padding: 2px 6px;
  border: 1px solid #bfd7cb;
  border-radius: 4px;
  background: #eef8f2;
  color: #176246;
  font-size: 11px;
  font-weight: 800;
}

.message-agent-source.fallback {
  border-color: #e1cea1;
  background: #fff8e7;
  color: #78530c;
}

.message-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12px;
}

.message-sources > span {
  color: var(--muted);
  font-weight: 800;
}

.message-sources a {
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid #c3d2e9;
  border-radius: 4px;
  color: var(--blue);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-files,
.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.message-files button {
  display: grid;
  gap: 2px;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid #bdc9c3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.message-files small {
  color: var(--muted);
  font-size: 12px;
}

.message-actions button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.chat-people {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 30px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.chat-people:empty {
  display: none;
}

.chat-people > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-people button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-people button.active {
  border-color: #8dc4ad;
  background: var(--green-soft);
  color: var(--green);
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}

.chat-suggestions button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #c3d2e9;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

#chat-form {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

#chat-form.is-submitting {
  cursor: wait;
}

#chat-form.is-submitting input,
#chat-form.is-submitting textarea,
#chat-form.is-submitting button,
.chat-suggestions button:disabled {
  cursor: wait;
  opacity: 0.68;
}

#chat-form button[type="submit"] {
  min-width: 106px;
}

#chat-input {
  min-height: 42px;
  max-height: 120px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.4;
}

#chat-form.is-dragging {
  border-color: #78b89d;
  background: var(--green-soft);
}

.message.pending {
  opacity: 0.78;
}

.message-file-pending {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid #bdc9c3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.chat-agent-progress {
  border-style: dashed;
}

.chat-agent-progress p {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.chat-progress-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid #b9cfe9;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: chat-progress-spin 0.8s linear infinite;
}

@keyframes chat-progress-spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-file-action {
  display: grid;
  place-items: center;
  min-width: 52px;
  height: 42px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.chat-file-action input {
  display: none;
}

.chat-file-name {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 16px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chat-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: min(320px, 100%);
  min-height: 30px;
  padding: 3px 4px 3px 8px;
  border: 1px solid #bdc9c3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.chat-file-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-file-chip small {
  color: var(--muted);
}

.chat-file-chip button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.chat-file-chip button:hover {
  background: #eef2f0;
  color: var(--ink);
}

.management-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 116px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid #cbd8d2;
  background: #fff;
}

.portfolio-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(90px, 0.45fr) 45px auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.portfolio-row:last-child {
  border-bottom: 0;
}

.portfolio-row strong,
.portfolio-row small {
  display: block;
}

.portfolio-row > span:first-child > strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.portfolio-row small {
  color: var(--muted);
  font-size: 12px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 10px;
}

.team-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.team-person {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.team-person strong,
.team-person small {
  display: block;
}

.team-person strong {
  font-size: 12px;
}

.team-metrics {
  grid-template-columns: repeat(3, 1fr);
  margin: 14px 0 10px;
}

.team-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.team-metrics strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 16px;
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.agent-status-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.4fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 7px;
  background: var(--surface-soft);
}

.agent-status-card.ready {
  border-left-color: var(--green);
}

.agent-status-card.unavailable {
  border-left-color: var(--red);
}

.agent-status-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.agent-status-main strong,
.agent-status-main p {
  display: block;
}

.agent-status-main strong {
  font-size: 14px;
}

.agent-status-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.agent-connection-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 16%, transparent);
}

.agent-status-card.ready .agent-connection-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 16%, transparent);
}

.agent-status-card.unavailable .agent-connection-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 14%, transparent);
}

.agent-status-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
}

.agent-status-meta span {
  min-width: 0;
  padding-left: 9px;
  border-left: 1px solid var(--line);
}

.agent-status-meta small,
.agent-status-meta strong {
  display: block;
  overflow-wrap: anywhere;
}

.agent-status-meta small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.agent-status-meta strong {
  font-size: 12px;
}

.agent-status-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 7px;
}

.agent-pilot-card {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #dfc98f;
  border-radius: 7px;
  background: #fff9e9;
}

.agent-pilot-card.ready {
  border-color: #acd1bf;
  background: #f1f9f4;
}

.agent-pilot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.agent-pilot-head h3,
.agent-pilot-head p {
  margin: 0;
}

.agent-pilot-head h3 {
  margin-top: 3px;
  font-size: 14px;
}

.agent-pilot-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.agent-pilot-kicker,
.agent-pilot-mode {
  color: #78530c;
  font-size: 11px;
  font-weight: 800;
}

.agent-pilot-card.ready .agent-pilot-kicker,
.agent-pilot-card.ready .agent-pilot-mode {
  color: #176246;
}

.agent-pilot-mode {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid currentColor;
  border-radius: 4px;
}

.agent-pilot-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.agent-pilot-metrics span {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, currentColor 12%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, #fff 86%, transparent);
}

.agent-pilot-metrics strong {
  font-size: 18px;
}

.agent-pilot-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.agent-pilot-reasons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.agent-pilot-reasons span {
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
}

.agent-sandbox-card {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #b9c8d8;
  border-left: 4px solid #315f9f;
  border-radius: 7px;
  background: #f5f8fc;
}

.agent-sandbox-card.running {
  border-color: #e0b660;
  border-left-color: #a66700;
  background: #fff9ea;
}

.agent-sandbox-card.stopped {
  border-left-color: var(--green);
  background: #f4f9f6;
}

.agent-sandbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.agent-sandbox-copy h3,
.agent-sandbox-copy p {
  margin: 0;
}

.agent-sandbox-copy h3 {
  margin-top: 3px;
  font-size: 15px;
}

.agent-sandbox-copy p {
  max-width: 880px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.agent-sandbox-kicker,
.agent-sandbox-state {
  color: #315f9f;
  font-size: 11px;
  font-weight: 850;
}

.agent-sandbox-card.running .agent-sandbox-kicker,
.agent-sandbox-card.running .agent-sandbox-state {
  color: #835600;
}

.agent-sandbox-state {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid currentColor;
  border-radius: 4px;
}

.agent-sandbox-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.agent-sandbox-metrics span {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
}

.agent-sandbox-metrics strong {
  font-size: 18px;
}

.agent-sandbox-metrics small,
.agent-sandbox-latest {
  color: var(--muted);
  font-size: 11px;
}

.agent-sandbox-latest {
  margin: 0;
}

.agent-sandbox-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.danger-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #b42318;
  border-radius: 6px;
  background: #b42318;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.danger-button:hover {
  background: #8f1d14;
}

.recommendation-card {
  min-height: 154px;
  padding: 13px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 7px;
  background: var(--surface-soft);
}

.recommendation-card.high {
  border-top-color: var(--amber);
}

.recommendation-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.recommendation-card h3 {
  margin-top: 12px;
}

.recommendation-card p,
.agent-command p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.agent-command-list {
  gap: 8px;
}

.agent-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.agent-command strong {
  font-size: 14px;
}

.agent-command small {
  display: block;
  margin-top: 6px;
}

.agent-action {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.agent-action:last-child {
  border-bottom: 0;
}

.agent-action strong,
.agent-action small {
  display: block;
}

.agent-action strong {
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.45;
}

.agent-action-content {
  min-width: 0;
}

.agent-action-content p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.agent-action-content .agent-result-summary {
  padding-left: 8px;
  border-left: 2px solid var(--line);
}

.agent-action-content .agent-execution-result {
  color: var(--green-strong);
  font-weight: 800;
}

.agent-action-content .agent-execution-result.error {
  color: var(--red);
}

.agent-task-link {
  max-width: 100%;
  margin: 2px 0 5px;
  padding: 0;
  text-align: left;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: normal;
}

.action-state {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--blue);
}

.action-state.approved,
.action-state.completed,
.action-state.executed {
  background: var(--green);
}

.action-state.rejected,
.action-state.failed {
  background: var(--red);
}

.action-buttons {
  grid-column: 2;
}

@media (max-width: 1180px) {
  .agent-status-card {
    grid-template-columns: 1fr;
  }

  .agent-status-actions {
    grid-column: auto;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .agent-status-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-status-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agent-status-actions button {
    width: 100%;
  }

  .agent-pilot-head {
    display: grid;
  }

  .agent-pilot-mode {
    width: fit-content;
  }

  .agent-pilot-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.chart-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.chart-row:last-child {
  border-bottom: 0;
}

.bar {
  overflow: hidden;
  height: 9px;
  border-radius: 5px;
  background: #e5eae8;
}

.bar i {
  background: var(--blue);
}

.bar.funnel i {
  background: var(--green);
}

#insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.insight {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid #c3d2e9;
  border-radius: 7px;
  background: var(--blue-soft);
}

.insight span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.insight p {
  margin: 0;
  color: #344d70;
  font-size: 12px;
}

.employee-report-surface {
  margin-bottom: 14px;
}

.employee-report-head {
  align-items: center;
}

.employee-report-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.employee-report-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.employee-report-controls input,
.employee-report-controls select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #cbd5d0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.employee-report-overview {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  margin-bottom: 18px;
}

.report-metrics {
  margin: 0;
}

.company-rhythm {
  display: grid;
  align-content: center;
  min-height: 104px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.company-rhythm p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.speed-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.speed-gauge-wrap > div:last-child > strong,
.speed-gauge-wrap > div:last-child > small {
  display: block;
}

.speed-gauge-wrap > div:last-child > strong {
  font-size: 13px;
}

.speed-gauge-wrap > div:last-child > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.speed-gauge {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(#1f7a5d calc(var(--speed-score) * 1%), #e2e9e5 0);
}

.speed-gauge.medium {
  background: conic-gradient(#d39420 calc(var(--speed-score) * 1%), #e2e9e5 0);
}

.speed-gauge.low {
  background: conic-gradient(#c14d4d calc(var(--speed-score) * 1%), #e2e9e5 0);
}

.speed-gauge::before {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.speed-gauge > span {
  position: relative;
  z-index: 1;
  text-align: center;
}

.speed-gauge > span strong,
.speed-gauge > span small {
  display: block;
}

.speed-gauge > span strong {
  font-size: 20px;
  line-height: 1;
}

.speed-gauge > span small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.speed-gauge-wrap.compact {
  gap: 7px;
}

.speed-gauge-wrap.compact .speed-gauge {
  width: 42px;
  height: 42px;
}

.speed-gauge-wrap.compact .speed-gauge::before {
  inset: 5px;
}

.speed-gauge-wrap.compact .speed-gauge > span strong {
  font-size: 13px;
}

.speed-gauge-wrap.compact .speed-gauge > span small,
.speed-gauge-wrap.compact > div:last-child {
  display: none;
}

.employee-report-block {
  margin-top: 18px;
}

#employee-report-team,
#employee-report-tasks {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.employee-report-team-head,
.employee-report-team-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) 110px 64px 94px 94px 110px 84px;
  align-items: center;
  gap: 10px;
  min-width: 860px;
  padding: 9px 12px;
}

.employee-report-team-head,
.employee-report-table-head {
  min-height: 38px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.employee-report-team-row {
  min-height: 62px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.report-person {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.report-person > span:last-child {
  min-width: 0;
}

.report-person strong,
.report-person small {
  display: block;
}

.report-person small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-person.compact {
  font-size: 12px;
}

.employee-report-table {
  min-width: 1120px;
}

.employee-report-table-head,
.employee-report-task-row {
  display: grid;
  grid-template-columns: minmax(310px, 1.5fr) 155px 125px 85px 85px 105px 105px;
  align-items: center;
  gap: 10px;
  min-width: 1120px;
  padding: 9px 12px;
}

.employee-report-task-row {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
}

.employee-report-task-row:hover {
  background: #f6faf8;
}

.employee-report-task-row.overdue {
  box-shadow: inset 3px 0 0 var(--red);
}

.employee-report-task-row > span {
  min-width: 0;
}

.employee-report-task-row > span:first-child strong,
.employee-report-task-row > span:first-child small,
.employee-report-task-row > span:last-child small {
  display: block;
}

.employee-report-task-row > span:first-child strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-report-task-row > span:first-child small,
.employee-report-task-row > span:last-child small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.employee-report-task-row.overdue > span:last-child small,
.report-over {
  color: var(--red);
  font-weight: 800;
}

.employee-report-task-row > span:nth-child(3) {
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-status {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #77837d;
}

.report-status.in_progress {
  background: var(--blue);
}

.report-status.waiting {
  background: var(--amber);
}

.report-status.review {
  background: #7454a8;
}

.report-status.risk {
  background: var(--red);
}

.report-status.done {
  background: var(--green);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
}

.settings-grid > section > h3 {
  margin-bottom: 10px;
}

.launch-center,
.system-health {
  grid-column: 1 / -1;
}

.launch-center {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.ai-workspace-launcher {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 0.9fr);
  align-items: end;
  gap: 22px;
  max-width: 1120px;
}

.ai-workspace-copy h2 {
  margin: 4px 0 7px;
  font-size: 24px;
}

.ai-workspace-copy p:last-child,
.ai-workspace-state span {
  color: var(--muted);
}

.ai-workspace-controls {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(200px, 0.9fr) auto;
  align-items: end;
  gap: 10px;
}

.ai-workspace-controls label,
.ai-workspace-state {
  display: grid;
  gap: 5px;
}

.ai-workspace-controls label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-workspace-controls label small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ai-workspace-state,
.ai-workspace-tabs {
  grid-column: 1 / -1;
}

.ai-workspace-state {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ai-workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .ai-workspace-launcher,
  .ai-workspace-controls {
    grid-template-columns: 1fr;
  }
}

.launch-summary {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  max-width: 880px;
}

.launch-summary h3 {
  margin: 3px 0 5px;
  font-size: 20px;
}

.launch-summary p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}

.readiness-score {
  display: grid;
  place-content: center;
  width: 104px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff 59%, transparent 60%),
    conic-gradient(var(--green) calc(var(--readiness) * 1%), var(--line) 0);
  text-align: center;
}

.readiness-score strong,
.readiness-score small {
  display: block;
}

.readiness-score strong {
  font-size: 22px;
}

.readiness-score small {
  color: var(--muted);
}

.readiness-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 16px;
}

.readiness-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.readiness-step.complete {
  background: var(--green-soft);
}

.readiness-check {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
}

.readiness-step.complete .readiness-check {
  border-color: var(--green);
  background: var(--green);
}

.readiness-step strong,
.readiness-step small {
  display: block;
}

.readiness-step small {
  margin-top: 2px;
  color: var(--muted);
}

.system-health {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.system-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.system-metrics > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.system-metrics > div:last-child {
  border-right: 0;
}

.system-metrics small,
.system-metrics strong,
.system-metrics span {
  display: block;
}

.system-metrics small,
.system-metrics span {
  color: var(--muted);
}

.system-metrics strong {
  margin: 3px 0;
  font-size: 17px;
}

.backup-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 7px;
  background: var(--surface-soft);
}

.backup-status.attention {
  border-left-color: var(--amber);
}

.backup-status strong,
.backup-status small {
  display: block;
}

.backup-status small {
  margin-top: 3px;
  color: var(--muted);
}

.system-log {
  margin-top: 14px;
}

.compact-head {
  margin-bottom: 6px;
}

.system-event {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.system-event > span {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--amber);
}

.system-event.error > span {
  background: var(--red);
}

.system-event strong,
.system-event small,
.system-log-empty strong,
.system-log-empty small {
  display: block;
}

.system-event small,
.system-log-empty small {
  margin-top: 2px;
  color: var(--muted);
}

.system-log-empty {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
}

.workflow-settings {
  grid-column: 1 / -1;
  padding-top: 4px;
}

.access-settings {
  grid-column: 1 / -1;
}

.invitation-settings {
  grid-column: 1 / -1;
}

.invitation-settings-list {
  display: grid;
  gap: 7px;
}

.invitation-settings-row {
  display: grid;
  grid-template-columns: 38px minmax(210px, 1fr) auto minmax(150px, auto) 36px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.invitation-settings-row.accepted {
  border-left: 4px solid var(--green);
}

.invitation-settings-row.expired,
.invitation-settings-row.revoked {
  opacity: 0.72;
}

.invitation-person {
  display: grid;
  gap: 2px;
}

.invitation-person small,
.invitation-expiry {
  color: var(--muted);
  font-size: 12px;
}

.invitation-status-badges {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.invitation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.invitation-actions-complete {
  width: 34px;
  height: 34px;
}

.text-button.danger {
  color: var(--red);
}

.account-settings-list {
  display: grid;
  gap: 6px;
}

.account-settings-row {
  display: grid;
  grid-template-columns: 40px minmax(140px, 0.6fr) minmax(150px, 0.7fr) minmax(190px, 1fr) 90px auto;
  align-items: end;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.account-settings-row.employee-access-focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(20, 113, 84, 0.12);
}

.account-person {
  display: grid;
  align-self: center;
  gap: 2px;
}

.account-person strong {
  font-size: 12px;
}

.account-person small {
  color: var(--muted);
  font-size: 12px;
}

.account-settings-row > label:not(.check-option) {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.account-settings-row input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.status-settings-list {
  display: grid;
  gap: 6px;
}

.status-settings-row {
  display: grid;
  grid-template-columns: 42px minmax(180px, 1fr) 100px 110px auto;
  align-items: end;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.status-settings-row > input[type="color"],
.status-create-form > input[type="color"] {
  width: 42px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.status-settings-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-settings-row input:not([type="checkbox"]):not([type="color"]),
.status-create-form input[type="text"],
.status-create-form input:not([type]) {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.status-create-form {
  display: grid;
  grid-template-columns: 42px minmax(180px, 1fr) 150px auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.settings-list {
  gap: 8px;
}

.settings-list.compact {
  gap: 5px;
}

.settings-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.settings-card strong {
  font-size: 12px;
}

.settings-card p {
  margin-top: 4px;
}

.settings-card small {
  display: block;
  margin-top: 7px;
}

.settings-card.stacked {
  grid-template-columns: 1fr;
}

.role-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}

.employee-action-menu {
  position: relative;
  justify-self: end;
  flex: 0 0 auto;
}

.employee-action-menu[open] {
  z-index: 24;
}

.employee-action-menu > summary {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 0 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: #52615a;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  list-style: none;
}

.employee-action-menu > summary::-webkit-details-marker {
  display: none;
}

.employee-action-menu > summary:hover,
.employee-action-menu > summary:focus-visible,
.employee-action-menu[open] > summary {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.employee-action-menu > div {
  position: absolute;
  top: 39px;
  right: 0;
  z-index: 25;
  display: grid;
  width: min(310px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid #c8d2cd;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(18, 31, 26, 0.18);
}

.employee-action-menu button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 56px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #e4e9e6;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.employee-action-menu button:last-child {
  border-bottom: 0;
}

.employee-action-menu button:hover,
.employee-action-menu button:focus-visible {
  background: #edf5f1;
}

.employee-action-menu button strong,
.employee-action-menu button small {
  display: block;
}

.employee-action-menu button strong {
  font-size: 13px;
  line-height: 1.35;
}

.employee-action-menu button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.employee-action-menu .employee-menu-danger {
  color: var(--red);
}

.employee-action-menu .employee-menu-danger:hover,
.employee-action-menu .employee-menu-danger:focus-visible {
  background: var(--red-soft);
}

.role-row strong,
.role-row small {
  display: block;
}

.role-row strong {
  font-size: 12px;
}

.integration-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 74px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 12px;
}

.empty-state p {
  margin: 5px 0 0;
  font-size: 12px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 26, 22, 0.42);
}

.task-drawer,
.notification-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(640px, 100vw);
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -18px 0 48px rgba(18, 31, 26, 0.16);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.notification-drawer {
  width: min(420px, 100vw);
}

.task-drawer.open,
.notification-drawer.open {
  transform: translateX(0);
}

.drawer-close {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 23px;
  line-height: 1;
}

.drawer-close.inline {
  position: static;
  margin: 0;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.task-detail-head {
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--line);
}

.task-detail-head h2 {
  max-width: 560px;
  font-size: 24px;
}

.task-detail-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin: 16px 0 0;
}

.task-detail-controls label,
.dialog-card label,
.task-team-form label,
.rule-form label,
.description-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.task-detail-controls select,
.task-detail-controls input {
  height: 40px;
  padding: 0 10px;
}

.task-detail-controls .timer {
  align-self: end;
}

.timer {
  border: 1px solid var(--blue);
  background: #fff;
  color: var(--blue);
}

.timer.active {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.task-facts select, .task-fact-action {
  width: 100%; min-width: 0; min-height: 30px; font: inherit; font-weight: 700;
  padding: 4px 6px; border: 1px solid transparent; border-radius: 4px;
  color: inherit; background: transparent; text-align: left;
}
.task-facts select:hover, .task-fact-action:hover { border-color: var(--line, #d5dfdc); background: #fff; }
.task-fact-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
.task-fact-action:focus-visible, .task-facts select:focus-visible { outline: 2px solid #16765d; outline-offset: 1px; }
.task-fact-action span { flex-shrink: 0; }
.task-facts {
  margin: 12px 0 0;
}

.blocked-banner {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 11px 12px;
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.blocked-banner strong {
  font-size: 12px;
}

.blocked-banner span {
  color: #74413c;
  font-size: 12px;
}

.task-detail-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.task-detail-section:last-child {
  border-bottom: 0;
}

.task-team-form,
.rule-form {
  display: grid;
  gap: 10px;
}

.task-field-grid,
.task-rule-grid,
.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.task-team-form select,
.task-team-form input,
.rule-form select,
.rule-form input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.task-team-form select[multiple] {
  min-height: 92px;
}

.tag-checks {
  align-items: stretch;
  padding: 4px 0;
}

.tag-option {
  display: inline-flex !important;
  grid-template-columns: 16px auto;
  align-items: center;
  gap: 6px !important;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 5px;
  background: #edf1ef;
  color: #53615b;
  font-size: 12px !important;
  text-transform: none !important;
  cursor: pointer;
}

.tag-option input,
.check-option input {
  width: 15px;
  min-height: 15px;
  margin: 0;
}

.check-option {
  display: flex !important;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
  font-size: 12px !important;
  text-transform: none !important;
}

.rule-form {
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.rule-actions,
.approval-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.reminder-list {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.approval-actions {
  margin-top: 12px;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}

.approval-actions strong {
  margin-right: auto;
  font-size: 12px;
}

.checklist {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.checklist button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
}

.checklist button.done {
  color: var(--muted);
  text-decoration: line-through;
}

.checkmark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #b8c8c0;
  border-radius: 5px;
  background: #fff;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.checklist button.done .checkmark {
  border-color: #9bcab6;
  background: var(--green-soft);
}

.inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-top: 10px;
}

.inline-add input {
  height: 38px;
  padding: 0 10px;
}

.inline-add select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.dependency-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.subsection-title {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.dependency-list {
  display: grid;
  gap: 6px;
}

.dependency-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 46px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.dependency-row > button:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.dependency-row strong,
.dependency-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dependency-row strong {
  font-size: 12px;
}

.dependency-row small {
  color: var(--muted);
  font-size: 12px;
}

.icon-action {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 16px;
}

.template-save-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.4fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.template-save-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.template-save-form input,
.template-save-form select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.activity-list {
  display: grid;
  gap: 5px;
}

.activity-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 0;
  border-bottom: 1px solid #edf0ee;
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-row > span:last-child {
  display: grid;
  gap: 2px;
}

.activity-row strong {
  font-size: 12px;
}

.activity-row small {
  color: var(--muted);
  font-size: 12px;
}

.file-placeholder {
  padding: 13px;
  border: 1px dashed #bdc9c3;
  border-radius: 7px;
  background: var(--surface-soft);
}

.description-form {
  display: grid;
  gap: 8px;
}

.description-form textarea {
  min-height: 96px;
  padding: 10px;
  resize: vertical;
}

.description-form .ghost {
  justify-self: end;
}

.file-list {
  display: grid;
  gap: 6px;
}

.file-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
}

.file-list strong,
.file-list small {
  display: block;
}

.file-list strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.file-list small,
.file-list button > span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.file-upload {
  display: grid;
  place-items: center;
  min-height: 58px;
  margin-top: 8px;
  border: 1px dashed #bdc9c3;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.file-upload input {
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-placeholder strong {
  font-size: 12px;
}

.file-placeholder p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.comment-list {
  display: grid;
  gap: 8px;
}

.comment {
  width: 100%;
}

.comment-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.comment-form textarea {
  min-height: 82px;
  padding: 10px;
  resize: vertical;
}

.comment-form .primary {
  justify-self: end;
}

.notification-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.notification-item.read {
  opacity: 0.62;
}

.notification-mark {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--blue);
}

.notification-item.read .notification-mark {
  background: #aab6b0;
}

.notification-item strong {
  display: block;
  font-size: 12px;
}

.notification-item p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 12px;
}

.notification-item small {
  color: var(--muted);
  font-size: 12px;
}

.inbox-surface {
  max-width: 1120px;
  margin: 0 auto;
}

.inbox-filters {
  margin: 14px 0 8px;
}

.toolbar.inbox-filters { flex-wrap: wrap; overflow-x: visible; }
.inbox-filters .chip { flex-shrink: 0; white-space: nowrap; }

.inbox-list {
  border-top: 1px solid var(--line);
}

.inbox-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.inbox-item:hover {
  background: var(--surface-soft);
}

.inbox-item.read {
  opacity: 0.68;
}

.inbox-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.inbox-row .inbox-item { border-bottom: 0; }
.inbox-item.read.needs-action { opacity: 1; }
.inbox-item.read .notification-mark { background: transparent; }
.inbox-copy { min-width: 0; overflow-wrap: anywhere; }
.inbox-action-status { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.inbox-action-status.pending { color: #855b07; font-weight: 700; }

.inbox-resolve {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--green);
  font-size: 18px;
}

.inbox-resolve:hover { background: var(--surface-soft); }
.inbox-resolve:disabled { opacity: 0.5; cursor: wait; }

.inbox-copy strong {
  font-size: 14px;
}

.inbox-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.inbox-item > small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.update-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #eef5f2;
  border-block: 1px solid #cbded6;
  color: #173e32;
}
.update-banner-open {
  display: flex;
  flex: 1;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
  line-height: 1.5;
}
.update-banner-open:hover { background: transparent; }
.update-banner-label, .update-banner-link { font-weight: 700; }
#update-banner-summary { font-size: 13px; font-weight: 400; overflow-wrap: anywhere; }
.update-banner-link { margin-left: auto; font-size: 12px; }
.update-banner .icon-action { flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px; padding: 0; background: transparent; }
.feedback-sections { display: flex; gap: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.feedback-sections button { display: flex; align-items: center; gap: 8px; padding: 10px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); }
.feedback-sections button[aria-selected="true"] { border-bottom-color: #176b53; color: #176b53; }
.updates-unread-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #be2525; }
.release-history { max-width: 1040px; }
.release-entry { display: grid; grid-template-columns: 155px minmax(0, 1fr); gap: 28px; padding: 22px 0 28px; border-bottom: 1px solid var(--line); }
.release-entry:first-child { padding-top: 0; }
.release-meta { display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.release-meta time { color: var(--ink); font-weight: 700; }
.release-copy { min-width: 0; }
.release-copy h2 { font-size: 19px; line-height: 1.4; margin: 0 0 8px; overflow-wrap: anywhere; }
.release-copy p { margin: 0 0 16px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.release-copy ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.release-copy li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.release-kind { font-size: 12px; color: #176b53; font-weight: 700; }
@media (max-width: 640px) {
  .update-banner { align-items: flex-start; gap: 8px; }
  .update-banner-open { display: grid; gap: 4px; }
  .update-banner-link { margin-left: 0; }
  .release-entry { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .release-meta { flex-direction: row; flex-wrap: wrap; gap: 8px 14px; }
  .release-copy li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.feedback-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 12px 0;
}

.feedback-filters select,
.feedback-manage select {
  width: 100%;
  height: 38px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.feedback-list {
  border-top: 1px solid var(--line);
}

.feedback-row {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.feedback-row:hover,
.feedback-row.active {
  background: var(--green-soft);
}

.feedback-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.feedback-row-top strong {
  font-size: 13px;
  line-height: 1.4;
}

.feedback-row-meta {
  color: var(--muted);
  font-size: 12px;
}

.feedback-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.feedback-status.done {
  background: var(--green-soft);
  color: var(--green);
}

.feedback-status.declined {
  background: #eef1ef;
  color: var(--muted);
}

.feedback-status.in_progress,
.feedback-status.planned {
  background: var(--amber-soft);
  color: var(--amber);
}

.feedback-detail {
  min-height: 520px;
}

.feedback-detail-head,
.feedback-author,
.feedback-author > span,
.feedback-comments article > div {
  display: flex;
  align-items: center;
}

.feedback-detail-head {
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.feedback-detail-head h2 {
  font-size: 20px;
}

.feedback-author {
  gap: 9px;
  margin: 14px 0;
}

.feedback-author > span {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.feedback-author small,
.feedback-comments small {
  color: var(--muted);
  font-size: 12px;
}

.feedback-copy {
  margin-top: 16px;
}

.feedback-copy h3,
.feedback-comments h3 {
  font-size: 14px;
}

.feedback-copy p,
.feedback-comments article p {
  margin: 6px 0 0;
  color: #34423d;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.feedback-screenshot {
  display: grid;
  gap: 6px;
  width: min(460px, 100%);
  margin-top: 16px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.feedback-screenshot img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  object-position: left center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.feedback-manage {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
  margin-top: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feedback-manage label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-comments {
  margin-top: 20px;
}

.feedback-comments article {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.feedback-comments article > div {
  gap: 7px;
}

.feedback-comments article small {
  margin-left: auto;
}

.feedback-comments form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.feedback-comments textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  resize: vertical;
}

.feedback-comments form .primary {
  justify-self: end;
}

#feedback-dialog {
  width: min(780px, calc(100vw - 28px));
}

.feedback-dialog {
  width: 100%;
  max-height: min(90vh, 900px);
  overflow-y: auto;
  overflow-x: hidden;
}

@media (max-width: 1020px) {
  .feedback-layout {
    grid-template-columns: 1fr;
  }

  .feedback-detail {
    min-height: 0;
  }

  .feedback-manage {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .global-search-results {
    right: auto;
    left: 0;
    width: 100%;
  }

  .inbox-head,
  .feedback-detail-head {
    align-items: flex-start;
  }

  .inbox-head {
    display: grid;
  }

  .inbox-head .ghost {
    justify-self: start;
  }

  .inbox-item {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .inbox-item > small {
    grid-column: 2;
  }

  .feedback-filters,
  .feedback-manage {
    grid-template-columns: 1fr;
  }
}

dialog {
  width: min(760px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

dialog::backdrop {
  background: rgba(15, 26, 22, 0.5);
}

.dialog-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 28, 23, 0.22);
}

.compact-dialog {
  width: min(460px, calc(100vw - 28px));
  margin: auto;
}

.compact-dialog > label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-decision-summary,
.agent-decision-impact {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7faf8;
}

.agent-decision-summary small,
.agent-decision-impact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.agent-decision-summary p,
.agent-decision-impact p {
  margin: 0;
  color: #263c33;
  font-size: 13px;
  line-height: 1.5;
}

.agent-decision-impact {
  border-color: #dfc887;
  background: #fffaf0;
}

.dialog-card input,
.dialog-card select {
  height: 40px;
  padding: 0 10px;
}

.dialog-card select[multiple] {
  height: 96px;
  padding: 7px 10px;
}

.dialog-grid .span-2 {
  grid-column: 1 / -1;
}

.dialog-card textarea {
  padding: 10px;
  resize: vertical;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid #a8d4c2;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(18, 31, 26, 0.16);
  opacity: 0;
  transform: translateY(16px);
  transition: 180ms ease;
  pointer-events: none;
  font-size: 12px;
  font-weight: 700;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

body.ai-workspace-opening {
  cursor: progress;
}

body.ai-workspace-opening .nav-btn,
body.ai-workspace-opening [data-ai-workspace-launch],
body.ai-workspace-opening [data-ai-workspace-direct],
body.ai-workspace-opening [data-project-agent],
body.ai-workspace-opening [data-task-ai-workspace] {
  pointer-events: none;
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand > div,
  .nav-group > p,
  .nav-label,
  #sidebar-user > div,
  .connector-state {
    display: none;
  }

  .nav-btn {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .nav-indicator {
    width: 8px;
    height: 8px;
  }

  #sidebar-user {
    justify-content: center;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .global-search {
    width: 220px;
  }

  .workspace-grid,
  .content-split {
    grid-template-columns: 1fr;
  }

  .workspace-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-grid,
  .recommendation-grid,
  #insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-form {
    grid-template-columns: minmax(220px, 1fr) 1fr 1fr;
  }
}

@media (max-width: 1020px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    display: block;
    width: 100%;
    height: auto;
    padding: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .brand,
  .sidebar-footer,
  .nav-group > p {
    display: none;
  }

  #nav {
    display: flex;
    flex: none;
    width: max-content;
    min-width: 100%;
    gap: 5px;
    margin: 0;
    padding-right: 0;
    overflow: visible;
    scrollbar-width: none;
  }

  #nav::-webkit-scrollbar {
    display: none;
  }

  .nav-group {
    display: contents;
  }

  .nav-btn {
    display: block;
    width: auto;
    min-width: 78px;
    min-height: 42px;
    padding: 0 8px;
    text-align: center;
    font-size: 12px;
  }

  .nav-label {
    display: block;
  }

  .nav-btn[data-view="inbox"] { padding: 0 18px 0 8px; }
  .nav-unread-badge { top: 2px; right: 3px; transform: none; }

  .nav-indicator {
    display: none;
  }

  .main {
    padding: 14px 12px 74px;
  }

  .topbar {
    display: grid;
    width: 100%;
    margin-bottom: 16px;
    justify-content: stretch;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    justify-content: stretch;
  }

  .global-search,
  .role-switch {
    grid-column: 1 / -1;
    width: 100%;
  }

  .role-switch {
    justify-content: space-between;
  }

  .role-switch select {
    max-width: none;
  }

  .day-intro,
  .management-banner,
  .tasks-header {
    display: grid;
    align-items: start;
  }

  .day-intro h2,
  .management-banner h2 {
    font-size: 20px;
  }

  .metrics,
  .workspace-rail,
  .team-grid,
  .recommendation-grid,
  #insights,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 92px;
  }

  .metric-card strong {
    font-size: 21px;
  }

  .focus-item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .focus-time {
    display: none;
  }

  .focus-item .badge {
    grid-column: 2;
  }

  .segmented {
    width: 100%;
  }

  .toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .quick-form {
    grid-template-columns: 1fr;
  }

  .content-split,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .chat-sidebar {
    height: auto;
    max-height: 220px;
  }

  .chat-box {
    height: calc(100dvh - 116px);
    min-height: 520px;
    max-height: 760px;
  }

  #chat-head {
    display: grid;
  }

  .agent-chat-context {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .agent-chat-context small {
    grid-column: auto;
  }

  .project-row {
    grid-template-columns: minmax(0, 1fr) 38px auto;
  }

  .project-row-progress {
    display: none;
  }

  .project-stats,
  .task-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-row {
    grid-template-columns: minmax(0, 1fr) 42px auto;
  }

  .portfolio-row > .progress {
    display: none;
  }

  .task-drawer,
  .notification-drawer {
    padding: 16px;
  }

  .task-detail-controls {
    grid-template-columns: 1fr;
  }

  .task-field-grid,
  .task-rule-grid,
  .dialog-grid,
  .dependency-columns {
    grid-template-columns: 1fr;
  }

  .bulk-actions {
    grid-template-columns: 1fr;
  }

  .bulk-actions .icon-action {
    justify-self: end;
  }

  .template-save-form,
  .status-settings-row,
  .status-create-form,
  .account-settings-row {
    grid-template-columns: 1fr;
  }

  .status-settings-row > input[type="color"],
  .status-create-form > input[type="color"] {
    width: 100%;
  }

  .dialog-grid .span-2 {
    grid-column: auto;
  }

  .task-detail-head h2 {
    font-size: 20px;
  }

  .notification-button {
    min-width: 0;
  }
}

/* Task workspace: centered, readable and focused like the familiar Worksection flow. */
.task-drawer {
  top: 18px;
  left: 50%;
  right: auto;
  width: min(960px, calc(100vw - 48px));
  height: calc(100vh - 36px);
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 1px solid #ccd7d1;
  border-radius: 8px;
  box-shadow: 0 26px 84px rgba(18, 31, 26, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px) scale(0.985);
  transform-origin: center;
}

.task-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.task-drawer > .drawer-close {
  top: 12px;
  margin: 12px 12px -48px auto;
  background: #fff;
  box-shadow: 0 3px 12px rgba(18, 31, 26, 0.12);
}

#task-detail {
  padding: 28px 36px 44px;
}

.task-detail-head {
  padding-right: 48px;
}

.task-detail-head h2 {
  max-width: 760px;
  font-size: 26px;
  line-height: 1.25;
}

.task-detail-section h3 {
  font-size: 16px;
  line-height: 1.35;
}

.task-detail-controls label,
.dialog-card label,
.task-team-form label,
.rule-form label,
.description-form label {
  font-size: 12px;
  letter-spacing: 0;
}

.task-detail-controls select,
.task-detail-controls input,
.task-team-form select,
.task-team-form input,
.rule-form select,
.rule-form input,
.description-form textarea {
  font-size: 14px;
  line-height: 1.45;
}

.task-card > strong {
  font-size: 14px;
  line-height: 1.45;
}

.task-card small,
.focus-item small,
.project-row small,
.portfolio-row small,
.chat-row small,
.message small,
.comment small,
.compact-task-list small,
.agent-action small,
.agent-command small,
.settings-card small,
.role-row small,
.team-person small,
.activity-row small,
.dependency-row small {
  font-size: 12px;
  line-height: 1.45;
}

.task-tag,
.badge,
.risk-badge,
.status-badge {
  font-size: 12px;
  line-height: 1.35;
}

.kanban-empty,
.task-table-head,
.eyebrow,
.nav-group > p {
  font-size: 12px;
  letter-spacing: 0;
}

.checklist button,
.inline-add input,
.inline-add select,
.text-button,
.agent-link {
  font-size: 13px;
}

.section-head p,
.task-detail-head > p:last-child,
.project-detail-hero p,
.cycle-head p,
.settings-card p,
.muted {
  font-size: 13px;
}

.attachment-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.attachment-gallery-item {
  display: grid;
  grid-template-rows: minmax(180px, 1fr) auto;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #ccd7d1;
  border-radius: 7px;
  background: #eef2f0;
  color: var(--ink);
  text-align: left;
}

.attachment-gallery-item:hover {
  border-color: #72aa91;
  box-shadow: 0 7px 20px rgba(18, 31, 26, 0.1);
}

.attachment-gallery-item img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  max-height: 520px;
  object-fit: contain;
  background: #e6ebe8;
}

.attachment-gallery-item span {
  overflow: hidden;
  padding: 10px 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list {
  gap: 8px;
}

.file-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.file-thumbnail,
.file-type {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  padding: 0;
  border: 1px solid #c7d2cc;
  border-radius: 6px;
  background: #fff;
}

.file-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-type {
  background: #e2f0e8;
  color: #246648;
  font-size: 12px;
  font-weight: 900;
}

.file-meta {
  min-width: 0;
}

.file-name-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.file-name-open:hover strong,
.file-type-button:hover {
  color: var(--green);
}

.file-meta strong,
.file-meta small {
  display: block;
}

.file-meta strong {
  overflow: hidden;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta small {
  color: var(--muted);
  font-size: 12px;
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.file-actions .text-button,
.file-actions .google-edit-button,
.file-actions .google-edit-link {
  width: auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #bdcbc4;
  border-radius: 6px;
  background: #fff;
  color: #355248;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.google-edit-button,
.google-edit-link {
  border-color: #a9c8b8;
  background: #e6f3ec;
  color: #1d6545;
}

.google-edit-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.attachment-display-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: #355248;
  font-size: 12px;
  font-weight: 700;
}

.attachment-display-toggle input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--green);
}

.task-card-shell[aria-busy="true"] {
  opacity: 0.65;
  cursor: progress;
}

.task-card-shell[aria-busy="true"]::after {
  content: "Зберігаємо…";
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 5px;
  border-radius: 3px;
  background: #fff;
  color: #345d50;
  font-size: 11px;
  pointer-events: none;
}

.attachment-preview-dialog {
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid #69736e;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.attachment-preview-dialog::backdrop {
  background: rgba(13, 20, 17, 0.78);
}

.attachment-viewer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto 92px;
  height: 100%;
}

.attachment-viewer header,
.attachment-viewer footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 6px 12px;
  background: #fff;
}

.attachment-viewer header {
  border-bottom: 1px solid var(--line);
}

.attachment-viewer header h2 {
  overflow: hidden;
  max-width: 100%;
  font-size: 17px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-viewer header > div {
  min-width: 0;
}

.attachment-viewer header .drawer-close {
  flex-shrink: 0;
}

.attachment-preview-dialog.is-editing .attachment-viewer,
.attachment-preview-dialog.single-attachment .attachment-viewer {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#attachment-preview-select {
  width: 240px;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}

.attachment-viewer footer {
  border-top: 1px solid var(--line);
}

.attachment-workspace-toolbar {
  flex-wrap: wrap;
}

.attachment-workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.google-separate-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.google-separate-link[aria-disabled="true"] {
  border-color: #cbd3cf;
  background: #e6eae8;
  color: #7b8781;
  cursor: not-allowed;
  pointer-events: none;
}

.attachment-viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  background: #e6eae8;
}

.attachment-stage-content {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.attachment-stage-content > img {
  width: 100%;
  height: 100%;
  padding: 18px 68px;
  object-fit: contain;
  background: #1c211f;
}

.google-document-frame,
.local-document-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.document-workspace-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  width: min(560px, calc(100% - 64px));
  height: 100%;
  margin: 0 auto;
  padding: 40px;
  color: var(--ink);
  text-align: center;
}

.pdf-preview { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; color: var(--ink); background: #e8edee; }
.pdf-preview-toolbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 8px; background: #fff; border-bottom: 1px solid var(--line); }
.pdf-preview-toolbar button { width: 32px; height: 32px; padding: 0; font-size: 22px; }
.pdf-preview-toolbar label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.pdf-preview-toolbar input { width: 58px; height: 32px; padding: 4px; }
.pdf-preview-toolbar select { width: 132px; height: 32px; padding: 4px; }
.pdf-preview-status { padding: 16px; text-align: center; font-size: 14px; }
.pdf-preview-pages { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.pdf-preview-pages canvas { display: block; margin: 0 auto; max-width: none; background: white; box-shadow: 0 1px 5px #0002; }
.pdf-preview-pages canvas[hidden] { display: none; }

.document-workspace-empty h3 {
  margin: 18px 0 8px;
  font-size: 22px;
}

.document-workspace-empty p {
  max-width: 520px;
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.document-kind {
  display: grid;
  place-items: center;
  width: 68px;
  height: 76px;
  border: 1px solid #b9c9c0;
  border-radius: 7px;
  background: #dcece3;
  color: #246648;
  font-size: 14px;
  font-weight: 900;
}

.google-edit-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.google-edit-switch > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.google-edit-switch > span:last-child {
  display: grid;
  gap: 2px;
}

.google-edit-switch strong,
.google-edit-switch small {
  display: block;
}

.google-edit-switch strong {
  font-size: 13px;
}

.google-edit-switch small {
  color: var(--muted);
  font-size: 11px;
}

.switch-track {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border: 1px solid #aab7b1;
  border-radius: 999px;
  background: #cfd7d3;
  transition: background 160ms ease, border-color 160ms ease;
}

.switch-track > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(17, 33, 26, 0.25);
  transition: transform 160ms ease;
}

.google-edit-switch input:checked + .switch-track {
  border-color: var(--green);
  background: var(--green);
}

.google-edit-switch input:checked + .switch-track > span {
  transform: translateX(18px);
}

.google-edit-switch input:disabled + .switch-track {
  cursor: not-allowed;
  opacity: 0.5;
}

.attachment-workspace-strip {
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 10px 16px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: #f5f7f6;
}

.attachment-strip-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  flex: 0 0 230px;
  gap: 9px;
  min-width: 0;
  padding: 7px;
  overflow: hidden;
  border: 1px solid #cbd5d0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.attachment-strip-item.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
  background: #eaf4ef;
}

.attachment-strip-item img,
.attachment-strip-item .file-type {
  width: 52px;
  height: 52px;
  object-fit: cover;
}

.attachment-strip-item > span:last-child {
  min-width: 0;
}

.attachment-strip-item strong,
.attachment-strip-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-strip-item strong {
  font-size: 12px;
}

.attachment-strip-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.image-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(22, 28, 25, 0.76);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  transform: translateY(-50%);
}

.image-nav.previous {
  left: 14px;
}

.image-nav.next {
  right: 14px;
}

@media (max-width: 760px) {
  .task-drawer {
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    opacity: 0;
    transform: translateY(24px);
  }

  .task-drawer.open {
    opacity: 1;
    transform: translateY(0);
  }

  .task-drawer > .drawer-close {
    margin: 8px 8px -44px auto;
  }

  #task-detail {
    padding: 20px 16px 88px;
  }

  .task-detail-head {
    padding-right: 42px;
  }

  .task-detail-head h2 {
    font-size: 21px;
  }

  .attachment-gallery {
    grid-template-columns: 1fr;
  }

  .attachment-gallery-item {
    grid-template-rows: minmax(160px, 48vh) auto;
  }

  .file-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .file-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .attachment-preview-dialog {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .attachment-stage-content > img {
    padding: 10px 48px;
  }

  .attachment-viewer header h2 {
    max-width: calc(100vw - 92px);
    font-size: 15px;
  }

  .attachment-viewer {
    grid-template-rows: auto minmax(0, 1fr) auto 82px;
  }

  .attachment-workspace-toolbar {
    align-items: stretch;
    padding: 10px 12px;
  }

  .google-edit-switch {
    width: 100%;
  }

  .attachment-workspace-actions {
    display: grid;
    grid-template-columns: auto 1fr;
    width: 100%;
    min-width: 0;
  }

  .attachment-workspace-actions > button { justify-self: end; }
  .attachment-workspace-actions > a { grid-column: 1 / -1; justify-content: center; white-space: normal; }
  #attachment-preview-select { grid-column: 1 / -1; width: 100%; }

  .attachment-workspace-strip {
    padding: 8px 10px;
  }

  .attachment-strip-item {
    flex-basis: 196px;
  }
}

/* Compact task card: everyday work first, secondary settings on demand. */
.task-drawer {
  overflow: hidden;
}

#task-detail {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 26px 36px 126px;
  scrollbar-gutter: stable;
}

.task-detail-head {
  order: 1;
  padding: 0 48px 16px 0;
}

.task-detail-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
}

.task-detail-head-row .eyebrow {
  margin: 0;
}

.task-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-favorite-head {
  position: static;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  background: #fff;
}

.task-detail-head h2 {
  margin-top: 5px;
}

.task-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.task-menu-trigger {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: #52615a;
  font-size: 24px;
  line-height: 1;
}

.task-menu-trigger:hover,
.task-menu-trigger[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.task-more-menu {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 12;
  display: grid;
  width: min(340px, calc(100vw - 72px));
  overflow: hidden;
  border: 1px solid #c8d2cd;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(18, 31, 26, 0.18);
}

.task-more-menu[hidden],
.task-settings-section[hidden] {
  display: none;
}

.task-more-menu button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 54px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #e4e9e6;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.task-more-menu button:last-child {
  border-bottom: 0;
}

.task-more-menu button:hover {
  background: #edf5f1;
}

.task-more-menu .task-delete-action {
  color: var(--red);
}

.task-more-menu .task-delete-action:hover {
  background: var(--red-soft);
}

.task-more-menu strong {
  font-size: 13px;
  line-height: 1.35;
}

.task-more-menu small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.blocked-banner {
  order: 2;
}

.task-core {
  order: 3;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.task-detail-controls {
  grid-template-columns: minmax(150px, 1.2fr) repeat(3, minmax(120px, 0.9fr)) auto;
  gap: 8px;
  margin-top: 12px;
}

.task-detail-controls select,
.task-detail-controls input {
  height: 36px;
  padding: 0 9px;
}

.task-detail-controls .timer {
  min-width: 118px;
  min-height: 36px;
  padding: 7px 10px;
}

.task-facts {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.task-facts > div {
  min-width: 0;
  min-height: 46px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.task-facts > div > span {
  font-size: 11px;
  line-height: 16px;
}

.task-facts strong {
  margin-top: 0;
  padding: 7px 0;
  line-height: 18px;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-facts select,
.task-facts .task-fact-action {
  height: 32px;
  min-height: 32px;
  padding: 4px 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.task-fact-action .task-fact-value {
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: inherit;
  color: inherit;
}

.task-create-attachments {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.task-create-files-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-create-files-head > strong { font-size: 13px; }
.task-create-attachments .task-create-file-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--green);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
}
.task-create-file-picker input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.task-create-file-picker:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
[data-task-create-form].drag-over-files { outline: 2px dashed var(--green); outline-offset: -4px; }
.task-create-file-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 6px; margin-top: 8px; }
.task-create-file-list[hidden] { display: none; }
.task-create-file { display: grid; grid-template-columns: 36px minmax(0, 1fr) 30px; align-items: center; gap: 8px; min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.task-create-file img, .task-create-file-type { width: 36px; height: 36px; object-fit: contain; }
.task-create-file-type { display: grid; place-items: center; overflow: hidden; color: var(--green); font-size: 10px; font-weight: 700; background: var(--green-soft); }
.task-create-file-name { min-width: 0; }
.task-create-file-name strong, .task-create-file-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-create-file-name strong { font-size: 12px; }
.task-create-file-name small { font-size: 11px; color: var(--muted); }
.task-create-file .icon-action { min-width: 0; width: 30px; height: 30px; padding: 0; }
[data-task-create-form][aria-busy="true"] .task-create-file-picker,
[data-task-create-form][aria-busy="true"] [data-task-create-file-remove] {
  opacity: 0.5;
  pointer-events: none;
}

.task-settings-section {
  order: 4;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #cbd7d1;
  border-radius: 7px;
  background: #f7f9f8;
}

.task-settings-section .section-head {
  margin-bottom: 12px;
}

.task-settings-section .section-head .icon-action {
  flex: 0 0 auto;
}

.task-primary-section {
  padding: 18px 0;
}

.task-description-section {
  order: 5;
}

.task-files-section {
  order: 6;
}

.task-discussion-section {
  order: 7;
}

.task-recommendations-section {
  order: 7;
}

.task-agent-trigger {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #9bc8b5;
  border-radius: 6px;
  background: #f4faf7;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.task-agent-trigger:hover,
.task-agent-trigger.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.task-agent-assist {
  display: grid;
  gap: 10px;
  margin: 2px 0 18px;
  padding: 12px;
  border: 1px solid #b9d7ca;
  border-radius: 6px;
  background: #f6faf8;
}

.task-agent-intents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-agent-intents button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #cedbd5;
  border-radius: 5px;
  background: #fff;
  color: #345347;
  font-size: 12px;
  font-weight: 750;
}

.task-agent-intents button:hover,
.task-agent-intents button.active {
  border-color: #5f9f84;
  background: #e7f3ed;
  color: #135f48;
}

.task-agent-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.task-agent-compose textarea {
  min-height: 72px;
  padding: 10px 12px;
  border-color: #bfcfc8;
  background: #fff;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
}

.task-agent-compose .primary {
  min-height: 44px;
  min-width: 104px;
}

.agent-findings {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.agent-finding {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-left: 3px solid #9baca5;
  background: #f7f9f8;
}

.agent-finding.fact {
  border-left-color: #25805f;
}

.agent-finding.inference {
  border-left-color: #4b78a8;
}

.agent-finding.recommendation {
  border-left-color: #c18b18;
}

.agent-finding.unknown {
  border-left-color: #ad4d42;
}

.agent-finding span {
  color: #476258;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.agent-finding p {
  margin: 0;
  color: #263c33;
  font-size: 13px;
  line-height: 1.45;
}

.context-agent-actions {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.context-agent-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d5dfda;
  border-radius: 6px;
  background: #fff;
}

.context-agent-action.proposed {
  border-color: #dfc887;
  background: #fffaf0;
}

.context-agent-action.executed {
  border-color: #9bc8b5;
  background: #f1f8f5;
}

.context-agent-action p,
.context-agent-action small {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.context-agent-action-buttons {
  display: flex;
  gap: 6px;
}

.context-agent-action-buttons button {
  min-height: 34px;
  padding: 0 10px;
}

.task-agent-sources {
  margin-top: 10px;
}

.task-checklist-section {
  order: 8;
}

.task-description-copy {
  max-width: 780px;
  color: #263c33;
  font-size: 15px;
  line-height: 1.65;
}

.task-description-copy > p {
  margin: 0;
}

.task-result-summary {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
}

.task-result-summary strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  text-transform: uppercase;
}

.task-result-summary p {
  margin: 0;
}

.description-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.task-comment-dock {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin: 0;
  padding: 12px 36px;
  border-top: 1px solid #cbd5d0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -10px 28px rgba(18, 31, 26, 0.08);
}

.task-comment-dock.drag-over {
  background: #edf7f2;
  box-shadow: inset 0 0 0 2px #4f9b7d, 0 -10px 28px rgba(18, 31, 26, 0.08);
}

.comment-input-wrap {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.task-comment-dock textarea {
  min-height: 50px;
  max-height: 92px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.4;
  resize: vertical;
}

.comment-attach-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 64px;
  min-height: 50px;
  padding: 0 10px;
  border: 1px solid #cbd5d0;
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.comment-attach-button:hover {
  border-color: #7eb49d;
  background: var(--green-soft);
}

.comment-attach-button > span:first-child {
  font-size: 20px;
  line-height: 1;
}

.comment-attach-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.comment-file-preview-list {
  display: grid;
  gap: 5px;
}

.comment-file-preview-list[hidden] {
  display: none;
}

.comment-file-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 6px 4px 10px;
  border: 1px solid #cfe1d8;
  border-radius: 6px;
  background: var(--green-soft);
  color: #315d4c;
  font-size: 12px;
  font-weight: 700;
}

.comment-file-preview span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-file-preview > button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.comment-file-preview > button:hover {
  background: #d9ebe2;
  color: var(--ink);
}

.task-comment-dock .primary {
  min-height: 50px;
  padding-inline: 18px;
}

.comment-copy {
  min-width: 0;
}

.comment-attachment {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: min(100%, 420px);
  margin-top: 9px;
  padding: 8px;
  border: 1px solid #cfd9d4;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.comment-attachment:hover {
  border-color: #8fb9a7;
  background: #f6faf8;
}

.comment-attachment .file-type {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 5px;
  background: #e8f0fb;
  color: #315f9f;
  font-size: 12px;
  font-weight: 900;
}

.comment-attachment > span:last-child {
  min-width: 0;
}

.comment-attachment > span:last-child strong,
.comment-attachment > span:last-child small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-inline-image {
  display: block;
  width: min(100%, 620px);
  margin-top: 10px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2f0;
  cursor: zoom-in;
}

.comment-inline-image img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  background: #eef2f0;
}

.comment-image-toggle,
.comment-file-inline-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.comment-image-toggle {
  margin-top: 7px;
}

.comment-image-toggle input,
.comment-file-inline-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.comment-image-toggle input:disabled + span {
  opacity: 0.65;
}

.comment-file-inline-choice[hidden] {
  display: none;
}

.rich-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  padding: 2px;
  border-bottom: 1px solid #dfe7e3;
}

.rich-text-toolbar button {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #52625b;
  font-size: 13px;
  font-weight: 800;
}

.rich-text-toolbar button:hover,
.rich-text-toolbar button:focus-visible {
  background: #eaf3ef;
  color: var(--green);
}

.form-rich-field,
.description-form,
.comment-edit-form {
  display: grid;
  gap: 7px;
}

.form-rich-field > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-rich-field textarea {
  width: 100%;
}

.rich-line {
  display: block;
  min-height: 1.35em;
  overflow-wrap: anywhere;
}

.rich-line a {
  color: var(--blue);
  text-decoration: underline;
}

.rich-line code {
  padding: 1px 4px;
  border-radius: 3px;
  background: #edf1ef;
  color: #374b42;
  font: 0.92em/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.rich-quote {
  margin: 2px 0;
  padding: 4px 9px;
  border-left: 3px solid #9db9ac;
  color: #52645c;
}

.rich-list,
.rich-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 3px;
}

.rich-check input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.comment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.comment-head small {
  margin-top: 2px;
}

.comment-menu {
  position: relative;
  flex: 0 0 auto;
}

.comment-menu summary {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.comment-menu summary::-webkit-details-marker {
  display: none;
}

.comment-menu summary:hover,
.comment-menu[open] summary {
  background: #edf3f0;
  color: var(--ink);
}

.comment-menu > div {
  position: absolute;
  top: 31px;
  right: 0;
  z-index: 12;
  display: grid;
  min-width: 150px;
  padding: 5px;
  border: 1px solid #cad5d0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 37, 31, 0.16);
}

.comment-menu button {
  padding: 8px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.comment-menu button:hover {
  background: #edf3f0;
}

.comment-menu button.danger {
  color: #b42318;
}

.comment-body {
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.55;
}

.comment-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.comment-quick-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 3px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #66766f;
  font-size: 12px;
  font-weight: 700;
}

.comment-quick-actions button:hover,
.comment-quick-actions button.active {
  background: #e9f3ee;
  color: var(--green);
}

.comment-quick-actions strong {
  display: inline;
  font-size: inherit;
}

.comment-reply-preview,
.comment-reply-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid #7da892;
  border-radius: 0 4px 4px 0;
  background: #eef5f1;
  color: #41534b;
  text-align: left;
}

.comment-reply-preview {
  grid-template-columns: 1fr;
}

.comment-reply-preview strong,
.comment-reply-preview span,
.comment-reply-compose strong,
.comment-reply-compose span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-reply-preview span,
.comment-reply-compose span {
  margin-top: 2px;
  font-size: 12px;
}

.comment-reply-preview.missing {
  opacity: 0.72;
}

.comment-reply-compose {
  margin: 0;
}

.comment-reply-compose button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.comment-edit-form {
  margin-top: 8px;
}

.comment-edit-form textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px;
  resize: vertical;
}

.comment-edit-actions,
.comment-edit-attachment {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.comment-edit-attachment {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
}

.comment-edit-attachment label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.comment-attachments {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.comment-attachment-row {
  position: relative;
  min-width: 0;
}

.comment-attachment-row .comment-attachment {
  margin-top: 0;
}

.comment-attachment-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #e1c5c2;
  border-radius: 4px;
  background: #fff;
  color: #b42318;
  font-size: 17px;
}

@media (max-width: 1020px) {
  .employee-report-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-report-overview {
    grid-template-columns: 1fr;
  }

  .task-detail-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-detail-controls .timer {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .task-drawer {
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    transform: translateY(24px);
  }

  .task-drawer.open {
    transform: translateY(0);
  }

  #task-detail {
    padding: 18px 16px 116px;
  }

  .employee-report-head {
    gap: 10px;
  }

  .employee-report-head .ghost {
    width: 100%;
  }

  .employee-report-controls {
    grid-template-columns: 1fr;
  }

  .employee-report-overview {
    grid-template-columns: 1fr;
  }

  .company-rhythm {
    min-height: 120px;
  }

  .task-detail-head {
    padding-right: 42px;
  }

  .task-detail-head-row {
    gap: 8px;
  }

  .task-detail-head h2 {
    font-size: 20px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .task-more-menu {
    position: fixed;
    top: 54px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }

  .task-detail-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-detail-controls .timer {
    grid-column: 1 / -1;
  }

  .task-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-settings-section {
    padding: 14px 12px;
  }

  .task-description-copy {
    font-size: 14px;
    line-height: 1.6;
  }

  .task-discussion-section .section-head {
    align-items: flex-start;
    gap: 8px;
  }

  .task-agent-trigger {
    min-height: 34px;
    padding-inline: 9px;
    font-size: 12px;
  }

  .task-agent-compose,
  .context-agent-action {
    grid-template-columns: 1fr;
  }

  .task-agent-compose .primary {
    width: 100%;
  }

  .agent-finding {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .context-agent-action-buttons {
    justify-content: flex-end;
  }

  .task-comment-dock {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 9px 12px;
  }

  .task-comment-dock textarea,
  .task-comment-dock .primary {
    min-height: 48px;
  }

  .task-comment-dock .primary {
    padding-inline: 12px;
  }

  .comment-attach-button {
    min-width: 58px;
    padding-inline: 6px;
  }

  .comment-attach-button > span:first-child {
    display: none;
  }
}

/* Worksection-inspired clarity with WORKZON's own visual language. */
.sidebar {
  border-right: 1px solid #d5dfdb;
  color: var(--ink);
  box-shadow: 3px 0 14px rgba(25, 38, 33, 0.04);
}

.brand-mark {
  background: var(--tenant-accent);
}

.brand strong {
  color: var(--ink);
}

.brand small,
#sidebar-user small {
  color: var(--muted);
}

.nav-group > p {
  color: #718079;
}

.nav-btn {
  border-radius: 6px;
  color: #405049;
}

.nav-btn:hover {
  background: #f0f4f2;
  color: var(--ink);
}

.nav-btn.active {
  background: #e8f3ee;
  color: #124d3b;
}

.nav-btn.active .nav-indicator {
  background: var(--tenant-accent);
}

#sidebar-user {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

#sidebar-user:hover {
  background: #f0f4f2;
}

.connector-state {
  border-color: var(--line);
  background: #f7f9f8;
  color: var(--muted);
}

.surface {
  border-radius: 6px;
}

.avatar {
  overflow: hidden;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.avatar.profile {
  width: 112px;
  height: 112px;
  border: 4px solid #fff;
  background: #dfeee8;
  box-shadow: 0 0 0 1px #bdd0c8, 0 8px 24px rgba(25, 38, 33, 0.12);
  font-size: 27px;
}

.kanban-column {
  border-top: 3px solid var(--status-color);
  border-radius: 6px;
  background: #f5f8f7;
}

.kanban-column > header {
  padding-top: 3px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.profile-summary-panel {
  position: sticky;
  top: 18px;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.profile-summary-panel h2 {
  margin-bottom: 3px;
  font-size: 21px;
}

.profile-summary-panel p {
  margin-bottom: 7px;
  color: var(--muted);
}

.profile-status,
.presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-status::before,
.presence::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aab5b0;
  content: "";
}

.profile-status.online::before,
.presence.online::before {
  background: #20a06d;
}

.profile-status.busy::before,
.presence.busy::before {
  background: #d19522;
}

.profile-status.away::before,
.presence.away::before {
  background: #4e7ebc;
}

.avatar-upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.avatar-upload-button:hover {
  background: var(--green-soft);
}

.avatar-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.profile-facts {
  width: 100%;
  margin: 2px 0 0;
  text-align: left;
}

.profile-facts > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.profile-facts dt {
  color: var(--muted);
}

.profile-facts dd {
  margin: 0;
  font-weight: 750;
}

.profile-form {
  padding: 0;
  overflow: hidden;
}

.profile-form-head,
.profile-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.profile-form-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: #f7f9f8;
}

.profile-form-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.profile-employee-action-menu > div {
  width: min(330px, calc(100vw - 48px));
}

.profile-section {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.profile-section h3 {
  margin-bottom: 13px;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-fields .span-2 {
  grid-column: 1 / -1;
}

.profile-fields label,
.work-schedule-row > label,
.profile-inline-options > label,
.company-settings-form > label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}

.profile-fields input,
.profile-fields select,
#profile-email-code,
.work-schedule-row input,
.profile-inline-options select,
.company-settings-form input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.profile-fields input:disabled {
  background: #edf1ef;
  color: #718079;
}

.work-schedule-row {
  display: grid;
  grid-template-columns: 140px 140px minmax(280px, 1fr);
  align-items: end;
  gap: 12px;
}

.workday-picker,
.company-weekend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.workday-picker label,
.company-weekend label {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.workday-picker input,
.company-weekend input {
  position: absolute;
  opacity: 0;
}

.workday-picker label:has(input:checked),
.company-weekend label:has(input:checked) {
  border-color: #8fc4ad;
  background: var(--green-soft);
  color: var(--green);
}

.profile-inline-options {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 14px;
}

.profile-inline-options > label:first-child {
  display: flex;
  align-items: center;
}

.profile-inline-options input {
  width: 18px;
  height: 18px;
  accent-color: var(--tenant-accent);
}

.notification-matrix-head,
.notification-matrix-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, 72px);
  align-items: center;
}

.notification-matrix-head {
  margin-bottom: 8px;
}

.notification-matrix-head h3 {
  margin: 0;
}

.notification-matrix-head > div {
  display: contents;
}

.notification-matrix-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.notification-matrix-row {
  min-height: 42px;
  border-top: 1px solid #e8edeb;
}

.notification-matrix-row strong {
  font-size: 13px;
}

.notification-matrix-row label {
  display: grid;
  place-items: center;
}

.notification-matrix-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--tenant-accent);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 22px 14px;
}

.team-department + .team-department {
  margin-top: 0;
}

.team-department > header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.team-department > header h3 {
  margin: 0;
  font-size: 15px;
}

.team-department > header span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  background: #e5ece9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.team-department-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px;
}

.team-card {
  border-radius: 6px;
  background: #fff;
}

.team-person {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.team-person .presence {
  margin-top: 4px;
  font-size: 12px;
}

.profile-open-button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  font-weight: 800;
}

.profile-open-button:hover {
  background: var(--green-soft);
}

.team-risk-line {
  margin-top: 9px;
}

.company-settings {
  padding-bottom: 4px;
}

.company-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.company-settings-form .span-2 {
  grid-column: 1 / -1;
}

.company-settings-form input[type="color"] {
  padding: 4px;
}

.company-weekend legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 700;
}

.company-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.company-settings-actions span {
  color: var(--muted);
}

#employee-create-dialog,
#employee-offboarding-dialog,
#worksection-import-dialog {
  width: min(760px, calc(100vw - 28px));
  max-width: none;
}

#worksection-import-dialog {
  width: min(980px, calc(100vw - 28px));
}

.employee-create-dialog,
.employee-offboarding-dialog,
.import-preview-dialog {
  width: 100%;
}

.ghost.danger {
  border-color: #d9a6a1;
  color: #a63228;
}

.ghost.danger:hover {
  border-color: #b6463c;
  background: #fff1ef;
}

.offboarding-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.offboarding-person span,
.offboarding-person strong,
.offboarding-person small {
  display: block;
}

.offboarding-person small {
  margin-top: 3px;
  color: var(--muted);
}

.offboarding-impact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.offboarding-impact > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border-left: 3px solid #d78b82;
  background: #fff7f5;
}

.offboarding-impact strong {
  font-size: 20px;
}

.offboarding-impact span {
  color: var(--muted);
  font-size: 12px;
}

.offboarding-transfer-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0;
  border: 0;
}

.offboarding-transfer-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.offboarding-transfer-choice > label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink);
  text-transform: none;
}

.offboarding-transfer-choice > label:has(input:checked) {
  border-color: #d78b82;
  background: #fff4f2;
  box-shadow: inset 3px 0 #b6463c;
}

.offboarding-transfer-choice input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.offboarding-transfer-choice span,
.offboarding-transfer-choice strong,
.offboarding-transfer-choice small {
  display: block;
}

.offboarding-transfer-choice small,
.employee-offboarding-dialog label > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: none;
}

.offboarding-policy {
  padding: 12px 14px;
  border: 1px solid #edc0ba;
  border-radius: 7px;
  background: #fff7f5;
}

.offboarding-policy ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.offboarding-confirm {
  display: flex !important;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink) !important;
  font-size: 13px !important;
  text-transform: none !important;
}

.offboarding-confirm input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.dialog-divider {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.dialog-divider small {
  color: var(--muted);
}

.employee-access-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0;
  border: 0;
}

.employee-access-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.employee-access-choice > label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink);
  text-transform: none;
}

.employee-access-choice > label:has(input:checked) {
  border-color: #72a590;
  background: var(--green-soft);
  box-shadow: inset 3px 0 var(--green);
}

.employee-access-choice input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.employee-access-choice span,
.employee-access-choice strong,
.employee-access-choice small {
  display: block;
}

.employee-access-choice small,
.employee-create-dialog label > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: none;
}

.employee-password-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 900px) {
  .invitation-settings-row {
    grid-template-columns: 38px minmax(0, 1fr) 36px;
  }

  .invitation-status-badges,
  .invitation-expiry,
  .invitation-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }

  .invitation-action-menu {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 620px) {
  .employee-access-choice,
  .employee-password-fields,
  .offboarding-transfer-choice,
  .offboarding-impact {
    grid-template-columns: 1fr;
  }

  .invitation-settings-row {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
  }

  .invitation-status-badges,
  .invitation-expiry,
  .invitation-actions {
    grid-column: 2 / -1;
  }
}

.import-preview-body {
  display: grid;
  gap: 16px;
  max-height: min(68vh, 720px);
  overflow: auto;
  padding-right: 3px;
}

.import-preview-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.import-preview-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
}

.import-preview-summary p {
  margin: 4px 0 0;
  color: var(--muted);
}

.dry-run-mark {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--green);
  font-weight: 800;
}

.import-total-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.import-total-grid > div {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
}

.import-total-grid > div:last-child {
  border-right: 0;
}

.import-total-grid small,
.import-total-grid strong {
  display: block;
}

.import-total-grid small {
  min-height: 28px;
  color: var(--muted);
}

.import-total-grid strong {
  margin-top: 3px;
  font-size: 19px;
}

.import-preview-columns,
.import-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.import-preview-columns > section,
.import-note-grid > section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.import-preview-columns h3,
.import-note-grid h3 {
  margin: 0 0 9px;
  font-size: 14px;
}

.status-map-list,
.entity-map-list {
  display: grid;
  gap: 4px;
}

.status-map-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.status-map-list b {
  color: var(--muted);
  text-align: center;
}

.entity-map-list > div {
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}

.entity-map-list strong,
.entity-map-list small {
  display: block;
}

.entity-map-list small {
  margin-top: 2px;
  color: var(--muted);
}

.import-note-grid ol {
  margin: 0;
  padding-left: 20px;
}

.import-note-grid li + li {
  margin-top: 7px;
}

.import-warning {
  background: var(--amber-soft);
}

.import-warning p {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 6px;
  margin: 7px 0 0;
}

.import-warning p span {
  color: var(--amber);
  font-weight: 900;
}

@media (max-width: 1180px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1020px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-summary-panel {
    position: static;
    grid-template-columns: auto minmax(0, 1fr) auto;
    justify-items: start;
    text-align: left;
  }

  .profile-facts {
    grid-column: 1 / -1;
  }

  .work-schedule-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workday-picker {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .profile-summary-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .profile-facts {
    grid-column: auto;
  }

  .profile-form-head,
  .profile-form-footer,
  .profile-inline-options,
  .company-settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-form-head-actions {
    width: 100%;
  }

  .profile-form-head-actions > .primary {
    flex: 1;
  }

  .profile-employee-action-menu > div {
    right: auto;
    left: 0;
    width: min(300px, calc(100vw - 40px));
  }

  .profile-fields,
  .work-schedule-row,
  .company-settings-form,
  .team-grid,
  .team-department-grid {
    grid-template-columns: 1fr;
  }

  .profile-fields .span-2,
  .company-settings-form .span-2,
  .workday-picker {
    grid-column: auto;
  }

  .notification-matrix-head,
  .notification-matrix-row {
    grid-template-columns: minmax(140px, 1fr) repeat(3, 48px);
  }

  .notification-matrix-head span {
    font-size: 12px;
  }

  .launch-summary,
  .readiness-steps,
  .system-metrics,
  .import-preview-columns,
  .import-note-grid {
    grid-template-columns: 1fr;
  }

  .launch-summary {
    justify-items: start;
  }

  .system-metrics > div,
  .import-total-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .system-metrics > div:last-child,
  .import-total-grid > div:last-child {
    border-bottom: 0;
  }

  .backup-status,
  .import-preview-summary,
  .dialog-divider {
    align-items: stretch;
    flex-direction: column;
  }

  .import-total-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-total-grid > div:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .import-total-grid > div:last-child {
    border-right: 1px solid var(--line);
  }
}

.top-profile-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
}

.top-profile-button {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 148px;
  max-width: 210px;
  height: 42px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.top-profile-button:hover,
.top-profile-menu-button:hover,
.top-profile-menu-button[aria-expanded="true"] {
  border-color: #9fc5b5;
  background: var(--green-soft);
}

.top-profile-button:hover + .top-profile-menu-button,
.top-profile-wrap:has(.top-profile-menu-button:hover) .top-profile-button,
.top-profile-wrap:has(.top-profile-menu-button[aria-expanded="true"]) .top-profile-button {
  border-color: #9fc5b5;
  background: var(--green-soft);
}

.top-profile-menu-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
  background: #fff;
  color: var(--muted);
  font-size: 23px;
  line-height: 1;
}

.top-profile-button.attention + .top-profile-menu-button {
  border-color: #d49a38;
  background: var(--amber-soft);
  color: var(--amber);
}

.top-profile-menu-button:focus-visible {
  outline: 3px solid rgba(23, 107, 82, 0.2);
  outline-offset: 2px;
}

.top-profile-button > span:last-child,
.profile-context-head > span:last-child {
  min-width: 0;
}

.top-profile-button strong,
.top-profile-button small,
.profile-context-head strong,
.profile-context-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-profile-button strong {
  font-size: 13px;
}

.top-profile-button small,
.profile-context-head small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.top-profile-button.attention::after {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--amber);
  content: "";
}

.profile-context-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 80;
  width: 248px;
  padding: 6px;
  border: 1px solid #cbd7d2;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(18, 31, 26, 0.18);
}

.profile-context-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 0 4px 5px;
  padding: 7px 5px 11px;
  border-bottom: 1px solid var(--line);
}

.profile-context-menu > button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.profile-context-menu > button:hover,
.profile-context-menu > button:focus-visible {
  background: #edf4f1;
  color: var(--green);
}

.profile-context-menu > [data-profile-menu-action="password"] {
  margin-top: 5px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 5px 5px;
}

.profile-context-menu > .profile-context-danger {
  color: var(--red);
}

.profile-context-menu > .profile-context-danger:hover,
.profile-context-menu > .profile-context-danger:focus-visible {
  background: var(--red-soft);
  color: var(--red);
}

@media (max-width: 1020px) {
  .top-profile-wrap {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .top-profile-button {
    width: min(220px, 100%);
    max-width: none;
  }
}

/* Completion acceptance is a first-class task workflow. */
.task-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 5px;
}

.task-title-row h2 {
  min-width: 0;
  margin: 0;
}

.task-close-main {
  flex: 0 0 auto;
  min-width: 158px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #176b52;
  border-radius: 6px;
  background: #176b52;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.task-close-main:hover:not(:disabled) {
  border-color: #0f5943;
  background: #0f5943;
}

.task-close-main.reopen {
  border-color: #9b6507;
  background: #9b6507;
}

.task-close-main.reopen:hover:not(:disabled) {
  border-color: #7f5103;
  background: #7f5103;
}

.task-close-main.accepted,
.task-close-main.waiting {
  border-color: #c8d3ce;
  background: #edf2f0;
  color: #63716b;
}

.completion-gate {
  order: 2;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  margin: 4px 0 10px;
  padding: 12px 14px;
  border: 1px solid #d8c584;
  border-radius: 7px;
  background: #fff9e9;
  color: #3d392b;
}

.completion-gate.accepted {
  border-color: #a8cfbd;
  background: #edf8f2;
  color: #184f3d;
}

.completion-gate.returned {
  border-color: #e7b2a4;
  background: #fff2ee;
  color: #78392d;
}

.completion-gate-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  font-weight: 900;
}

.completion-gate strong,
.completion-gate p,
.completion-gate small {
  display: block;
}

.completion-gate p {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.completion-gate small {
  margin-top: 5px;
  color: inherit;
  opacity: 0.72;
}

.completion-gate blockquote {
  margin: 8px 0 0;
  padding-left: 10px;
  border-left: 2px solid #70a88f;
  font-size: 13px;
  line-height: 1.45;
}

.completion-review-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 10px;
}

.completion-review-form textarea {
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid #cfc5a1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.completion-review-form .ghost.danger {
  min-height: 40px;
  border-color: #d7a195;
  color: #9b3f31;
}

.task-approval-mark {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #eef2f0;
  color: #53615b;
  font-size: 11px;
  font-weight: 800;
}

.task-approval-mark.pending {
  background: #fff1c9;
  color: #77530e;
}

.task-approval-mark.returned {
  background: #ffebe5;
  color: #963c2e;
}

.task-approval-mark.approved {
  background: #e7f5ee;
  color: #176b52;
}

.organization-surface {
  min-width: 0;
}

.organization-root {
  position: relative;
  display: flex;
  align-items: center;
  width: fit-content;
  min-width: 260px;
  gap: 10px;
  margin: 4px auto 30px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.organization-root::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 26px;
  background: #b8c6c0;
  content: "";
}

.organization-company-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: var(--organization-color);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.organization-root > div:last-child {
  display: grid;
  gap: 3px;
}

.organization-root span {
  color: var(--muted);
  font-size: 11px;
}

.organization-chart {
  display: grid;
  gap: 28px;
  min-width: 0;
  padding: 0 2px 12px;
}

.organization-level {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 12px;
  min-width: max-content;
}

.organization-level:not(:first-child)::before {
  position: absolute;
  top: -28px;
  left: 50%;
  width: 1px;
  height: 28px;
  background: #b8c6c0;
  content: "";
}

.organization-level::after {
  position: absolute;
  top: -1px;
  right: 10%;
  left: 10%;
  height: 1px;
  background: #b8c6c0;
  content: "";
}

.organization-level:first-child::after {
  display: none;
}

.department-card {
  width: min(320px, calc(100vw - 40px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid var(--department-color);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(28, 43, 37, 0.06);
}

.department-card > header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.department-card > header h3 {
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.department-card > header small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.department-code {
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--department-color) 14%, white);
  color: var(--department-color);
  font-size: 10px;
  font-weight: 900;
}

.department-lead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.department-lead > span {
  display: grid;
  min-width: 0;
}

.department-lead small,
.department-members > small,
.department-fallback > small {
  color: var(--muted);
  font-size: 10px;
}

.department-lead strong,
.department-lead em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.department-lead em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.department-deputy {
  grid-column: 2;
  padding-top: 5px;
  border-top: 1px solid #edf1ef;
}

.department-load,
.department-members,
.department-fallback {
  padding: 8px 10px;
  border-top: 1px solid #edf1ef;
}

.department-load > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.department-load > span + span {
  margin-top: 3px;
}

.department-load .progress {
  margin-top: 7px;
}

.department-members > div {
  display: flex;
  align-items: center;
  min-height: 30px;
  margin-top: 4px;
}

.department-members .avatar + .avatar {
  margin-left: -6px;
  border: 2px solid #fff;
}

.department-fallback ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: fallback;
}

.department-fallback li {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 22px;
  padding: 2px 6px;
  border-radius: 5px;
  background: #eef2f0;
  color: #4d5a55;
  font-size: 10px;
  counter-increment: fallback;
}

.department-fallback li::before {
  color: var(--department-color);
  font-weight: 900;
  content: counter(fallback) ".";
}

.department-reassign {
  border-top: 1px solid var(--line);
}

.department-reassign summary {
  padding: 9px 10px;
  color: var(--green);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.department-reassign form {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
}

.department-reassign label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.department-reassign select {
  min-width: 0;
  height: 34px;
}

.employee-report-task-row > span:nth-child(3) small {
  display: block;
  margin: 3px 0 0 19px;
  color: var(--muted);
  font-size: 11px;
}

.department-route-strip {
  display: grid;
  grid-template-columns: minmax(170px, 0.65fr) minmax(440px, 1.35fr);
  align-items: center;
  gap: 14px;
  margin: 10px 0 2px;
  padding: 10px 12px;
  border: 1px solid #c9d9d2;
  border-radius: 7px;
  background: #f5faf8;
}

.department-route-strip > div {
  display: grid;
  gap: 2px;
}

.department-route-strip > div span {
  color: var(--muted);
  font-size: 11px;
}

.department-route-strip ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(64px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.department-route-strip li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--muted);
  text-align: center;
}

.department-route-strip li::before {
  position: absolute;
  top: 11px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: #d3ddd9;
  content: "";
}

.department-route-strip li:first-child::before {
  display: none;
}

.department-route-strip li > span {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #c5d1cc;
  border-radius: 50%;
  background: #fff;
  font-size: 10px;
  font-weight: 900;
}

.department-route-strip li.done::before,
.department-route-strip li.done > span,
.department-route-strip li.active::before {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.department-route-strip li.active > span {
  border-color: var(--green);
  color: var(--green);
}

.department-route-strip li small {
  font-size: 9px;
}

.department-route-people {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.department-route-people > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.department-route-people > div > span {
  display: grid;
  min-width: 0;
}

.department-route-people strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.department-route-people small {
  color: var(--muted);
  font-size: 9px;
}

.department-delegate-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 10px;
}

.department-delegate-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}

.activity-assignee-change {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  color: var(--ink);
  font-size: 11px;
}

.activity-assignee-change > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.activity-assignee-change .previous {
  color: var(--muted);
  text-decoration: line-through;
}

.activity-assignee-change b {
  color: var(--green);
}

.calendar-page-head,
.calendar-head-actions,
.calendar-navigation,
.calendar-connection,
.calendar-card-actions,
.calendar-access-actions {
  display: flex;
  align-items: center;
}

.calendar-page-head {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.calendar-page-head h2 {
  margin: 2px 0 4px;
  font-size: 24px;
}

.calendar-page-head p {
  margin: 0;
  color: var(--muted);
}

.calendar-head-actions,
.calendar-navigation {
  gap: 8px;
}

.segmented.calendar-mode-switch {
  grid-template-columns: repeat(2, minmax(84px, 1fr));
  min-width: 170px;
}

.calendar-navigation .icon-action {
  width: 38px;
  height: 38px;
  font-size: 22px;
}

.calendar-connection {
  justify-content: flex-start;
  gap: 10px 18px;
  min-height: 54px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #d7c99a;
  border-radius: 7px;
  background: #fffaf0;
}

.calendar-connection.ready {
  border-color: #b9d7ca;
  background: #f1f8f5;
}

.calendar-connection strong {
  color: var(--ink);
  font-size: 13px;
}

.calendar-connection span {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
}

.calendar-surface {
  padding: 0;
  overflow: hidden;
}

.calendar-week-scroll {
  overflow-x: auto;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  min-width: 1050px;
}

.calendar-day {
  position: relative;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  min-height: 390px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.calendar-day:last-child {
  border-right: 0;
}

.calendar-day-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #f7f9f8;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.calendar-day-button:hover,
.calendar-day-button:focus-visible {
  background: #edf5f1;
}

.calendar-day-button > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-day-button > strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 64px;
  justify-content: flex-end;
}

.calendar-day-button > strong b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
}

.calendar-day-button > strong small {
  color: #52625c;
  font-size: 11px;
  font-weight: 800;
  text-transform: lowercase;
}

.calendar-day.today {
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--green);
}

.calendar-day.today .calendar-day-button {
  background: #eef7f3;
}

.calendar-day.today .calendar-day-button > strong b {
  background: var(--green);
  color: #fff;
}

.calendar-day.selected:not(.today) {
  z-index: 1;
  box-shadow: inset 0 0 0 2px #84aa9b;
}

.calendar-day-events {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 8px;
}

.calendar-day-empty {
  padding: 12px 3px;
  color: #9aa6a1;
  font-size: 11px;
}

.calendar-day-detail {
  position: relative;
  background: #fff;
}

.calendar-day-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #f7f9f8;
}

.calendar-day-detail-head div,
.calendar-day-detail-head h3 {
  margin: 0;
}

.calendar-day-detail-head span {
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-day-detail-head h3 {
  margin-top: 3px;
  font-size: 17px;
  text-transform: capitalize;
}

.calendar-day-detail-head > strong {
  color: var(--muted);
  font-size: 12px;
}

.calendar-all-day {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line);
}

.calendar-all-day > span {
  padding-top: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

.calendar-all-day > div {
  display: grid;
  gap: 5px;
}

.calendar-day-timeline-scroll {
  max-height: 630px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.calendar-day-timeline {
  position: relative;
  min-height: 1344px;
}

.calendar-hour-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  height: 56px;
}

.calendar-hour-row time {
  position: relative;
  top: -7px;
  padding-right: 10px;
  color: #7c8984;
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.calendar-hour-row > span {
  border-top: 1px solid #e4e9e7;
}

.calendar-timeline-events {
  position: absolute;
  inset: 0 12px 0 74px;
  pointer-events: none;
}

.timeline-meeting {
  position: absolute;
  top: var(--event-top);
  left: calc((100% / var(--event-columns)) * var(--event-column) + 4px);
  width: calc(100% / var(--event-columns) - 8px);
  height: var(--event-height);
  min-height: 38px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid #9fc9b8;
  border-left: 4px solid var(--green);
  border-radius: 5px;
  background: #edf7f3;
  box-shadow: 0 2px 7px rgba(23, 72, 55, 0.08);
  pointer-events: auto;
}

.timeline-meeting-copy {
  display: grid;
  flex: 1 1 0;
  min-width: 0;
  gap: 2px;
}

.timeline-meeting-copy strong,
.timeline-meeting-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-meeting-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; margin-left: auto; }
.timeline-meeting-actions .meeting-edit-action { flex-basis: 24px; width: 24px; height: 24px; }

.timeline-meeting-copy strong {
  font-size: 12px;
}

.timeline-meeting-copy span {
  color: var(--muted);
  font-size: 10px;
}

.timeline-meet-link {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 4px;
  background: #1a73e8;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.calendar-now-line {
  position: absolute;
  z-index: 3;
  top: var(--now-offset);
  right: 12px;
  left: 74px;
  height: 2px;
  background: #d6463a;
  pointer-events: none;
}

.calendar-now-line::before {
  position: absolute;
  top: -4px;
  left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d6463a;
  content: "";
}

.calendar-now-line span {
  position: absolute;
  top: -10px;
  left: 8px;
  width: auto;
  padding: 1px 4px;
  border-radius: 3px;
  background: #fff;
  color: #c0392f;
  font-size: 9px;
  font-weight: 900;
}

.calendar-day-no-events {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 42px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
  text-align: center;
}

.calendar-day-no-events strong {
  font-size: 12px;
}

.calendar-day-no-events span {
  color: var(--muted);
  font-size: 10px;
}

.meeting-card {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.meeting-card.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  align-items: start;
  gap: 4px 8px;
  min-height: 0;
  padding: 9px;
  border: 1px solid #c9dbd4;
  border-radius: 6px;
  background: #f5faf8;
}

.meeting-card.compact .meeting-card-time {
  grid-column: 1;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.meeting-card.compact .meeting-card-copy {
  grid-column: 1 / -1;
}

.meeting-card.compact .meeting-attendees,
.meeting-card.compact .meeting-no-attendees {
  display: none;
}

.meeting-card.compact .meeting-card-actions {
  grid-column: 2;
  grid-row: 1;
}

.meeting-card.compact .meeting-link {
  padding: 4px 6px;
  font-size: 9px;
}

.meeting-card.compact .meeting-open-google {
  display: none;
}

.meeting-card-time {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.meeting-card-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.meeting-card-copy strong,
.meeting-card-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.meeting-card-copy strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.meeting-card-copy span,
.meeting-no-attendees {
  color: var(--muted);
  font-size: 10px;
}

.meeting-attendees {
  display: flex;
  align-items: center;
  gap: 4px;
}

.meeting-attendees small {
  color: var(--muted);
  font-size: 10px;
}

.meeting-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.meeting-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #1a73e8;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.meeting-open-google {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.meeting-cancel {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #d7a6a1;
  border-radius: 6px;
  background: #fff;
  color: #a2322a;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.meeting-cancel:hover {
  border-color: #b42318;
  background: #fff6f5;
}

.meeting-cancel:disabled {
  cursor: wait;
  opacity: 0.65;
}

.calendar-upcoming-surface {
  margin-top: 14px;
}

.calendar-upcoming {
  display: grid;
}

.meeting-create-dialog {
  width: 100%;
  min-width: 0;
}

.meeting-edit-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.meeting-edit-note { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.meeting-edit-action { flex: 0 0 28px; width: 28px; height: 28px; }
.meeting-edit-action[aria-disabled="true"] { opacity: .45; }
#meeting-edit-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
#meeting-edit-dialog p { margin: 0; }
#meeting-edit-dialog .dialog-actions { position: sticky; bottom: -20px; background: #fff; padding: 12px 0; border-top: 1px solid var(--line); z-index: 2; }
#meeting-edit-dialog .meeting-participant { min-width: 0; }
#meeting-edit-dialog .meeting-participant input { flex: 0 0 18px; width: 18px; height: 18px; padding: 0; }
#meeting-edit-dialog .meeting-participant strong { font-size: 13px; }
#meeting-edit-dialog .meeting-participant span { text-transform: none; }
#meeting-edit-dialog .meeting-participant small { overflow-wrap: anywhere; }

.meeting-meet-option {
  align-self: end;
  min-height: 38px;
}

.meeting-participants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-height: 136px;
  max-height: 224px;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.meeting-participant {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.meeting-participant:has(input:checked) {
  border-color: #8dbca8;
  background: #f0f8f4;
}

.meeting-participant.initiator {
  cursor: default;
}

.meeting-participant span {
  display: grid;
  min-width: 0;
}

.meeting-participant small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-access-settings {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.calendar-access-settings form,
.calendar-access-users {
  display: grid;
  gap: 8px;
}

.calendar-access-note,
.calendar-access-actions {
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.calendar-access-note {
  display: flex;
  align-items: center;
}

.calendar-access-note span,
.calendar-access-actions span {
  color: var(--muted);
  font-size: 11px;
}

.calendar-access-users {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.calendar-access-users > label {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.calendar-access-users > label:has(input:checked) {
  border-color: #8dbca8;
  background: #f0f8f4;
}

.calendar-access-users > label span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.calendar-access-users > label small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1020px) {
  .organization-chart {
    overflow-x: auto;
  }

  .department-route-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .calendar-page-head,
  .calendar-connection,
  .calendar-access-note,
  .calendar-access-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-head-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .calendar-mode-switch,
  .calendar-head-actions > button:last-child {
    grid-column: 1 / -1;
  }

  .calendar-head-actions > button,
  .calendar-mode-switch {
    width: 100%;
  }

  .calendar-day-timeline-scroll {
    max-height: 560px;
  }

  .calendar-day-no-events {
    flex-direction: column;
  }

  .calendar-hour-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .calendar-timeline-events {
    left: 58px;
  }

  .calendar-now-line {
    left: 58px;
  }

  .calendar-now-line span {
    display: none;
  }

  .meeting-card:not(.compact) {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .meeting-card:not(.compact) .meeting-attendees,
  .meeting-card:not(.compact) .meeting-no-attendees {
    grid-column: 2;
  }

  .meeting-card:not(.compact) .meeting-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .meeting-link {
    justify-content: center;
    min-width: 120px;
  }

  .calendar-access-users {
    grid-template-columns: 1fr;
  }

  .meeting-participants {
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .planning-agent-summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .planning-agent-summary > button,
  .planning-total {
    grid-column: 1 / -1;
  }

  .organization-level {
    justify-content: flex-start;
  }

  .department-route-strip ol {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    overflow-x: auto;
  }

  .department-route-people,
  .department-delegate-form {
    grid-template-columns: 1fr;
  }

  .department-route-people > span {
    display: none;
  }

  .task-title-row {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .task-close-main {
    width: 100%;
    min-width: 0;
  }

  .completion-gate {
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 11px;
  }

  .completion-gate-icon {
    width: 28px;
    height: 28px;
  }

  .completion-review-form {
    grid-template-columns: 1fr;
  }

  .completion-review-form .ghost.danger {
    width: 100%;
  }
}

/* Keep the Chats 2.0 layout authoritative over earlier responsive rules. */
.chat-sidebar {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.chat-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  min-height: 62px;
}

#chat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
}

@media (max-width: 760px) {
  #chats-view.active {
    margin: -4px -8px 0;
  }

  #chats-view .chat-layout {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #chats-view .chat-sidebar,
  #chats-view .chat-box {
    width: 100%;
    max-height: none;
    border-radius: 0;
  }

  #chats-view .chat-sidebar {
    display: grid;
    height: calc(100dvh - 236px);
    min-height: 430px;
  }

  #chats-view .chat-box {
    display: none;
    height: calc(100dvh - 236px);
    min-height: 430px;
  }

  #chats-view.chat-mobile-open .chat-sidebar {
    display: none;
  }

  #chats-view.chat-mobile-open .chat-box {
    display: grid;
    position: fixed;
    inset: 0 0 calc(58px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    height: auto;
    min-height: 0;
  }

  #chats-view #chat-head {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
  }

  #chats-view .chat-mobile-back {
    display: inline-grid;
  }

  .chat-type-picker,
  .chat-member-options,
  .chat-department-options {
    grid-template-columns: 1fr;
  }
}
/* Task access controls share the task form grid without adding a nested card. */
.task-visibility { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; display: grid; gap: 8px; }
.quick-form > [data-task-visibility-mount] { grid-column: 1 / -1; min-width: 0; }
.quick-form .task-visibility { margin-bottom: 0; }
.task-visibility legend { font-weight: 700; margin-bottom: 8px; }
.task-visibility > select { width: 100%; min-width: 0; }
.task-visibility small { color: var(--muted, #52676b); line-height: 1.5; }
.visibility-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; max-height: 176px; overflow-y: auto; padding: 4px 0; }
.visibility-choices[hidden] { display: none; }
.visibility-choices .visibility-choice { display: flex; align-items: center; gap: 8px; padding: 6px 0; min-width: 0; text-transform: none; letter-spacing: 0; }
.visibility-choice input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; }
.visibility-choice span { overflow-wrap: anywhere; }
@media (max-width: 600px) { .visibility-choices { grid-template-columns: minmax(0, 1fr); } }
.feedback-attachment-preview:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.feedback-attachment-preview img {
  width: 96px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--line, #dbe4e2);
  border-radius: 4px;
}
.feedback-attachment-preview span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.feedback-attachment-preview button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 22px;
}

.profile-identity-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 12px 0;
}
.profile-identity-actions label { display: grid; gap: 6px; max-width: 100%; color: var(--muted); font-weight: 700; }
#profile-email-code { width: 160px; max-width: 100%; }
#profile-identity-section p { overflow-wrap: anywhere; }
.profile-identity-actions button { max-width: 100%; white-space: normal; }

.task-recommendation {
  min-width: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.task-recommendation header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  font-size: 12px;
}
.task-recommendation header span,
.task-recommendation time { color: var(--muted); }
.task-recommendation h4 { margin: 10px 0 8px; font-size: 15px; }
.task-recommendation-body { white-space: pre-wrap; line-height: 1.55; }
.task-recommendation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.task-recommendation-actions button { max-width: 100%; white-space: normal; }
/* Delivery receipts do not imply inbox delivery or task completion. */
.notification-delivery {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.telegram-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.telegram-actions > a { text-decoration: none; padding: 9px 14px; border-radius: 4px; }
#profile-telegram-status { overflow-wrap: anywhere; }
:root { --news-divider: #dce4e1; }
.news-layout { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 28px; align-items: start; }
.news-list-item { display: grid; gap: 8px; width: 100%; padding: 18px 12px; border: 0; border-bottom: 1px solid var(--news-divider); border-radius: 0; text-align: left; background: transparent; color: inherit; white-space: normal; overflow-wrap: anywhere; }
.news-list-item.active { background: #e7f3ed; box-shadow: inset 3px 0 #176b52; }
.news-list-item small, .news-list-item span { color: #596b64; font-weight: 400; }
.news-list-item strong { font-size: 15px; line-height: 1.5; }
.news-detail { min-width: 0; max-width: 860px; padding: 18px 0; }
.news-detail h2 { font-size: 24px; line-height: 1.35; overflow-wrap: anywhere; }
.news-detail .section-head { flex-wrap: wrap; gap: 12px; }
.news-body { overflow-wrap: anywhere; line-height: 1.75; margin: 24px 0; }
.news-plain { white-space: pre-wrap; }
.news-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.news-audience-summary { color: var(--muted); font-size: 13px; }
.news-files { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: start; gap: 12px; }
.news-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; border: 1px solid var(--news-divider); border-radius: 6px; padding: 10px; }
.news-file > a:has(.news-file-image) { width: 100%; }
.news-file-image { display: block; width: 100%; height: 160px; object-fit: contain; background: #f4f7f6; }
.news-file-icon { flex-shrink: 0; }
.news-file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; text-decoration: none; color: var(--text); }
.news-file-name small { display: block; margin-top: 4px; color: var(--muted); }
.news-file .icon-action { flex: 0 0 30px; }
.news-attachments { margin: 24px 0; }
.news-attachments h3 { font-size: 15px; }
.news-publish { padding-top: 20px; border-top: 1px solid var(--news-divider); }
.news-publish button { white-space: normal; }
#news-edit-dialog { width: min(900px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); background: #fff; }
body:has(#news-edit-dialog[open]) { overflow: hidden; }
#news-edit-form { display: grid; gap: 18px; padding: 24px; }
#news-edit-form h2 { font-size: 21px; margin: 0; }
#news-edit-form > .section-head { gap: 16px; margin-bottom: 0; }
#news-edit-form label { display: grid; gap: 6px; }
#news-edit-form textarea { width: 100%; min-height: 220px; resize: vertical; }
.news-fields { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; }
.news-text-field { min-width: 0; display: grid; gap: 6px; }
#news-edit-form .ql-editor { min-height: 190px; max-height: 340px; }
.news-text-field .ql-toolbar { border-radius: 6px 6px 0 0; background: #f5f8f7; }
.news-text-field .ql-container { border-radius: 0 0 6px 6px; }
.news-file-section .section-head { gap: 12px; margin-bottom: 10px; }
.news-file-section small { color: var(--muted); font-weight: 400; margin-left: 6px; }
#news-add-files { display: inline-flex; align-items: center; gap: 6px; }
.news-audience { padding: 16px 0 0; margin: 0; border: 0; border-top: 1px solid var(--news-divider); min-width: 0; }
.news-audience legend { font-weight: 600; padding: 0 10px 0 0; }
.news-audience-modes { display: flex; gap: 12px 24px; flex-wrap: wrap; }
#news-edit-form .news-audience label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; text-transform: none; letter-spacing: 0; }
#news-edit-form .news-audience input:is([type="radio"], [type="checkbox"]) { width: 16px; height: 16px; margin: 0; flex: 0 0 16px; accent-color: #16745e; }
#news-recipient-picker { margin-top: 14px; }
#news-recipient-search { width: 100%; }
#news-recipients { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; max-height: 190px; overflow: auto; margin: 10px 0; }
#news-recipients label { padding: 7px 0; overflow-wrap: anywhere; min-width: 0; }
#news-edit-status:empty { display: none; }
#news-edit-form .dialog-actions { border-top: 1px solid var(--news-divider); padding-top: 16px; margin-top: 0; }
#news-edit-form .dialog-actions button { white-space: normal; }
#news-view > .section-head { flex-wrap: wrap; gap: 12px; }
@media (max-width: 760px) {
  .news-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #news-list { max-height: 250px; overflow: auto; }
  .news-detail h2 { font-size: 20px; }
  #news-edit-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  #news-edit-form { padding: 16px; gap: 16px; }
  .news-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #news-recipients { grid-template-columns: minmax(0, 1fr); }
  #news-edit-form .ql-editor { min-height: 160px; }
}
