:root {
  color: #20211f;
  background: #f3f0e9;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 0.7rem;
  color: #fff;
  background: #d64b2a;
  font-weight: 800;
  box-shadow: 0 5px 14px rgb(159 48 23 / 20%);
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #68685f;
  font-size: 0.9rem;
}

.button {
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.button:focus-visible,
input:focus-visible,
.model-tab:focus-visible,
.text-button:focus-visible,
.icon-button:focus-visible,
select:focus-visible,
.entity-dialog:focus-visible,
textarea:focus-visible,
.task-remove:focus-visible {
  outline: 3px solid rgb(214 75 42 / 35%);
  outline-offset: 2px;
}

.button-primary {
  color: #fff;
  background: #20211f;
}

.button-primary:hover {
  background: #373834;
}

.button-secondary {
  border-color: #d7d2c8;
  color: #20211f;
  background: #fff;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 2.75rem auto 6rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: #d64b2a;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 0.8rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.api-message {
  max-width: 580px;
  color: #68685f;
  line-height: 1.6;
}

:is(
  #asset-tile-001,
  #asset-tile-003,
  #asset-tile-004,
  #asset-tile-005,
  #asset-tile-006,
  #asset-tile-007,
  #asset-tile-008,
  #asset-tile-009,
  #asset-tile-010,
  #asset-tile-011,
  #asset-tile-012,
  #asset-tile-013,
  #asset-tile-014,
  #asset-tile-015,
  #asset-tile-016,
  #asset-tile-017
),
#asset-tile-019,
#asset-tile-002 {
  border: 1px solid #ded9ce;
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 84%);
  box-shadow: 0 20px 70px rgb(63 54 40 / 8%);
}

#asset-tile-001 {
  margin-top: 1rem;
  padding: clamp(1.25rem, 4vw, 2rem);
}

:is(
  #asset-tile-003,
  #asset-tile-004,
  #asset-tile-005,
  #asset-tile-006,
  #asset-tile-007,
  #asset-tile-008,
  #asset-tile-009,
  #asset-tile-010,
  #asset-tile-011,
  #asset-tile-012,
  #asset-tile-013,
  #asset-tile-014,
  #asset-tile-015,
  #asset-tile-016,
  #asset-tile-017
) {
  padding: clamp(1.25rem, 3vw, 2rem);
}

#asset-tile-019 {
  margin-bottom: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.project-context-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.project-workspace-panel .workspace-message {
  margin: 1rem 0 0;
  color: #68685f;
}

.project-workspace-panel .workspace-message[data-tone="success"] {
  color: #437849;
}

.data-workspace {
  margin-bottom: 1rem;
  border: 1px solid #d8d2c7;
  border-radius: 1.25rem;
  padding: 1rem;
  background: #272822;
  box-shadow: 0 20px 70px rgb(63 54 40 / 12%);
}

.workspace-context {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.5rem 0.5rem 1rem;
  color: #fff;
}

.workspace-context .eyebrow {
  color: #f18467;
}

.tenant-field {
  display: grid;
  gap: 0.4rem;
  color: #d7d6ce;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tenant-controls {
  display: flex;
  gap: 0.5rem;
}

.tenant-controls input {
  min-width: min(320px, 42vw);
  border: 1px solid #52534c;
  border-radius: 0.65rem;
  padding: 0.68rem 0.8rem;
  color: #fff;
  background: #373832;
}

.model-navigation {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.5rem;
  scrollbar-width: thin;
}

.model-tab {
  flex: 0 0 auto;
  border: 1px solid #4d4e47;
  border-radius: 999px;
  padding: 0.58rem 0.8rem;
  color: #d9d8d1;
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.model-tab:hover,
.model-tab-active {
  border-color: #ef7657;
  color: #fff;
  background: #d64b2a;
}

.workspace-message {
  min-height: 1.25rem;
  margin: 0.4rem 0.5rem 0;
  color: #cfcec7;
  font-size: 0.85rem;
}

.workspace-message[data-tone="error"],
.form-message {
  color: #a72f15;
}

.workspace-message[data-tone="success"] {
  color: #a9d5ac;
}

.panel-description {
  max-width: 720px;
  margin: 0.55rem 0 1.4rem;
  color: #68685f;
  line-height: 1.55;
}

.record-count {
  color: #68685f;
  font-size: 0.88rem;
}

.entity-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.search-field input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d7d2c8;
  border-radius: 0.7rem;
  padding: 0.72rem 0.85rem;
  color: #20211f;
  background: #fff;
}

.button-accent {
  color: #fff;
  background: #d64b2a;
}

.button-accent:hover {
  background: #b83b20;
}

.entity-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.entity-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  border: 1px solid #e5e0d7;
  border-radius: 0.9rem;
  padding: 1rem;
  background: #fff;
}

.entity-card h3,
.detail-heading h3 {
  margin: 0 0 0.35rem;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card code {
  display: block;
  overflow: hidden;
  color: #5f605a;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-meta {
  margin: 0.4rem 0 0;
  color: #85837b;
  font-size: 0.75rem;
}

.entity-card-actions {
  display: grid;
  justify-items: end;
  gap: 0.2rem;
}

.text-button,
.icon-button {
  border: 0;
  padding: 0.22rem 0.35rem;
  color: #53544e;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.text-button:hover {
  color: #d64b2a;
}

.text-button-danger {
  color: #9c351f;
}

.entity-detail {
  margin-top: 1rem;
  border: 1px solid #ddd8cf;
  border-radius: 0.9rem;
  padding: 1rem;
  background: #f7f4ee;
}

.detail-heading,
.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.entity-detail pre {
  max-height: 420px;
  overflow: auto;
  margin-bottom: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.entity-dialog {
  width: min(900px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  border: 1px solid #d8d2c7;
  border-radius: 1.25rem;
  padding: 0;
  color: #20211f;
  background: #f8f5ef;
  box-shadow: 0 30px 100px rgb(32 33 31 / 28%);
}

.entity-dialog::backdrop {
  background: rgb(32 33 31 / 62%);
  backdrop-filter: blur(4px);
}

.entity-form {
  padding: clamp(1.2rem, 4vw, 2rem);
}

.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #d7d2c8;
  border-radius: 50%;
  font-size: 1.35rem;
}

.form-message {
  min-height: 1.2rem;
  margin: 0.7rem 0;
  font-size: 0.86rem;
}

.entity-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  max-height: min(62vh, 680px);
  overflow-y: auto;
  padding: 0.2rem 0.4rem 1rem 0.1rem;
}

.field {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-width: 0;
  color: #5f605a;
  font-size: 0.8rem;
  font-weight: 700;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-checkbox {
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid #e0dbd2;
  border-radius: 0.7rem;
  padding: 0.72rem 0.85rem;
  background: #fff;
}

.field-checkbox input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #d64b2a;
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid #dfdad1;
  padding-top: 1rem;
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.task-count {
  color: #68685f;
  font-size: 0.9rem;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  margin: 1.6rem 0;
}

.task-form input {
  min-width: 0;
  border: 1px solid #d7d2c8;
  border-radius: 0.7rem;
  padding: 0.75rem 0.9rem;
  color: #20211f;
  background: #fff;
}

.task-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.25rem;
  border-top: 1px solid #ebe7df;
  padding: 0.55rem 0;
}

.task input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #d64b2a;
}

.task-done span {
  color: #8c8a82;
  text-decoration: line-through;
}

.task-remove {
  border: 0;
  color: #77746d;
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
}

.task-remove:hover {
  color: #a72f15;
}

.empty-state {
  margin: 2rem 0 0;
  color: #8a877f;
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  color: #77746d;
  font-size: 0.82rem;
}

footer a {
  color: inherit;
}

.callback-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

#asset-tile-002 {
  width: min(500px, 100%);
  padding: 2.5rem;
  text-align: center;
}

#asset-tile-002 h1 {
  margin-top: 1.5rem;
  font-size: clamp(2rem, 8vw, 3.5rem);
}

#asset-tile-002 p {
  color: #68685f;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    padding-inline: 1rem;
  }

  .session-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  main {
    margin-top: 2.5rem;
  }

  .hero {
    display: block;
  }

  .workspace-context {
    align-items: stretch;
    flex-direction: column;
  }

  .tenant-controls,
  .tenant-controls input {
    min-width: 0;
    width: 100%;
  }

  .entity-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .project-context-controls {
    grid-template-columns: 1fr;
  }

  .search-field,
  .entity-toolbar .button-accent {
    grid-column: 1 / -1;
  }

  .entity-list,
  .entity-fields {
    grid-template-columns: 1fr;
  }

  .entity-card {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .entity-card-actions {
    display: flex;
    justify-content: flex-start;
  }

  .task-form {
    grid-template-columns: 1fr;
  }

  footer {
    gap: 1rem;
    flex-direction: column;
  }
}

/* Keep project tools in the work area chosen by the employee. */
body[data-project-view]:not([data-project-view="asset-tile-006"])
  :is(
    #asset-tile-018,
    #transcript-imports-panel,
    #asset-tile-020,
    #asset-tile-021,
    #meeting-context-field
  ),
body[data-project-view]:not([data-project-view="asset-tile-019"])
  #asset-tile-001,
body[data-project-view]:not(
    [data-project-view="projects"],
    [data-project-view="asset-tile-003"]
  )
  .workspace-context {
  display: none;
}
#project-menu {
  margin-top: 1rem;
  flex-wrap: wrap;
}
#project-menu [aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

#project-menu-toggle {
  display: none;
}
#project-menu .model-tab {
  color: #36352f;
  background: white;
}
#project-menu .model-tab[aria-current="page"] {
  background: #34352e;
  color: white;
}
.detail-facts {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(0, 3fr);
  gap: 0.6rem 1rem;
  line-height: 1.5;
}
.detail-facts dt {
  font-weight: 650;
}
.detail-facts dd,
.detail-facts ul {
  margin: 0;
  min-width: 0;
}
.detail-facts dd,
.entity-meta,
.detail-heading h3 {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.detail-facts ul {
  padding-inline-start: 1.2rem;
}
.entity-detail summary,
.chat-model-options summary {
  cursor: pointer;
  padding-block: 0.65rem;
  font-weight: 650;
}
.reference-link {
  border: 0;
  background: transparent;
  color: #87381d;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.25rem 0;
  text-align: start;
}

@media (max-width: 620px) {
  #project-menu-toggle:not([hidden]) {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
  }
  #project-menu-toggle[aria-expanded="false"] + #project-menu {
    display: none;
  }
  .model-navigation {
    flex-wrap: wrap;
    overflow: visible;
  }
  .model-navigation .model-tab,
  #project-menu-toggle,
  .entity-card-actions button {
    min-height: 44px;
    white-space: normal;
    max-width: 100%;
  }
  .entity-card-actions {
    flex-wrap: wrap;
  }
  .entity-card h3 {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .detail-facts {
    display: block;
  }
  .detail-facts dd {
    margin-block: 0.15rem 0.9rem;
  }
  .detail-heading {
    align-items: flex-start;
  }
  .detail-heading h3 {
    min-width: 0;
  }
}

.linked-records {
  display: grid;
  justify-items: start;
}
.danger-zone {
  margin-block: 2rem;
  padding: 1.5rem;
  border: 2px solid #b42318;
  border-radius: 1rem;
  background: #fff6f5;
}
.danger-zone form {
  display: grid;
  gap: 0.75rem;
}
.danger-zone input {
  padding: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}
.button-danger {
  background: #b42318;
  color: white;
}
.button-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Project task table and compact editor. */
.project-task-table-scroll {
  overflow-x: auto;
}
.project-task-table {
  width: 100%;
  border-collapse: collapse;
}
.project-task-table th,
.project-task-table td {
  text-align: left;
  padding: 0.9rem;
  border-bottom: 1px solid #dce2e8;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.project-task-table th {
  background: #f2f5f8;
}
.project-task-table td:first-child {
  min-width: 14rem;
}
.project-task-editor {
  display: grid;
  gap: 1rem;
  max-width: 60rem;
}
.project-task-editor fieldset {
  border: 1px solid #dce2e8;
  border-radius: 0.5rem;
  padding: 0.75rem;
}
.project-task-editor fieldset label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
}
.project-task-editor input[type="checkbox"] {
  width: auto;
}
.project-task-statuses .button {
  margin: 0.25rem;
}
#asset-tile-019 [aria-pressed="true"],
.project-task-statuses [aria-pressed="true"] {
  background: #234e70;
  color: white;
  border-color: #234e70;
}
