:root {
  --bg: #eef6ff;
  --panel: #f7fbff;
  --panel-border: #cfe6ff;
  --tab: #dcedff;
  --tab-active: #f7fbff;
  --button: #cfe7ff;
  --button-border: #abd0f5;
  --text: #0b2748;
  --muted: #46617f;
  --grid: #d3d3d3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.route-restoring-project #projects-view {
  visibility: hidden;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  padding: 16px;
  place-items: center;
}

.auth-page-card {
  display: grid;
  gap: 12px;
  width: min(560px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--button-border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 26px rgba(20, 63, 112, 0.14);
}

.auth-page-titlebar {
  display: grid;
  gap: 4px;
  text-align: center;
}

.auth-page-titlebar h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.auth-page-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
}

.service-error-details {
  margin-top: 6px;
  color: var(--muted);
}

.service-error-user-text {
  display: block;
  white-space: pre-wrap;
}

.service-error-details summary {
  cursor: pointer;
  font-weight: 700;
}

.service-error-details pre {
  max-width: 100%;
  max-height: 140px;
  margin: 6px 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #ffffff;
  color: #2b4058;
  white-space: pre-wrap;
}

.service-error-copy-button {
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid #7da9d5;
  border-radius: 6px;
  background: #e2f0ff;
  color: #143a64;
  font-weight: 700;
}

.auth-page-tabs {
  width: 100%;
}

.auth-page-panel {
  border: 1px solid var(--panel-border);
  background: #f7fbff;
}

.app-shell {
  min-height: 100vh;
  padding: 16px;
}

.app-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 38px;
}

.top-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
}

.top-tab {
  min-width: 110px;
  height: 38px;
  border: 1px solid var(--panel-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--tab);
  color: var(--text);
  font-weight: 600;
}

.top-tab.active {
  background: var(--tab-active);
  height: 40px;
}

.user-panel {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  height: 38px;
  margin: 0 0 0 16px;
  padding: 0;
  background: transparent;
  white-space: nowrap;
}

.current-user-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 320px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #123d70;
  font-family: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.logout-button {
  min-width: 78px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--button-border);
  border-radius: 8px;
  background: var(--button);
  color: #123d70;
  font-family: inherit;
  font-weight: 600;
}

.logout-button:hover {
  filter: brightness(0.98);
}

.project-tab {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 300px;
  max-width: 360px;
  padding: 0 8px 0 14px;
}

.project-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tab-close {
  color: #1f3f67;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.window-panel {
  min-height: calc(100vh - 54px);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  padding: 16px;
}

.projects-view,
.project-detail-view,
.settings-view,
.sessions-view {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 88px);
}

.hidden {
  display: none !important;
}

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

.projects-main,
.project-list-panel {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8fbff;
}

.projects-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 14px 18px;
}

.sessions-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 10px;
  min-height: calc(100vh - 120px);
}

.sessions-main,
.settings-side {
  border: 1px solid #9aa7b8;
  background: #f6f7f9;
  padding: 10px;
}

.sessions-main h1,
.settings-side h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.settings-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-sessions-panel {
  background: #f3f8ff;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 328px);
  min-height: 300px;
  padding: 0;
}

.account-sessions-panel {
  height: calc(100vh - 120px);
  min-height: 520px;
}

.project-billing-panel.billing-disabled .billing-layout {
  display: none;
}

.project-billing-panel:not(.billing-disabled) .billing-disabled-placeholder {
  display: none;
}

.project-sessions-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-height: 0;
  padding: 0;
}

.project-sessions-title {
  margin: 8px 0 0;
  border: 1px solid #cfe3fa;
  border-bottom: 0;
  background: #fff;
  color: #0c3865;
  font-size: 18px;
  font-weight: 700;
  line-height: 30px;
  min-height: 32px;
  padding: 0 8px;
  text-align: center;
}

.project-sessions-filter {
  border: 1px solid #d7e8fb;
  border-radius: 0 0 10px 10px;
  background: #fff;
  padding: 8px 14px 10px;
}

.project-sessions-filter-grid {
  display: grid;
  grid-template-columns: 130px minmax(160px, 1fr) 90px minmax(210px, 1.2fr) 160px minmax(210px, 1.2fr);
  gap: 8px 10px;
  align-items: center;
}

.project-sessions-filter-grid label,
.project-sessions-filter-grid select,
.project-sessions-filter-grid input,
.project-sessions-balance {
  height: 31px;
  min-width: 0;
  border: 1px solid #cfe3fa;
  border-radius: 10px;
  background: #fff;
  color: #102f55;
  font: inherit;
}

.project-sessions-filter-grid label {
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.project-sessions-filter-grid select,
.project-sessions-filter-grid input {
  padding: 0 8px;
}

.project-sessions-balance {
  display: flex;
  align-items: center;
  color: #1d4f82;
  font-weight: 600;
  padding: 0 8px;
}

.project-sessions-filter-grid button {
  height: 31px;
  min-width: 0;
  border: 1px solid #b8d6fa;
  border-radius: 9px;
  background: #d9ebff;
  color: #1f4f80;
  font: inherit;
  font-weight: 600;
  padding: 0 12px;
}

.project-sessions-filter-grid button:hover {
  background: #c9e2ff;
}

.project-sessions-filter-grid button:disabled {
  opacity: 0.65;
}

#project-sessions-reset-button,
#account-sessions-reset-button {
  grid-column: 4;
  width: 100%;
}

#project-sessions-show-button,
#account-sessions-show-button {
  grid-column: 6;
  width: 100%;
}

.project-sessions-table-area {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.project-sessions-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #c7d0dc;
  background: #fff;
}

.project-sessions-table {
  width: max-content;
  border-collapse: collapse;
  color: #102f55;
  font-size: 13px;
}

.project-sessions-table th,
.project-sessions-table td {
  height: 29px;
  border-right: 1px solid #d4d4d4;
  border-bottom: 1px solid #d4d4d4;
  white-space: nowrap;
  text-align: left;
  padding: 0 4px;
}

.project-sessions-table th {
  background: #f0f5fb;
  font-weight: 700;
  position: relative;
  text-align: center;
}

.project-sessions-table tbody tr:nth-child(even) {
  background: #f2f2f2;
}

.project-sessions-column-header {
  cursor: grab;
  user-select: none;
}

.project-sessions-column-header.dragging {
  opacity: 0.55;
}

.project-sessions-row-number-header {
  cursor: default;
}

.project-sessions-column-title {
  display: block;
  padding-right: 8px;
}

.project-sessions-column-resizer {
  bottom: 0;
  cursor: col-resize;
  position: absolute;
  right: -3px;
  top: 0;
  width: 8px;
  z-index: 2;
}

.project-sessions-column-resizer:hover {
  background: rgba(31, 115, 209, 0.16);
}

.project-sessions-table th[data-project-sessions-column-key="rowNumber"],
.project-sessions-table td[data-project-sessions-column-key="rowNumber"] {
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
}

.project-sessions-table td[data-project-sessions-column-key$="Tokens"],
.project-sessions-table td[data-project-sessions-column-key$="Cost"],
.project-sessions-table td[data-project-sessions-column-key="id"] {
  text-align: right;
}

.project-sessions-columns-button {
  position: absolute;
  right: 0;
  top: -24px;
  z-index: 5;
  width: 26px;
  height: 24px;
  border: 1px solid #b8c9dc;
  border-radius: 4px;
  background: #edf3f9;
  color: #244f7b;
  font-size: 13px;
  line-height: 20px;
  padding: 0;
}

.project-sessions-columns-menu {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 6;
  width: 240px;
  max-height: 310px;
  overflow: auto;
  border: 1px solid #bfd5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(38, 75, 118, 0.16);
  color: #143d69;
  font-size: 13px;
  padding: 8px;
}

.project-sessions-columns-menu label {
  display: block;
  margin: 5px 0;
}

.project-sessions-summary {
  bottom: 0;
  z-index: 7;
  min-height: 21px;
  margin: 0;
  border: 1px solid #cfe3fa;
  background: #f9fcff;
  color: #2b5f8f;
  font-size: 15px;
  font-weight: 600;
  font-style: italic;
  line-height: 20px;
  overflow: hidden;
  padding: 0 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.settings-block {
  min-height: 150px;
}

.settings-block h2 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.settings-table th,
.settings-table td {
  border: 1px solid #b8c0cc;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.settings-table th {
  background: #edf1f6;
  font-weight: 600;
}

.settings-table tbody tr:hover {
  background: #eef5ff;
}

.settings-view {
  border: 1px solid #d7e8fb;
  background: #eef6ff;
  padding: 16px 16px 14px;
  overflow: hidden;
}

.settings-primary-tabs,
.settings-llm-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 34px;
}

.settings-primary-tab,
.settings-llm-tab {
  min-height: 34px;
  border: 1px solid #c4ddf8;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: #dcefff;
  color: #163f70;
  font-weight: 600;
  padding: 0 14px;
}

.settings-primary-tab.active,
.settings-llm-tab.active {
  background: #f7fbff;
  color: #102f55;
}

.settings-tab-page {
  flex: 1;
  min-height: calc(100vh - 170px);
  border: 1px solid #d7e8fb;
  background: #f3f8ff;
  padding: 16px 16px 14px;
  overflow: hidden;
}

.settings-llm-tabs {
  margin-bottom: 0;
}

.final-llm-page {
  min-height: calc(100vh - 235px);
  border: 1px solid #d7e8fb;
  background: #f3f8ff;
  padding: 8px 16px 16px;
  overflow: hidden;
}

.special-llm-page {
  min-height: calc(100vh - 235px);
  border: 1px solid #d7e8fb;
  background: #f3f8ff;
  padding: 8px 16px 16px;
  overflow: hidden;
}

.final-llm-content {
  display: block;
  min-height: 0;
  height: calc(100vh - 450px);
}

.qt-group {
  position: relative;
  border: 1px solid #c8def6;
  border-radius: 10px;
  background: #f7fbff;
  padding: 18px 10px 10px;
}

.final-models-group {
  padding-left: 10px;
  padding-right: 8px;
}

.payment-settings-group {
  min-height: calc(100vh - 245px);
}

.payment-overview {
  display: grid;
  gap: 12px;
}

.payment-tariffs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.payment-tariff-card {
  border: 1px solid #c8def6;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.payment-actions {
  display: flex;
  gap: 8px;
}

.payment-table-wrap {
  overflow: auto;
  border: 1px solid #c8def6;
  background: #fff;
}

.payment-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.payment-table th,
.payment-table td {
  border: 1px solid #d8e6f5;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.payment-table th {
  background: #e7f2fc;
}

.payment-history {
  border: 1px solid #c8def6;
  background: #fff;
  padding: 8px;
  min-height: 34px;
}

.qt-group > h2 {
  position: absolute;
  top: -9px;
  left: 12px;
  margin: 0;
  background: #f3f8ff;
  color: #143f70;
  font-size: 13px;
  font-weight: 700;
  padding: 0 7px;
}

.final-models-group > h2 {
  position: static;
  top: auto;
  left: auto;
  margin: 0 0 5px;
  background: transparent;
  color: #143f70;
  font-size: 18px;
  font-weight: 700;
  padding: 0;
  text-align: center;
}

.final-models-group {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
}

.final-models-table-and-add {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 705px) 190px;
  gap: 10px;
  min-height: 0;
}

.final-models-table-column {
  min-width: 0;
}

.final-models-table-wrap {
  height: calc(100vh - 360px);
  min-height: 388px;
  width: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  border: 1px solid #d0d0d0;
  background: #fff;
}

.final-models-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #071d39;
  font-size: 13px;
}

.final-models-table th,
.final-models-table td {
  border: 1px solid #d3d3d3;
  padding: 3px 3px;
  vertical-align: middle;
}

.final-models-table th {
  height: 25px;
  background: #f8fbff;
  font-weight: 700;
  text-align: center;
}

.final-models-table th:nth-child(1),
.final-models-table td:nth-child(1) {
  width: 35px;
  text-align: center;
}

.final-models-table th:nth-child(2),
.final-models-table td:nth-child(2) {
  width: 92px;
}

.final-models-table th:nth-child(3),
.final-models-table td:nth-child(3) {
  width: 270px;
}

.final-models-table th:nth-child(4),
.final-models-table td:nth-child(4) {
  width: 270px;
  text-align: center;
}

.final-models-table tbody tr:nth-child(even) {
  background: #f2f2f2;
}

.final-models-table tbody tr.selected {
  background: #cfe7ff;
  outline: 1px solid #8fbce9;
}

.final-models-table .row-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.final-models-table .row-actions button,
.final-models-add-inline {
  min-height: 34px;
  border-color: #a9cff3;
  border-radius: 9px;
  background: #d4eaff;
  color: #164575;
  font-weight: 600;
}

.final-models-table .row-actions button {
  min-width: 0;
  padding: 0 6px;
  font-size: 13px;
}

.final-models-table .row-actions button:disabled {
  color: #7190ad;
  opacity: 0.65;
}

.final-models-hint {
  min-height: 0;
  margin: 0 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #204c7d;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  text-align: left;
  width: 100%;
}

.final-models-add-inline {
  margin-top: 29px;
  width: 182px;
}

.final-models-summary {
  margin: 7px 0 0;
  color: #204c7d;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.final-models-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 190px;
}

.final-models-status {
  min-height: 72px;
  margin: 0;
  border: 1px solid #cfe3fa;
  border-radius: 8px;
  background: #f7fbff;
  color: #204c7d;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  padding: 7px 8px;
  white-space: normal;
}

.special-llm-group {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: calc(100vh - 330px);
  padding-left: 10px;
  padding-right: 8px;
}

.special-llm-group > h2 {
  position: static;
  top: auto;
  left: auto;
  margin: 0 0 5px;
  background: transparent;
  color: #143f70;
  font-size: 18px;
  font-weight: 700;
  padding: 0;
  text-align: center;
}

.special-llm-table-and-side {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 900px) 190px;
  gap: 10px;
  min-height: 0;
}

.special-llm-table-wrap {
  min-height: 210px;
  width: 100%;
  overflow: hidden;
  border: 1px solid #d0d0d0;
  background: #fff;
}

.special-llm-table th:nth-child(1),
.special-llm-table td:nth-child(1) {
  width: 35px;
  text-align: center;
}

.special-llm-table th:nth-child(2),
.special-llm-table td:nth-child(2) {
  width: 345px;
}

.special-llm-table th:nth-child(3),
.special-llm-table td:nth-child(3) {
  width: 100px;
}

.special-llm-table th:nth-child(4),
.special-llm-table td:nth-child(4) {
  width: 230px;
}

.special-llm-table th:nth-child(5),
.special-llm-table td:nth-child(5) {
  width: 185px;
  text-align: center;
}

.special-llm-table td:nth-child(2) strong,
.special-llm-table td:nth-child(2) span {
  display: block;
}

.special-llm-table td:nth-child(2) span {
  color: #315c89;
  font-size: 12px;
  font-weight: 400;
  margin-top: 2px;
}

.final-models-table .special-llm-row-actions {
  grid-template-columns: 1fr;
  gap: 6px;
}

.special-llm-table .special-llm-row-actions button {
  justify-self: center;
  padding: 0 4px;
  width: 128px;
}

.special-llm-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 190px;
}

.custom-endpoint-page {
  min-height: calc(100vh - 235px);
  border: 1px solid #d7e8fb;
  background: #f3f8ff;
  padding: 0;
}

.custom-endpoint-card {
  margin: 0;
  border: 1px solid #c8def6;
  border-radius: 12px;
  background: #f7fbff;
  padding: 14px 18px;
}

.custom-endpoint-card h1 {
  height: 35px;
  margin: 0 0 8px;
  border: 1px solid #cfe3fa;
  border-radius: 10px;
  background: #fff;
  color: #163f70;
  font-size: 24px;
  font-weight: 700;
  line-height: 33px;
  padding: 0 8px;
}

.custom-endpoint-grid {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 8px 10px;
}

.custom-endpoint-grid label,
.custom-endpoint-grid input,
.custom-endpoint-grid select,
.custom-endpoint-status {
  min-height: 37px;
  border: 1px solid #cfe3fa;
  border-radius: 10px;
  background: #fff;
  color: #102f55;
  font: inherit;
}

.custom-endpoint-grid label {
  display: flex;
  align-items: center;
  padding: 0 6px;
}

.custom-endpoint-grid input,
.custom-endpoint-grid select {
  width: 100%;
  padding: 0 9px;
  outline: none;
}

.custom-endpoint-grid input::placeholder {
  color: #7c90a9;
}

.custom-endpoint-save {
  min-height: 36px;
  border-color: #a9cff3;
  border-radius: 9px;
  background: #d4eaff;
  color: #164575;
  font-weight: 600;
}

.custom-endpoint-status {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 3px;
  color: #204c7d;
  font-weight: 600;
}

.polza-page,
.openrouter-page {
  min-height: calc(100vh - 235px);
  border: 1px solid #d7e8fb;
  background: #f3f8ff;
  padding: 0;
}

.polza-top-card,
.openrouter-top-card {
  margin: 0 0 12px;
  border: 1px solid #c8def6;
  border-radius: 12px;
  background: #f7fbff;
  padding: 14px 18px;
}

.polza-top-card h1,
.openrouter-top-card h1 {
  height: 35px;
  margin: 0 0 8px;
  border: 1px solid #cfe3fa;
  border-radius: 10px;
  background: #fff;
  color: #163f70;
  font-size: 24px;
  font-weight: 700;
  line-height: 33px;
  padding: 0 8px;
}

.openrouter-top-card {
  padding: 10px 18px;
}

.openrouter-top-card h1 {
  height: 30px;
  margin: 0 0 4px;
  border: 0;
  background: transparent;
  line-height: 30px;
}

.polza-top-card label,
.polza-top-card input,
.polza-status,
.openrouter-top-card label,
.openrouter-top-card input,
.openrouter-status,
.polza-form-group input,
.polza-form-group label,
.polza-rate-hint,
.openrouter-form-group input {
  border: 1px solid #cfe3fa;
  background: #fff;
  color: #102f55;
  font: inherit;
}

.polza-top-card > label,
.openrouter-top-card label {
  display: block;
  width: 50%;
  min-height: 19px;
  padding: 0 4px;
}

.polza-key-row,
.openrouter-key-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 35px;
  margin: 8px 0;
}

.openrouter-key-row {
  min-height: 31px;
  margin: 3px 0;
}

.polza-key-row label,
.openrouter-key-row label {
  background: transparent;
  border: 0;
  min-height: 19px;
  padding: 0 4px;
  white-space: nowrap;
  width: auto;
}

.polza-key-row input,
.openrouter-key-row input {
  border-radius: 6px;
  margin: 0;
  min-height: 35px;
  width: 100%;
}

.openrouter-key-row input {
  min-height: 31px;
}

.polza-top-card > input,
.openrouter-top-card input {
  width: 100%;
  min-height: 36px;
  margin: 8px 0;
  border-radius: 10px;
  padding: 0 9px;
  outline: none;
}

.polza-top-actions,
.openrouter-top-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.polza-top-actions .action-button,
.polza-form-group .action-button,
.polza-refresh-bottom,
.openrouter-top-actions .action-button,
.openrouter-form-group .action-button,
.openrouter-refresh-bottom {
  min-height: 35px;
  border-color: #a9cff3;
  border-radius: 8px;
  background: #d4eaff;
  color: #164575;
  font-weight: 600;
}

.polza-status,
.openrouter-status {
  min-height: 19px;
  margin: 0;
  padding: 1px 4px;
  color: #204c7d;
  font-weight: 600;
}

.openrouter-status:empty {
  display: none;
}

.openrouter-status {
  font-weight: 400;
  line-height: 1.25;
}

.polza-content,
.openrouter-content {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 8px minmax(240px, 348px);
  gap: 6px;
  min-height: 0;
  height: calc(100vh - 490px);
  overflow: hidden;
}

.polza-layout-resizer,
.openrouter-layout-resizer {
  align-self: stretch;
  cursor: col-resize;
  min-height: 255px;
  border-left: 1px solid #b8d5f4;
  border-right: 1px solid #e2f0ff;
  background: linear-gradient(90deg, #d7ebff, #f4faff);
}

.polza-layout-resizer:hover,
.polza-layout-resizer.dragging,
.openrouter-layout-resizer:hover,
.openrouter-layout-resizer.dragging {
  background: #b9dcff;
}

.polza-models-group,
.openrouter-models-group {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: visible;
}

.openrouter-models-group {
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding-top: 8px;
}

.polza-models-group {
  margin-top: 12px;
  height: calc(100% - 12px);
  max-height: calc(100% - 12px);
}

.openrouter-models-group h2 {
  font-size: 1.125em;
  line-height: 1.25;
  margin: 0 0 7px;
  padding: 0;
  position: static;
  text-align: center;
}

.polza-models-table-wrap,
.openrouter-models-table-wrap {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #d0d0d0;
  background: #fff;
  scrollbar-gutter: stable;
}

.polza-models-table,
.openrouter-models-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #071d39;
  font-size: 13px;
}

.polza-models-table th,
.polza-models-table td,
.openrouter-models-table th,
.openrouter-models-table td {
  border: 1px solid #d3d3d3;
  padding: 3px 4px;
  vertical-align: middle;
}

.polza-models-table th,
.openrouter-models-table th {
  height: 25px;
  background: #f8fbff;
  font-weight: 700;
  text-align: left;
}

.polza-models-table th:nth-child(1),
.polza-models-table td:nth-child(1),
.openrouter-models-table th:nth-child(1),
.openrouter-models-table td:nth-child(1) {
  width: 35px;
  text-align: center;
}

.polza-models-table th:nth-child(2),
.polza-models-table td:nth-child(2),
.openrouter-models-table th:nth-child(2),
.openrouter-models-table td:nth-child(2) {
  width: 178px;
}

.polza-models-table th:nth-child(3),
.polza-models-table td:nth-child(3),
.polza-models-table th:nth-child(4),
.polza-models-table td:nth-child(4),
.openrouter-models-table th:nth-child(3),
.openrouter-models-table td:nth-child(3),
.openrouter-models-table th:nth-child(4),
.openrouter-models-table td:nth-child(4) {
  width: 116px;
}

.polza-models-table th:nth-child(5),
.polza-models-table td:nth-child(5),
.polza-models-table th:nth-child(6),
.polza-models-table td:nth-child(6),
.openrouter-models-table th:nth-child(5),
.openrouter-models-table td:nth-child(5),
.openrouter-models-table th:nth-child(6),
.openrouter-models-table td:nth-child(6) {
  width: 112px;
  text-align: right;
}

.polza-models-table th:nth-child(7),
.polza-models-table td:nth-child(7),
.openrouter-models-table th:nth-child(7),
.openrouter-models-table td:nth-child(7) {
  width: 86px;
  text-align: center;
}

.polza-models-table tbody tr:nth-child(even),
.openrouter-models-table tbody tr:nth-child(even) {
  background: #f2f2f2;
}

.polza-models-table button,
.openrouter-models-table button {
  min-height: 31px;
  width: 76px;
  border: 1px solid #a9cff3;
  border-radius: 8px;
  background: #d4eaff;
  color: #164575;
  font-weight: 600;
}

.polza-refresh-bottom,
.openrouter-refresh-bottom {
  width: 100%;
  margin-top: 10px;
  align-self: end;
}

.polza-form-group,
.openrouter-form-group {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-self: stretch;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overflow-wrap: anywhere;
}

.polza-form-group h2,
.openrouter-form-group h2 {
  font-size: 21px;
  line-height: 25px;
  margin: 0;
  text-align: center;
}

.polza-form-heading,
.openrouter-form-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
}

.polza-form-heading h2,
.polza-form-heading .polza-status,
.openrouter-form-heading h2 {
  margin: 0;
}

.polza-form-group input,
.openrouter-form-group input {
  width: 100%;
  max-width: 100%;
  min-height: 36px;
  border-radius: 10px;
  padding: 0 9px;
  outline: none;
}

.polza-form-group label,
.polza-rate-hint {
  min-height: 19px;
  padding: 1px 4px;
}

.polza-rate-hint {
  min-height: 100px;
  border-radius: 10px;
  color: #204c7d;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
}

@media (max-width: 900px) {
  .polza-content,
  .openrouter-content {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .polza-layout-resizer,
  .openrouter-layout-resizer {
    display: none;
  }

  .polza-form-group {
    min-height: 0;
  }
}

.section-header {
  margin-bottom: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.3;
}

h2 {
  font-size: 15px;
  margin-bottom: 12px;
}

.section-header p {
  margin-top: 2px;
  border: 1px solid var(--panel-border);
  padding: 2px 4px;
  color: var(--muted);
}

.project-list-panel {
  flex: 1;
  overflow: hidden;
  background: #f8fbff;
  border-radius: 0;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.project-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.project-list-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.project-list-left-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 3fr) minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.project-list-left-column > .project-list-search-row {
  align-self: start;
  margin-left: 0;
}

.project-list-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 190px;
}

.project-list-toolbar-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: auto;
  width: 190px;
}

.project-list-status {
  margin: 0;
  width: 190px;
  min-height: calc(3em + 14px);
  height: auto;
  box-sizing: border-box;
  border: 1px solid #cfe6ff;
  padding: 6px 8px;
  background: #ffffff;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.project-list-limit-button.active {
  background: var(--button);
  border-color: var(--button-border);
  font-weight: 700;
}

.project-list-search-row {
  display: inline-grid;
  grid-template-columns: 38px minmax(260px, 1fr) 132px;
  align-items: center;
  gap: 8px;
  width: min(620px, 100%);
  min-width: 430px;
  color: var(--text);
}

.project-list-search-row input {
  min-width: 0;
  height: 30px;
  border: 1px solid #cfe6ff;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 4px 7px;
}

.project-list-table-wrap {
  width: 100%;
  min-height: 0;
  overflow: auto;
  border: 1px solid #cfe6ff;
  background: #ffffff;
}

.project-list-bottom-spacer {
  min-height: 0;
}

.project-list-pagination {
  align-self: end;
}

.project-list-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  table-layout: fixed;
}

.project-list-table th,
.project-list-table td {
  border: 1px solid transparent;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.project-list-table th {
  font-weight: 700;
  color: var(--text);
  background: #ffffff;
}

.project-list-table th:nth-child(1),
.project-list-table td:nth-child(1) {
  width: 65%;
  padding-left: 46px;
}

.project-list-table th:nth-child(2),
.project-list-table td:nth-child(2) {
  width: 35%;
}

.project-list-item {
  cursor: pointer;
  outline: none;
  background: #ffffff;
}

.project-list-item:hover,
.project-list-item:focus {
  background: #e8f3ff;
}

.project-list-item.selected {
  background: #cfe7ff;
  outline: 1px solid var(--button-border);
  outline-offset: -1px;
}

.project-list-pagination {
  justify-content: flex-start;
  min-height: 32px;
}

#projects-page-label {
  display: inline-block;
  min-width: 170px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.project-list-page-edge-button {
  flex: 0 0 44px !important;
  min-width: 44px !important;
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
  width: 44px !important;
}

.project-subtabs {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0;
}

.project-subtabs-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 39px;
  flex-wrap: wrap;
}

.project-subtab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 84px;
  max-width: 148px;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  border: 1px solid #cfe3fa;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #e8f3ff;
  color: #1e4f82;
  cursor: grab;
  font-weight: 600;
  line-height: 1.15;
  padding: 7px 10px 8px;
  text-align: center;
  white-space: normal;
}

.project-subtab[data-project-section="chronology"] {
  min-width: 176px;
  max-width: 176px;
}

.project-subtab:hover {
  background: #dcedff;
}

.project-subtab.active {
  background: #fff;
  color: #0c3865;
}

.project-subtab.dragging {
  cursor: grabbing;
  opacity: 0.55;
}

.project-subtab-drop-indicator {
  width: 3px;
  align-self: stretch;
  min-height: 34px;
  border-radius: 1px;
  background: #1f73d1;
}

.project-placeholder-panel {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.project-placeholder-frame {
  min-height: calc(100vh - 320px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px 14px;
}

.project-placeholder-frame h2 {
  margin-bottom: 8px;
  text-align: center;
}

.project-start-panel {
  border: 1px solid var(--panel-border);
  border-radius: 0;
  background: #f8fbff;
  padding: 10px 14px 12px;
  margin-top: 0;
}

.project-chronology-panel {
  border: 1px solid var(--panel-border);
  border-radius: 0;
  background: #f8fbff;
  padding: 10px 14px 12px;
  min-height: calc(100vh - 370px);
}

.project-top-panel {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr);
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px 18px;
}

.project-top-left,
.project-top-right {
  min-width: 0;
}

.project-top-left h1 {
  height: 36px;
  margin: 0;
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
  font-size: 24px;
  line-height: 34px;
  padding: 0 7px;
}

.project-meta-row,
.project-window-actions,
.model-select-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-meta-row {
  margin-top: 8px;
}

.project-top-right {
  padding: 0;
}

.project-window-actions {
  justify-content: flex-end;
  margin-bottom: 8px;
}

.project-clock {
  min-width: 180px;
  color: #2f5d8a;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.model-select-row {
  justify-content: flex-end;
  gap: 38px;
  font-weight: 400;
  white-space: nowrap;
}

.model-select-row select {
  width: min(420px, 62%);
  min-width: 180px;
  min-height: 37px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400 !important;
  padding: 0 8px;
  text-shadow: none;
}

.model-select-row select option {
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400 !important;
}

#project-model-select,
#ai-dialog-fullscreen-model-select {
  font-weight: 400 !important;
}

.project-start-panel h2 {
  min-height: 22px;
  margin: 0 0 8px;
  border: 1px solid var(--panel-border);
  background: #fff;
  color: #174372;
  font-size: 16px;
  line-height: 20px;
  padding: 0 4px;
  text-align: center;
}

.chronology-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 192px;
  gap: 6px;
  min-height: calc(100vh - 395px);
}

.chronology-left-frame,
.chronology-right-frame,
.billing-left-frame,
.billing-right-frame,
.context-left-frame,
.context-right-frame {
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.chronology-left-frame {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.chronology-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}

.billing-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.context-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.chronology-title-row h2,
.billing-title-row h2,
.billing-right-frame h2,
.context-title-row h2,
.context-right-frame h2 {
  flex: 1;
  margin: 0;
  border: 1px solid var(--panel-border);
  background: #fff;
  color: #174372;
  font-size: 16px;
  line-height: 20px;
  min-height: 22px;
  padding: 0 4px;
  text-align: center;
}

.chronology-ai-generated-label {
  min-height: 20px;
  margin: 0 0 2px;
  color: #174372;
  font-size: 14px;
  line-height: 18px;
  text-align: left;
}

.chronology-right-frame h2 {
  margin: 0;
  border: 1px solid var(--panel-border);
  background: #fff;
  color: #174372;
  font-size: 16px;
  line-height: 20px;
  min-height: 45px;
  padding: 3px 4px;
  text-align: center;
}

.icon-button {
  width: 34px;
  height: 29px;
  border: 1px solid var(--button-border);
  border-radius: 6px;
  background: var(--button);
  color: var(--text);
}

.columns-menu {
  position: absolute;
  z-index: 5;
  right: 166px;
  margin-top: -6px;
  min-width: 240px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(9, 35, 63, 0.16);
  padding: 8px;
}

.columns-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  margin-bottom: 6px;
}

.columns-menu-header p {
  margin: 0;
  font-weight: 700;
}

.columns-menu-close {
  width: 24px;
  height: 24px;
  border: 1px solid var(--button-border);
  border-radius: 5px;
  background: var(--button);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  line-height: 18px;
  padding: 0;
}

.columns-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.hidden-column {
  display: none;
}

.chronology-right-frame {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.chronology-right-frame .action-button {
  min-height: 36px;
  width: 100%;
}

#chronology-status {
  min-height: 118px;
  max-height: 118px;
  margin-bottom: 0;
  overflow: auto;
  padding-right: 4px;
  white-space: pre-wrap;
}

.chronology-count-label {
  min-height: 32px;
  margin-top: 0;
}

.chronology-delete-gap {
  height: 20px;
}

.chronology-table-panel {
  height: auto;
  min-height: 360px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #d0d0d0;
  background: #fff;
}

.chronology-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: #fff;
  font-size: 100%;
  table-layout: fixed;
}

.project-billing-panel {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.billing-layout {
  display: grid;
  grid-template-columns: minmax(0, 87fr) minmax(130px, 13fr);
  gap: 12px;
  min-height: calc(100vh - 320px);
}

.project-context-panel {
  border: 1px solid var(--panel-border);
  border-radius: 0;
  background: #f8fbff;
  padding: 10px 14px 12px;
}

.context-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 6px;
  min-height: calc(100vh - 334px);
}

.context-left-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.context-right-frame {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 7px;
  justify-content: flex-start;
  align-self: start;
}

.context-right-frame .action-button {
  min-height: 52px;
  width: 100%;
}

.context-delete-gap {
  height: 12px;
}

.context-service-status {
  border: 1px solid var(--panel-border);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  margin: 2px 0 0;
  min-height: 56px;
  overflow-wrap: anywhere;
  padding: 6px;
}

.context-upload-dropzone {
  display: none;
  gap: 4px;
  margin-bottom: 10px;
  border: 1px dashed var(--button-border);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
  cursor: pointer;
}

.context-upload-dropzone strong,
.context-upload-dropzone span {
  display: block;
}

.context-upload-dropzone span {
  color: var(--muted);
}

.context-upload-dropzone.drag-over {
  border-style: solid;
  background: #e8f3ff;
  outline: 2px solid #cfe7ff;
}

.context-table-panel {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 1px solid #d0d0d0;
  background: #fff;
}

.context-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
  table-layout: fixed;
}

.context-table th,
.context-table td {
  background: #ffffff;
  border: 1px solid var(--grid);
  padding: 4px 4px;
  vertical-align: top;
}

.context-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6fbff;
  font-weight: 700;
  text-align: center;
}

.context-column-header {
  cursor: grab;
  user-select: none;
}

.context-row-number-header {
  cursor: default;
}

.context-table th[data-context-column-key="rowNumber"],
.context-table td[data-context-column-key="rowNumber"] {
  width: 1%;
  min-width: 24px;
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
  white-space: nowrap;
}

.context-table td[data-context-column-key="size"] {
  text-align: right;
}

.context-table td.context-ai-excluded-cell {
  background: #ffd6e2;
}

.context-column-header.dragging {
  opacity: 0.55;
}

.context-column-title {
  display: block;
  padding-right: 8px;
}

.context-column-resizer {
  bottom: 0;
  cursor: col-resize;
  position: absolute;
  right: -3px;
  top: 0;
  width: 8px;
  z-index: 2;
}

.context-column-resizer:hover {
  background: rgba(31, 115, 209, 0.16);
}

.context-table tbody tr:hover,
.context-table tbody tr:focus {
  background: #e8f3ff;
}

.context-table tbody tr:hover td,
.context-table tbody tr:focus td {
  background: #e8f3ff;
}

.context-table tbody tr:hover td.context-ai-excluded-cell,
.context-table tbody tr:focus td.context-ai-excluded-cell {
  background: #ffbfd2;
}

.context-table tbody tr.selected {
  background: #cfe7ff;
  outline: 1px solid var(--button-border);
}

.context-table tbody tr.selected td {
  background: #cfe7ff;
}

.context-table tbody tr.selected td.context-ai-excluded-cell {
  background: #ffabc3;
}

.context-summary {
  border: 1px solid var(--panel-border);
  background: #fff;
  color: #174372;
  font-weight: 600;
  font-style: italic;
  line-height: 20px;
  margin: 9px 0 0;
  min-height: 22px;
  overflow: hidden;
  padding: 0 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-ai-panel {
  min-height: 580px;
  padding: 0;
}

#project-ai-dialogs-section {
  flex: 1 1 auto;
  min-height: 0;
}

.project-account-context-panel {
  min-height: 560px;
}

.account-context-layout {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 180px;
  height: calc(100vh - 418px);
  min-height: 520px;
}

.account-context-main,
.account-context-side {
  background: #f7fbff;
  border: 1px solid #b8d7f4;
}

.account-context-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  padding: 8px 10px 10px;
  position: relative;
}

.account-context-title-row {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 8px;
}

.account-context-title-row h2 {
  justify-self: center;
  text-align: center;
  color: #174372;
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 30px;
  margin: 0;
  padding: 0 6px;
  width: fit-content;
}

.account-context-title-row .icon-button {
  justify-self: end;
}

.account-context-help {
  background: #fff;
  border: 1px solid #c5def7;
  color: #174372;
  font-weight: 600;
  line-height: 20px;
  margin: 6px 0 8px;
  min-height: 22px;
  padding: 0 4px;
}

.account-context-table-wrap {
  background: #ffffff;
  border: 1px solid #d6e8fa;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
}

.account-context-table {
  background: #ffffff;
  border-collapse: collapse;
  color: #0b2d52;
  font-size: 14px;
  width: 100%;
}

.account-context-table th,
.account-context-table td {
  background: #ffffff;
  border: 1px solid #c7cfd9;
  padding: 4px 6px;
  vertical-align: top;
}

.account-context-table th {
  background: #edf2f7;
  font-weight: 700;
  text-align: left;
}

.account-context-table th[data-account-column-key="title"] {
  text-align: center;
}

.account-context-table th[data-account-column-key="rowNumber"],
.account-context-table td[data-account-column-key="rowNumber"] {
  min-width: 24px;
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
  white-space: nowrap;
  width: 1%;
}

.account-context-table th[data-account-column-key="size"],
.account-context-table td[data-account-column-key="size"] {
  text-align: right;
  white-space: nowrap;
}

.account-context-table th[data-account-column-key="updated"],
.account-context-table td[data-account-column-key="updated"] {
  white-space: nowrap;
}

.account-context-table tbody tr:hover,
.account-context-table tbody tr:focus {
  background: #e8f3ff;
}

.account-context-table tbody tr:hover td,
.account-context-table tbody tr:focus td {
  background: #e8f3ff;
}

.account-context-table tbody tr.selected {
  background: #cfe7ff;
  outline: 1px solid var(--button-border);
}

.account-context-table tbody tr.selected td {
  background: #cfe7ff;
}

.account-context-summary {
  background: #ffffff;
  border: 1px solid #b8d7f4;
  color: #174372;
  font-style: italic;
  font-weight: 700;
  line-height: 22px;
  margin: 10px 0 0;
  min-height: 24px;
  padding: 0 4px;
}

.account-context-service-status {
  background: #eef6ff;
  border: 1px solid #b8d7f4;
  color: #174372;
  line-height: 17px;
  margin: 8px 0 0;
  min-height: 52px;
  padding: 6px;
}

.account-context-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 6px;
}

.account-context-side h2 {
  color: #0a3463;
  font-size: 16px;
  font-weight: 700;
  line-height: 18px;
  margin: 2px 0 8px;
}

.account-context-side .action-button {
  min-height: 50px;
  width: 100%;
}

.account-context-columns-menu {
  background: #ffffff;
  border: 1px solid #b8d7f4;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(9, 35, 63, 0.16);
  color: #0b2d52;
  display: grid;
  gap: 8px;
  min-width: 270px;
  padding: 8px 10px;
  position: absolute;
  right: 10px;
  top: 44px;
  z-index: 20;
}

.account-context-columns-menu.hidden {
  display: none;
}

.account-context-columns-menu label {
  align-items: start;
  display: grid;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
  grid-template-columns: auto 1fr;
  line-height: 17px;
}

.account-context-columns-menu input {
  accent-color: #3e93dd;
  height: 13px;
  margin-top: 2px;
  width: 13px;
}

.account-context-side .danger {
  margin-top: 4px;
}

.ai-block-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 10px;
  min-height: 620px;
}

.ai-dialog-layout {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.ai-block-main,
.ai-block-side {
  border: 1px solid #9aa7b8;
  background: #f6f7f9;
  padding: 10px;
}

.ai-dialog-main {
  background: #fff;
  border: 1px solid #d6e8fa;
  border-radius: 8px;
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  height: calc(100vh - 294px);
  padding: 9px 10px 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

.ai-block-main h2,
.ai-dialog-main h2,
.ai-block-side h2 {
  color: #143f70;
  margin: 0 0 7px;
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
}

.ai-block-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-block-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.ai-block-table th,
.ai-block-table td {
  border: 1px solid #b8c0cc;
  padding: 6px 8px;
  vertical-align: top;
}

.ai-block-table th {
  background: #edf1f6;
  font-weight: 600;
  text-align: left;
}

.ai-block-table tbody tr:hover,
.ai-block-table tbody tr:focus {
  background: #eef5ff;
}

.ai-block-table tbody tr.selected {
  background: #cfe3ff;
}

.ai-action-proposal-row td {
  background: #fffaf0;
}

.ai-action-proposal-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-action-proposal-question,
.ai-action-proposal-answer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-action-proposal-title {
  font-weight: 700;
}

.ai-action-proposal-meta,
.ai-action-proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-action-proposal-status {
  border: 1px solid #b8c0cc;
  border-radius: 4px;
  padding: 1px 5px;
}

.ai-action-proposal-status-pending {
  background: #fff1c7;
}

.ai-action-proposal-status-applied {
  background: #ddf6df;
}

.ai-action-proposal-status-rejected {
  background: #f6dddd;
}

.ai-action-proposal-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-action-proposal-options .ai-dialog-question-option {
  justify-content: center;
  width: 100%;
}

.ai-action-proposal-final-answer {
  border: 1px solid #b8c0cc;
  border-radius: 4px;
  background: #eef6ff;
  padding: 4px 6px;
  text-align: center;
}

.ai-action-proposal-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.saved-ai-answers-layout {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 224px;
  height: calc(100vh - 352px);
  min-height: 560px;
}

.saved-ai-answers-main,
.saved-ai-answers-side {
  background: #f6f7f9;
  border: 1px solid #9aa7b8;
  box-sizing: border-box;
  padding: 10px;
}

.saved-ai-answers-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.saved-ai-answers-main h2,
.saved-ai-answers-side h2 {
  color: #143f70;
  font-size: 18px;
  font-weight: 700;
  line-height: 30px;
  margin: 0 0 7px;
  text-align: center;
}

.saved-ai-answers-table-wrap {
  background: #fff;
  border: 1px solid #d7e8fa;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.saved-ai-answers-table {
  background: #fff;
  border-collapse: collapse;
  color: #0b2d52;
  font-size: 14px;
  table-layout: fixed;
  width: 100%;
}

.saved-ai-answers-table th,
.saved-ai-answers-table td {
  border: 1px solid #b8c0cc;
  color: #061c3c;
  line-height: 18px;
  padding: 4px 5px;
  text-align: left;
  vertical-align: top;
}

.saved-ai-answers-table th {
  background: #edf1f6;
  font-weight: 600;
  text-align: center;
}

.saved-ai-answers-table th:nth-child(1),
.saved-ai-answers-table td:nth-child(1) {
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
  white-space: nowrap;
  width: 4%;
}

.saved-ai-answers-table th:nth-child(2),
.saved-ai-answers-table td:nth-child(2) {
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: normal;
  width: 48%;
}

.saved-ai-answers-table th:nth-child(3),
.saved-ai-answers-table td:nth-child(3) {
  width: 25%;
}

.saved-ai-answers-table th:nth-child(4),
.saved-ai-answers-table td:nth-child(4) {
  text-align: center;
  width: 23%;
}

.saved-ai-answers-table tbody tr {
  cursor: default;
}

.saved-ai-answers-table tbody tr:hover,
.saved-ai-answers-table tbody tr:focus {
  background: #eef5ff;
}

.saved-ai-answers-table tbody tr.selected {
  background: #cfe3ff;
}

.saved-ai-answers-status {
  border: 1px solid #d7e8fa;
  color: #174372;
  font-style: italic;
  font-weight: 700;
  margin: 8px 0 0;
  padding: 2px 4px;
}

.saved-ai-answers-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saved-ai-answers-side .action-button {
  min-height: 36px;
  width: 100%;
}

.participants-layout {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 246px;
  height: calc(100vh - 342px);
  min-height: 560px;
}

.participants-main,
.participants-side {
  background: #f7fbff;
  border: 1px solid #b8d7f4;
}

.participants-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  padding: 12px 10px 0;
  position: relative;
}

.participants-title-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  margin-bottom: 0;
}

.participants-title-row h2 {
  color: #174372;
  display: block;
  grid-column: 2;
  font-size: 18px;
  font-weight: 700;
  justify-self: start;
  line-height: 30px;
  margin: 0;
  padding: 0 6px;
  text-align: center;
  width: 100%;
}

.participants-title-row .icon-button {
  background: #d7eafd;
  border-color: #b8d7f4;
  color: #8b9bb0;
  grid-column: 3;
  height: 30px;
  justify-self: end;
  min-height: 30px;
  width: 34px;
}

.participants-title-row .icon-button:hover {
  background: #cde5fd;
  color: #174372;
}

.participants-ai-generated-label {
  color: #174372;
  font-size: 13px;
  font-weight: 400;
  line-height: 14px;
  margin: 0 0 7px;
  min-height: 14px;
  text-align: left;
}

.participants-ai-generated-label.hidden {
  display: none;
}

.participants-table-wrap {
  background: #ffffff;
  border: 1px solid #d6e8fa;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.participants-table {
  background: #ffffff;
  border-collapse: collapse;
  color: #0b2d52;
  font-size: 14px;
  table-layout: fixed;
  width: 100%;
}

.participants-table th,
.participants-table td {
  border: 1px solid #c7cfd9;
  overflow: hidden;
  padding: 4px 5px;
  vertical-align: top;
}

.participants-table th {
  background: #edf2f7;
  font-weight: 700;
  position: relative;
  text-align: center;
  white-space: nowrap;
}

.participant-column-header {
  cursor: grab;
  user-select: none;
}

.participant-column-header.dragging {
  opacity: 0.55;
}

.participant-row-number-header {
  cursor: default;
}

.participant-column-title {
  display: block;
  padding-right: 8px;
}

.participant-column-resizer {
  bottom: 0;
  cursor: col-resize;
  position: absolute;
  right: -3px;
  top: 0;
  width: 8px;
  z-index: 2;
}

.participant-column-resizer:hover {
  background: rgba(31, 115, 209, 0.16);
}

.participants-table th[data-participant-column-key="rowNumber"],
.participants-table td[data-participant-column-key="rowNumber"] {
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
  white-space: nowrap;
}

.participants-table th[data-participant-column-key="name"],
.participants-table td[data-participant-column-key="name"] {
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: normal;
}

.participants-table th[data-participant-column-key="inn"],
.participants-table td[data-participant-column-key="inn"] {
  white-space: nowrap;
}

.participants-table th[data-participant-column-key="role"],
.participants-table td[data-participant-column-key="role"] {
  white-space: normal;
  word-break: normal;
}

.participants-table tbody tr:hover,
.participants-table tbody tr:focus {
  background: #e8f3ff;
}

.participants-table tbody tr.selected {
  background: #cfe7ff;
  outline: 1px solid var(--button-border);
}

.participants-status {
  background: #ffffff;
  border: 1px solid #b8d7f4;
  color: #174372;
  font-style: italic;
  font-weight: 700;
  line-height: 22px;
  margin: 10px 0 0;
  min-height: 24px;
  padding: 0 4px;
}

.participants-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.participants-side h2 {
  border: 1px solid #b8d7f4;
  border-radius: 6px;
  color: #0a3463;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  margin: 0 0 4px;
  padding: 4px 6px;
}

.participants-side .action-button {
  min-height: 36px;
  width: 100%;
}

.participants-side-status {
  background: #ffffff;
  border: 1px solid #b8d7f4;
  color: #174372;
  font-size: 13px;
  line-height: 17px;
  margin: auto 0 0;
  min-height: 70px;
  padding: 6px;
  white-space: pre-wrap;
}

.participants-side .danger {
  margin-top: 36px;
}

.participants-columns-menu {
  background: #ffffff;
  border: 1px solid #b8d7f4;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(9, 35, 63, 0.16);
  color: #0b2d52;
  display: grid;
  gap: 8px;
  min-width: 260px;
  padding: 8px 10px;
  position: absolute;
  right: 10px;
  top: 44px;
  z-index: 20;
}

.participants-columns-menu .columns-menu-title-row {
  align-items: center;
  display: grid;
  grid-template-columns: 1fr 22px;
}

.participants-columns-menu.hidden {
  display: none;
}

.participants-columns-menu label {
  align-items: start;
  display: grid;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
  grid-template-columns: auto 1fr;
  line-height: 17px;
}

.participants-columns-menu input {
  accent-color: #3e93dd;
  height: 13px;
  margin-top: 2px;
  width: 13px;
}

.participants-columns-menu input:disabled {
  opacity: 0.72;
}

.ai-dialog-title-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  margin-bottom: 6px;
}

.ai-dialog-title-row h2 {
  color: #123d70;
  margin: 0;
}

.ai-dialog-history-reload-button {
  background: transparent;
  border: 1px solid var(--button-border);
  border-radius: 4px;
  color: #123d70;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 30px;
  padding: 5px 12px;
}

.ai-dialog-history-reload-button:hover {
  background: rgba(217, 239, 255, 0.34);
}

.ai-dialog-history-reload-button:disabled {
  color: #7d93a8;
  cursor: default;
  opacity: 0.72;
}

.ai-dialog-messages {
  flex: 1 1 auto;
  height: auto;
  min-height: 345px;
  overflow: auto;
  border: 1px solid #b8cde4;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  color: #103054;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.42;
  text-rendering: auto;
  -webkit-font-smoothing: auto;
  white-space: normal;
}

.ai-dialog-messages * {
  font-family: inherit;
  letter-spacing: 0;
  text-rendering: auto;
  -webkit-font-smoothing: auto;
}

.ai-dialog-message {
  margin-bottom: 10px;
  max-width: 98%;
}

.ai-dialog-message:last-child {
  margin-bottom: 0;
}

.ai-dialog-message-header {
  display: block;
  margin-bottom: 3px;
  font-weight: 700;
  color: inherit;
}

.ai-dialog-answer-inline-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 6px;
}

.ai-dialog-answer-inline-actions-label {
  color: #355979;
  font-size: 13px;
  font-style: italic;
  font-weight: 700;
  line-height: 18px;
  margin-right: 2px;
}

.ai-dialog-answer-inline-action {
  border: 1px solid transparent;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  min-height: 24px;
  padding: 3px 8px;
}

.ai-dialog-answer-inline-action.copy {
  background: #1f6feb;
  border-color: #1659c7;
}

.ai-dialog-answer-inline-action.save {
  background: #168a5a;
  border-color: #0f6f47;
}

.ai-dialog-answer-inline-action.export {
  background: #a44912;
  border-color: #87380b;
}

.ai-dialog-answer-inline-action:hover {
  filter: brightness(1.08);
}

.ai-dialog-answer-inline-action:focus-visible {
  outline: 2px solid #0b315f;
  outline-offset: 2px;
}

.ai-dialog-message-body {
  font-weight: 400;
  overflow-wrap: anywhere;
  white-space: normal;
}

.ai-dialog-message.user .ai-dialog-message-body,
.ai-dialog-message.service .ai-dialog-message-body {
  white-space: pre-wrap;
}

.ai-dialog-inline-image {
  margin: 8px auto;
  max-width: 92%;
  white-space: normal;
}

.ai-dialog-inline-download {
  background: #1f6feb;
  border: 1px solid #1659c7;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 700;
  line-height: 18px;
  margin: 3px 0;
  padding: 4px 9px;
  text-decoration: none;
}

.ai-dialog-inline-download:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.ai-dialog-inline-image img {
  background: #fff;
  border: 1px solid #b8dcff;
  border-radius: 6px;
  display: block;
  height: auto;
  margin: 0 auto;
  max-height: 420px;
  max-width: 100%;
  object-fit: contain;
}

.ai-dialog-inline-image figcaption {
  color: #496782;
  font-size: 12px;
  margin-top: 4px;
}

.ai-dialog-message.user {
  margin-left: auto;
  text-align: right;
}

.ai-dialog-message.assistant {
  margin-right: auto;
}

.ai-dialog-message.assistant .ai-dialog-message-body > div {
  margin: 0 0 8px;
}

.ai-dialog-message.assistant .ai-dialog-message-body > div:last-child {
  margin-bottom: 0;
}

.ai-dialog-message.service {
  color: var(--ai-dialog-service-color, #496782);
  font-size: inherit;
  line-height: inherit;
  font-style: italic;
  font-weight: 400;
  margin-right: auto;
  max-width: 100%;
}

.ai-dialog-call-separator {
  color: var(--ai-dialog-separator-color, #9fcaff);
  font-weight: 600;
  margin: 1em 0;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

.ai-dialog-table-wrap {
  margin: 6px 0 10px;
  max-width: 100%;
  overflow-x: auto;
}

.ai-dialog-markdown-table {
  border-collapse: collapse;
  color: #1f2d3d;
  font-weight: 400;
  min-width: min(100%, 420px);
  table-layout: fixed;
  width: 100%;
}

.ai-dialog-markdown-table th,
.ai-dialog-markdown-table td {
  background: var(--ai-dialog-table-body-bg, rgb(184, 251, 208));
  border: 1px solid #8bc9a0;
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

.ai-dialog-markdown-table th {
  background: var(--ai-dialog-table-header-bg, rgb(107, 243, 156));
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  vertical-align: middle;
  word-break: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.ai-dialog-markdown-table th:first-child,
.ai-dialog-markdown-table td:first-child {
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
  white-space: nowrap;
  width: 34px;
}

.ai-dialog-markdown-table[data-column-count="8"],
.ai-dialog-markdown-table[data-column-count="9"],
.ai-dialog-markdown-table[data-column-count="10"],
.ai-dialog-markdown-table[data-column-count="11"],
.ai-dialog-markdown-table[data-column-count="12"] {
  font-size: 15px;
}

.ai-dialog-rendered-list {
  color: #1f2d3d;
  list-style: none;
  margin: 6px 0 10px;
  padding-left: 18px;
}

.ai-dialog-rendered-list li {
  line-height: 1.45;
  margin: 4px 0 4px var(--ai-dialog-list-indent, 0px);
}

.ai-dialog-list-marker {
  color: #1f4f8a;
  font-weight: 700;
  margin-right: 5px;
}

.ai-dialog-input-row {
  align-items: stretch;
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(360px, 445px) minmax(0, 1fr);
  margin-top: 8px;
  min-width: 0;
  width: 100%;
}

.ai-dialog-input-wrap {
  background: #fff;
  border: 1px solid #b8dcff;
  border-radius: 4px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  height: 110px;
  padding: 6px;
  position: relative;
}

.ai-dialog-input-wrap textarea {
  background: transparent;
  border: 0;
  color: #0b315f;
  font-family: inherit;
  font-size: 13px;
  height: 100%;
  line-height: 18px;
  outline: none;
  padding: 2px 4px;
  resize: none;
  width: 100%;
  z-index: 1;
}

.ai-dialog-input-placeholder {
  color: #6d7c8b;
  font-size: 13px;
  font-style: italic;
  left: 10px;
  line-height: 18px;
  pointer-events: none;
  position: absolute;
  right: 34px;
  top: 10px;
}

.ai-dialog-input-wrap.has-value .ai-dialog-input-placeholder {
  display: none;
}

.ai-dialog-input-icons {
  align-items: end;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: space-between;
  z-index: 2;
}

.ai-dialog-icon-button {
  align-items: center;
  background: #fff;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  line-height: 18px;
  padding: 0;
  width: 20px;
}

.ai-dialog-icon-button.clear {
  border: 1px solid #f00;
  color: #f00;
}

.ai-dialog-icon-button.clear:hover:not(:disabled) {
  background: #ffe9e9;
}

.ai-dialog-icon-button.export {
  border: 1px solid #16a829;
  color: #16a829;
}

.ai-dialog-icon-button.export:hover:not(:disabled) {
  background: #eaffee;
}

.ai-dialog-icon-button.send {
  border: 1px solid #00c000;
  color: #00c000;
}

.ai-dialog-icon-button.send:hover:not(:disabled) {
  background: #e4ffe8;
}

.ai-dialog-icon-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.ai-dialog-controls {
  align-content: start;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  position: relative;
}

.ai-dialog-controls .action-button {
  min-height: 28px;
  padding-left: 10px;
  padding-right: 10px;
}

.ai-dialog-split {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
}

.ai-dialog-split .action-button {
  min-width: 0;
}

.ai-dialog-split .action-button:first-child {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
}

.ai-dialog-split .action-button:last-child {
  border-bottom-left-radius: 0;
  border-left: 0;
  border-top-left-radius: 0;
}

.ai-dialog-badge-button {
  position: relative;
}

.ai-dialog-dropdown-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  padding-left: 28px;
  padding-right: 28px;
  position: relative;
}

.ai-dialog-dropdown-arrow {
  align-items: center;
  display: inline-flex;
  font-size: 17px;
  font-weight: 800;
  height: 14px;
  justify-content: center;
  line-height: 14px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-62%);
  width: 14px;
}

.ai-dialog-dropdown-arrow::before {
  content: "∨";
}

#add-ai-dialog-message-button,
#ai-dialog-fullscreen-send-button {
  justify-self: start;
  min-width: 88px;
  width: 88px;
}

.ai-dialog-settings-button {
  grid-column: 3;
}

.ai-dialog-answer-badge {
  align-items: center;
  background: #d92323;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  height: 18px;
  justify-content: center;
  position: absolute;
  right: -7px;
  top: -7px;
  width: 18px;
}

.ai-dialog-answer-badge.hidden {
  display: none;
}

.ai-dialog-settings-button {
  grid-column: 3;
}

.ai-dialog-recent-prompts-panel {
  background: #fff;
  border: 1px solid #9fcaff;
  box-shadow: 0 10px 22px rgba(27, 76, 128, 0.18);
  display: grid;
  gap: 4px;
  left: 0;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  top: 36px;
  width: min(520px, 70vw);
  z-index: 20;
}

.ai-dialog-recent-prompts-panel.hidden {
  display: none;
}

.ai-dialog-recent-prompt {
  background: #f4f9ff;
  border: 1px solid #c4e0ff;
  border-radius: 5px;
  color: #0b315f;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  line-height: 17px;
  padding: 7px;
  text-align: left;
}

.ai-dialog-recent-prompt:hover {
  background: #dceeff;
}

.ai-dialog-recent-prompts-form {
  gap: 6px;
  height: min(420px, 74vh);
  margin: 0;
  max-height: min(420px, 74vh);
  max-width: min(820px, calc(100vw - 48px));
  min-width: min(760px, calc(100vw - 48px));
  padding: 8px;
  width: min(820px, calc(100vw - 48px));
}

#ai-dialog-recent-prompts-dialog {
  border: 1px solid #9fcaff;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(27, 76, 128, 0.22);
  margin: 0;
  padding: 0;
  position: fixed;
}

#ai-dialog-recent-prompts-dialog::backdrop,
#ai-dialog-recent-prompt-full-dialog::backdrop {
  background: transparent;
}

.ai-dialog-recent-prompts-form h2,
.ai-dialog-recent-prompt-full-form h2 {
  color: #0b315f;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  margin: 0;
}

.ai-dialog-recent-prompts-table-wrap {
  border: 1px solid #c8dbea;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.ai-dialog-recent-prompts-table {
  border-collapse: collapse;
  color: #061c3c;
  font-size: 13px;
  line-height: 17px;
  table-layout: fixed;
  width: 100%;
}

.ai-dialog-recent-prompts-table th,
.ai-dialog-recent-prompts-table td {
  border: 1px solid #d6dce2;
  padding: 3px 4px;
  text-align: left;
  vertical-align: top;
}

.ai-dialog-recent-prompts-table th {
  background: #dceeff;
  font-weight: 700;
  text-align: center;
}

.ai-dialog-recent-prompts-table th:nth-child(1),
.ai-dialog-recent-prompts-table td:nth-child(1) {
  width: 92px;
}

.ai-dialog-recent-prompts-table th:nth-child(3),
.ai-dialog-recent-prompts-table td:nth-child(3) {
  width: 116px;
}

.ai-dialog-recent-prompt-date,
.ai-dialog-recent-prompt-preview {
  overflow-wrap: anywhere;
  white-space: pre-line;
  word-break: normal;
}

.ai-dialog-recent-prompts-table tbody tr:hover {
  background: #eef7ff;
}

.ai-dialog-recent-prompt-open-cell {
  padding: 2px 4px;
}

.ai-dialog-recent-prompt-open-button {
  border-radius: 7px;
  min-height: 34px;
  min-width: 0;
  width: 100%;
}

.ai-dialog-recent-prompts-actions {
  display: flex;
  justify-content: flex-end;
}

.ai-dialog-recent-prompts-actions .secondary-button {
  min-width: 120px;
}

.ai-dialog-recent-prompt-full-form .dialog-actions {
  display: flex;
  justify-content: flex-end;
}

.ai-dialog-recent-prompt-full-form .dialog-actions .action-button,
.ai-dialog-recent-prompt-full-form .dialog-actions .secondary-button {
  min-width: 170px;
}

.ai-dialog-recent-prompt-full-form {
  display: grid;
  gap: 0;
  grid-template-rows: 30px auto minmax(0, 1fr) 50px;
  height: 460px;
  margin: 0;
  max-height: min(460px, 86vh);
  max-width: min(620px, 88vw);
  min-width: min(620px, 88vw);
  padding: 0;
  width: min(620px, 88vw);
}

#ai-dialog-recent-prompt-full-dialog {
  background: #eef7ff;
  border: 1px solid #9fcaff;
  border-radius: 0;
  box-shadow: 0 14px 30px rgba(27, 76, 128, 0.22);
  left: 50%;
  margin: 0;
  padding: 0;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
}

#ai-dialog-recent-prompt-full-dialog .ai-dialog-recent-prompt-full-form h2 {
  align-items: center;
  background: #dceeff;
  border-bottom: 1px solid #9fcaff;
  color: #0b315f;
  display: flex;
  font-size: 13px;
  height: 30px;
  line-height: 30px;
  margin: 0;
  padding: 0 12px;
}

#ai-dialog-recent-prompt-full-dialog .ai-dialog-recent-prompt-full-form h2::after {
  color: #0b315f;
  content: "×";
  font-size: 18px;
  font-weight: 400;
  margin-left: auto;
}

.ai-dialog-recent-prompt-full-form label {
  color: #061c3c;
  font-size: 13px;
  padding: 10px 10px 6px;
}

#ai-dialog-recent-prompt-full-text {
  border: 1px solid #b8dcff;
  border-radius: 7px;
  color: #061c3c;
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  line-height: 18px;
  margin: 0 10px;
  min-height: 0;
  padding: 12px;
  resize: none;
}

#ai-dialog-recent-prompt-full-text:focus {
  border-color: #9fcaff;
  outline: none;
}

.ai-dialog-recent-prompt-full-form .dialog-actions {
  align-items: center;
  background: #eef7ff;
  gap: 8px;
  margin: 0;
  padding: 0 10px 10px;
}

.ai-dialog-recent-prompt-full-form .dialog-actions .action-button,
.ai-dialog-recent-prompt-full-form .dialog-actions .secondary-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  width: auto;
}

.ai-dialog-recent-prompt-full-form .dialog-actions .action-button {
  min-width: 184px;
}

.ai-dialog-recent-prompt-full-form .dialog-actions .secondary-button {
  min-width: 90px;
}

.ai-dialog-answer-actions-menu {
  background: #edf5ff;
  border: 1px solid #b8d7f6;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 0;
  left: var(--ai-dialog-answer-actions-menu-left, 0);
  padding: 2px;
  position: absolute;
  top: var(--ai-dialog-answer-actions-menu-top, 112px);
  width: var(--ai-dialog-answer-actions-menu-width, min(360px, 60vw));
  z-index: 20;
}

.ai-dialog-answer-actions-menu.hidden {
  display: none;
}

.ai-dialog-answer-actions-menu button {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #0b315f;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  padding: 3px 6px;
  text-align: left;
}

#ai-dialogs-status {
  flex: 0 0 auto;
  line-height: 18px;
  margin: 0;
  min-height: 18px;
  padding: 0 4px;
}

.ai-dialog-answer-actions-menu button:hover {
  background: #c7e4ff;
}

.ai-dialog-questions-form {
  background: #edf5ff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 80vh;
  max-height: 80vh;
  min-height: 80vh;
  width: min(1040px, 96vw);
}

#ai-dialog-questions-dialog h2 {
  display: none;
}

.ai-dialog-questions-list {
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.ai-dialog-question-item {
  border: 1px solid #c8dff6;
  border-radius: 8px;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 0 10px 10px;
}

.ai-dialog-question-title {
  background: #edf5ff;
  color: #0b315f;
  font-weight: 700;
  justify-self: start;
  margin-left: 8px;
  padding: 0 8px;
  transform: translateY(-1px);
}

.ai-dialog-question-readonly {
  align-items: center;
  background: #fff;
  border: 1px solid #b8dcff;
  border-radius: 8px;
  display: flex;
  min-height: 54px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 7px 10px;
  white-space: pre-wrap;
}

.ai-dialog-question-item textarea {
  border: 1px solid #b8dcff;
  border-radius: 5px;
  box-sizing: border-box;
  font-family: inherit;
  min-height: 74px;
  min-width: 0;
  padding: 8px;
  resize: vertical;
  width: 100%;
}

.ai-dialog-question-item textarea:focus {
  border-color: #8fc4fb;
  outline: none;
}

.ai-dialog-question-body {
  display: grid;
  gap: 7px;
  grid-template-columns: 74px minmax(0, 1fr) 112px;
}

.ai-dialog-question-body label {
  align-items: center;
  background: #fff;
  border: 1px solid #c8dff6;
  border-radius: 8px;
  color: #27496a;
  display: flex;
  font-weight: 600;
  justify-content: center;
  min-height: 54px;
  padding: 6px;
}

.ai-dialog-question-clear {
  align-self: start;
  min-width: 100px;
}

.ai-dialog-question-options {
  display: grid;
  gap: 6px;
  grid-column: 2 / 4;
}

.ai-dialog-question-options button {
  background: #cfe6ff;
  border-color: #a8cef8;
  color: #143c67;
  font-weight: 600;
  min-height: 30px;
  white-space: normal;
}

.ai-dialog-question-proposal-details {
  grid-column: 2 / 4;
  min-width: 0;
}

.ai-dialog-question-proposal-details summary {
  color: #143c67;
  cursor: pointer;
}

.ai-dialog-questions-notice:empty,
.ai-dialog-questions-nav.hidden {
  display: none;
}

.ai-dialog-questions-notice {
  background: #fff;
  border: 1px solid #c8dff6;
  color: #17436f;
  font-weight: 700;
  margin: 0;
  padding: 2px 4px;
}

.ai-dialog-questions-nav {
  align-items: center;
  display: flex;
  gap: 10px;
}

#ai-dialog-questions-dialog .dialog-actions {
  align-items: center;
  border-top: 1px solid #c8dff6;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr auto auto;
  margin-top: 0;
  padding-top: 8px;
}

#ai-dialog-questions-dialog .dialog-actions button {
  align-self: center;
  box-sizing: border-box;
  min-height: 34px;
  padding: 7px 16px;
}

#terminate-ai-dialog-questions-button {
  grid-column: 1;
  grid-row: 1;
}

#save-ai-dialog-answers-button {
  display: none;
}

#send-ai-dialog-answers-button {
  grid-column: 4;
  grid-row: 1;
}

#ai-dialog-questions-dialog .dialog-actions button[value="cancel"] {
  grid-column: 3;
  grid-row: 1;
}

#ai-dialog-questions-dialog .dialog-actions button:focus {
  outline: none;
}

#ai-dialog-fullscreen-dialog {
  background: #eef6ff;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  height: 100vh;
  inset: 0;
  margin: 0;
  max-height: 100vh;
  max-width: 100vw;
  overflow: hidden;
  padding: 0;
  position: fixed;
  width: 100vw;
}

#ai-dialog-fullscreen-dialog::backdrop {
  background: #eef6ff;
}

.ai-dialog-fullscreen-form {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
  padding: 8px 16px 0;
  max-width: 100vw;
  min-width: 0;
  width: 100%;
}

.ai-dialog-fullscreen-top-panel {
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  margin-bottom: 0;
  min-width: 0;
  width: 100%;
}

.ai-dialog-fullscreen-top-panel .model-select-row {
  align-items: center;
  display: grid;
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400 !important;
  grid-template-columns: auto 300px;
  column-gap: 38px;
  justify-content: end;
  width: 100%;
}

.ai-dialog-fullscreen-top-panel .model-select-row select {
  width: 300px;
}

#ai-dialog-fullscreen-clock {
  white-space: pre-line;
}

.ai-dialog-fullscreen-main {
  height: auto;
  min-height: 0;
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
  width: 100%;
}

.ai-dialog-fullscreen-messages {
  box-sizing: border-box;
  min-height: 0;
  min-width: 0;
  outline: none;
  width: 100%;
}

.ai-dialog-fullscreen-controls {
  align-content: start;
  min-width: 0;
}

.ai-dialog-fullscreen-main .ai-dialog-input-row {
  grid-template-columns: minmax(320px, 445px) minmax(0, 1fr);
}

.ai-dialog-fullscreen-main .ai-dialog-message {
  box-sizing: border-box;
  min-width: 0;
}

.ai-dialog-fullscreen-main .ai-dialog-message-body {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

#ai-dialog-fullscreen-send-button {
  justify-self: start;
  min-width: 88px;
  width: 88px;
}

.ai-dialog-chat-settings-form {
  width: min(780px, 92vw);
}

.ai-dialog-chat-settings-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.ai-dialog-chat-settings-grid label {
  display: grid;
  font-weight: 700;
  gap: 6px;
}

.ai-dialog-chat-settings-grid input {
  border: 1px solid #b8dcff;
  border-radius: 5px;
  font-family: inherit;
  padding: 7px;
}

#ai-dialog-prompt-master-dialog {
  border: 1px solid #a8b7c5;
  border-radius: 0;
  box-shadow: 0 18px 40px rgba(20, 45, 70, 0.28);
  max-height: calc(100vh - 96px);
  max-width: calc(100vw - 28px);
  padding: 0;
}

#ai-dialog-prompt-master-dialog::backdrop {
  background: rgba(132, 153, 171, 0.45);
}

.ai-dialog-prompt-master-form {
  background: #edf7ff;
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(794px, calc(100vh - 104px));
  overflow: hidden;
  padding: 10px;
  position: relative;
  width: min(1128px, calc(100vw - 32px));
}

.ai-dialog-prompt-master-title {
  color: #0b315f;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  padding-right: 42px;
}

.ai-dialog-prompt-master-window-close {
  align-items: center;
  background: transparent;
  border: 1px solid #9fcaff;
  border-radius: 0;
  color: #1f1f1f;
  cursor: pointer;
  display: inline-flex;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 20px;
  font-weight: 400;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: 42px;
}

.ai-dialog-prompt-master-window-close:hover {
  background: #e81123;
  border-color: #e81123;
  color: #ffffff;
}

.ai-dialog-prompt-master-scope-hidden,
.ai-dialog-prompt-master-selectors.hidden,
.ai-dialog-prompt-master-editor-actions.hidden,
.ai-dialog-prompt-master-fragments.hidden,
.ai-dialog-prompt-master-groups.hidden,
.ai-dialog-prompt-master-hidden-button {
  display: none;
}

.ai-dialog-prompt-master-columns {
  display: grid;
  gap: 8px;
  grid-template-columns: 300px 308px minmax(0, 1fr);
  min-height: 0;
}

.ai-dialog-prompt-master-panel,
.ai-dialog-prompt-master-editor-section,
.ai-dialog-prompt-master-side {
  background: #f7fbff;
  border: 1px solid #c8dff6;
  border-radius: 8px;
  box-sizing: border-box;
  min-width: 0;
  padding: 8px;
}

.ai-dialog-prompt-master-panel {
  display: grid;
  gap: 8px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: 100%;
  overflow: hidden;
}

.ai-dialog-prompt-master-panel h3,
.ai-dialog-prompt-master-editor-section h3 {
  background: #ffffff;
  border: 1px solid #c8dff6;
  color: #0b315f;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  margin: 0 0 6px;
  padding: 0 8px;
  text-align: center;
}

.ai-dialog-prompt-master-list {
  background: #ffffff;
  border: 1px solid #b8dcff;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll !important;
  padding: 4px 8px 4px 4px;
  scrollbar-gutter: stable;
  scrollbar-color: #8f989d #edf7ff;
  scrollbar-width: thin !important;
}

#ai-dialog-prompt-master-group-list,
#ai-dialog-prompt-master-request-list {
  overflow-y: scroll !important;
}

#ai-dialog-prompt-master-group-list::-webkit-scrollbar,
#ai-dialog-prompt-master-request-list::-webkit-scrollbar {
  width: 7px !important;
}

#ai-dialog-prompt-master-group-list::-webkit-scrollbar-track,
#ai-dialog-prompt-master-request-list::-webkit-scrollbar-track {
  background: #f7fbff;
  border-left: 1px solid #e1eef9;
}

#ai-dialog-prompt-master-group-list::-webkit-scrollbar-thumb,
#ai-dialog-prompt-master-request-list::-webkit-scrollbar-thumb {
  background: #8f989d;
  border: 1px solid #f7fbff;
  border-radius: 0;
}

.ai-dialog-prompt-master-list-item {
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 0;
  color: #0b315f;
  cursor: pointer;
  display: block;
  font-family: inherit;
  font-size: 13px;
  line-height: 18px;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  padding: 5px 7px;
  text-align: left;
  width: 100%;
}

.ai-dialog-prompt-master-list-item[draggable="true"] {
  cursor: grab;
}

.ai-dialog-prompt-master-list-item.dragging {
  cursor: grabbing;
  opacity: 0.55;
}

.ai-dialog-prompt-master-list-item.drop-target {
  border-color: #2f6fb0;
  box-shadow: inset 3px 0 0 #2f6fb0, 0 -2px 0 #2f6fb0;
}

.ai-dialog-prompt-master-list-item:hover,
.ai-dialog-prompt-master-list-item.active {
  background: #d9efff;
  border-color: #86bde8;
  box-shadow: inset 3px 0 0 #2f6fb0;
}

.ai-dialog-prompt-master-empty {
  color: #55728a;
  font-size: 13px;
  padding: 8px;
}

.ai-dialog-prompt-master-vertical-actions {
  display: grid;
  gap: 5px;
}

.ai-dialog-prompt-master-group-title {
  background: #e2f7df;
  border: 1px solid #acd7a8;
  color: #0b315f;
  font-size: 13px;
  line-height: 20px;
  overflow: hidden;
  padding: 1px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-dialog-prompt-master-fragment input,
.ai-dialog-prompt-master-fragment textarea {
  background: #ffffff;
  border: 1px solid #b8dcff;
  border-radius: 8px;
  box-sizing: border-box;
  color: #061c3c;
  font-family: inherit;
  font-size: 13px;
  min-width: 0;
  padding: 7px 8px;
  width: 100%;
}

.ai-dialog-prompt-master-editor-section {
  display: grid;
  gap: 8px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.ai-dialog-prompt-master-editor-wrap {
  background: #ffffff;
  border: 1px solid #b8dcff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  min-height: 0;
}

#ai-dialog-prompt-master-buffer {
  border: 0;
  box-sizing: border-box;
  color: #061c3c;
  font-family: inherit;
  font-size: 13px;
  line-height: 18px;
  min-height: 0;
  outline: none;
  padding: 8px;
  resize: none;
  width: 100%;
}

.ai-dialog-prompt-master-icons {
  align-items: stretch;
  display: grid;
  grid-template-rows: 28px 1fr 28px;
  justify-items: center;
  padding: 2px;
}

.ai-dialog-prompt-master-icons button {
  background: #ffffff;
  border: 1px solid #9fcaff;
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  height: 26px;
  line-height: 22px;
  padding: 0;
  width: 26px;
}

#ai-dialog-prompt-master-clear-icon {
  color: #ff0000;
}

#ai-dialog-prompt-master-export-icon,
#ai-dialog-prompt-master-apply-icon {
  align-self: end;
  color: #008000;
}

#ai-dialog-prompt-master-export-icon {
  align-self: center;
}

.ai-dialog-prompt-master-side {
  display: grid;
  gap: 8px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.ai-dialog-prompt-master-side-top {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-dialog-prompt-master-fragments {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.ai-dialog-prompt-master-fragment {
  background: #f7fbff;
  border: 1px solid #c8dff6;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 7px;
}

.ai-dialog-prompt-master-fragment label {
  color: #0b315f;
  display: grid;
  font-weight: 700;
  gap: 4px;
}

.ai-dialog-prompt-master-fragment textarea {
  min-height: 66px;
  resize: vertical;
}

.ai-dialog-prompt-master-side-bottom {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: space-between;
  min-height: 36px;
}

#ai-dialog-prompt-master-dialog .action-button,
#ai-dialog-prompt-master-dialog .secondary-button {
  min-height: 32px;
  white-space: normal;
  width: 100%;
}

#ai-dialog-prompt-master-dialog .ai-dialog-prompt-master-side-bottom .action-button {
  flex: 0 0 auto;
  min-width: max-content;
  padding-left: 18px;
  padding-right: 18px;
  width: auto;
}

#ai-dialog-prompt-master-group-dialog,
#ai-dialog-prompt-master-request-dialog {
  background: #eaf6ff;
  border: 1px solid #8fb6d8;
  border-radius: 0;
  box-shadow: 0 16px 38px rgba(20, 61, 96, 0.26);
  padding: 0;
}

#ai-dialog-prompt-master-request-dialog::backdrop {
  background: rgba(37, 66, 91, 0.42);
}

.ai-dialog-prompt-master-group-form,
.ai-dialog-prompt-master-request-form {
  background: #eaf6ff;
  box-sizing: border-box;
  gap: 10px;
  min-width: 420px;
  padding: 12px;
}

.ai-dialog-prompt-master-request-form {
  min-height: 545px;
  min-width: 744px;
}

.ai-dialog-prompt-master-group-form h2,
.ai-dialog-prompt-master-request-form h2 {
  color: #0b315f;
  font-size: 14px;
  margin: 0;
}

.ai-dialog-prompt-master-request-form textarea {
  background: #ffffff;
  border: 1px solid #8fb6d8;
  min-height: 290px;
  resize: vertical;
}

.dialog-actions.ai-dialog-prompt-master-group-actions,
.dialog-actions.ai-dialog-prompt-master-request-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.dialog-actions.ai-dialog-prompt-master-group-actions button,
.dialog-actions.ai-dialog-prompt-master-request-actions button {
  min-height: 30px;
  min-width: 86px;
  white-space: nowrap;
  width: auto;
}

.dialog-actions.ai-dialog-prompt-master-request-actions {
  align-items: center;
}

.dialog-actions.ai-dialog-prompt-master-request-actions #ai-dialog-prompt-master-request-optimize-button {
  margin-right: auto;
  max-width: none;
  min-width: 250px;
}

#ai-dialog-prompt-master-status {
  color: #33556f;
  margin: 0;
  min-height: 18px;
}

.ai-dialog-prompt-master-editor-actions {
  margin: 0;
  padding: 0;
}

#ai-dialog-more-help-dialog {
  background: #edf7ff;
  border: 1px solid #a8b7c5;
  border-radius: 0;
  box-shadow: 0 14px 34px rgba(20, 45, 70, 0.22);
  max-height: calc(100vh - 42px);
  max-width: calc(100vw - 24px);
  padding: 0;
}

#ai-dialog-more-help-dialog::backdrop {
  background: rgba(132, 153, 171, 0.22);
}

.ai-dialog-more-help-form {
  background: #edf7ff;
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(860px, calc(100vh - 46px));
  overflow: hidden;
  padding: 0 10px 10px;
  width: min(1152px, calc(100vw - 28px));
}

.ai-dialog-more-help-titlebar {
  align-items: center;
  background: #f3f3f3;
  border-bottom: 1px solid #c7c7c7;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 28px;
  min-height: 28px;
}

.ai-dialog-more-help-titlebar h2 {
  color: #1d1d1d;
  font-size: 13px;
  font-weight: 400;
  margin: 0;
}

.ai-dialog-more-help-layout {
  display: grid;
  gap: 8px;
  grid-template-columns: 184px minmax(0, 1fr);
  min-height: 0;
}

.ai-dialog-more-help-left,
.ai-dialog-more-help-main {
  min-height: 0;
  min-width: 0;
}

.ai-dialog-more-help-left {
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto auto minmax(110px, 1fr) auto auto minmax(110px, 1fr) auto;
}

.ai-dialog-more-help-left h3 {
  background: #ffffff;
  border: 1px solid #c8dff6;
  color: #0b315f;
  font-size: 18px;
  font-weight: 700;
  line-height: 22px;
  margin: 0;
  padding: 0 4px;
  text-align: center;
}

.ai-dialog-more-help-left p {
  background: #ffffff;
  border: 1px solid #c8dff6;
  border-radius: 9px;
  color: #4f6f91;
  font-size: 11px;
  line-height: 14px;
  margin: 0;
  padding: 4px;
}

.ai-dialog-help-spheres {
  align-content: start;
  background: #ffffff;
  border: 1px solid #c8dff6;
  display: grid;
  gap: 0;
  grid-auto-rows: min-content;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.ai-dialog-help-sphere {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  color: #061c3c;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  height: 28px;
  line-height: 20px;
  min-height: 28px;
  overflow: hidden;
  padding: 4px 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-dialog-help-sphere.active {
  background: #d9efff;
  box-shadow: inset 4px 0 0 #2b8dff;
  font-weight: 400;
  padding-left: 12px;
}

.ai-dialog-more-help-sphere-buttons {
  display: grid;
  gap: 8px;
}

.ai-dialog-more-help-main {
  --ai-help-open-col-width: 136px;
  --ai-help-alignment-pad: 30px;
  --ai-help-row-number-width: 34px;
  --ai-help-table-scroll-pad: 16px;
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

.ai-dialog-more-help-prompt-label {
  color: #061c3c;
  display: grid;
  font-weight: 400;
  gap: 4px;
}

.ai-dialog-more-help-prompt-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, calc(100% - var(--ai-help-open-col-width) - var(--ai-help-alignment-pad))) calc(var(--ai-help-open-col-width) + var(--ai-help-alignment-pad) - 8px);
}

#ai-dialog-help-proposal-editor {
  background: #ffffff;
  border: 1px solid #b8dcff;
  border-radius: 8px;
  box-sizing: border-box;
  color: #061c3c;
  font-family: inherit;
  font-size: 13px;
  height: 195px;
  line-height: 18px;
  padding: 8px 10px;
  resize: none;
  width: 100%;
}

#ai-dialog-help-insert-button {
  align-self: center;
  min-height: 34px;
}

#ai-dialog-help-proposal-editor[readonly] {
  background: #ffffff;
}

#ai-dialog-help-proposal-editor:focus,
.ai-dialog-help-modal-form input:focus,
.ai-dialog-help-modal-form select:focus,
.ai-dialog-help-modal-form textarea:focus {
  border-color: #8fc4fb;
  outline: none;
}

.ai-dialog-help-generate-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: calc((100% - var(--ai-help-alignment-pad) + var(--ai-help-row-number-width) - var(--ai-help-open-col-width)) / 2) max-content 74px;
}

.ai-dialog-help-generate-button {
  min-height: 34px;
  width: 100%;
}

.ai-dialog-help-count-label {
  color: #061c3c;
  font-weight: 400;
  white-space: nowrap;
}

#ai-dialog-help-proposal-count {
  background: #ffffff;
  border: 1px solid #b8dcff;
  border-radius: 6px;
  box-sizing: border-box;
  color: #061c3c;
  font-family: inherit;
  font-size: 13px;
  height: 34px;
  padding: 4px 7px;
  width: 74px;
}

.ai-dialog-more-help-table-title {
  background: #ffffff;
  border: 1px solid #c8dff6;
  color: #061c3c;
  line-height: 22px;
  margin: 0;
  padding: 0 4px;
}

.ai-dialog-more-help-meta-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 202px;
}

#ai-dialog-more-help-status {
  background: #ffffff;
  border: 1px solid #c8dff6;
  border-radius: 9px;
  color: #061c3c;
  line-height: 22px;
  margin: 0;
  overflow: hidden;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-dialog-more-help-table-wrap {
  background: #ffffff;
  border: 1px solid #c8dff6;
  box-sizing: border-box;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: var(--ai-help-table-scroll-pad);
}

.ai-dialog-more-help-table {
  background: #ffffff;
  border-collapse: separate;
  border-spacing: 0;
  color: #061c3c;
  table-layout: fixed;
  width: 100%;
}

.ai-dialog-more-help-table th,
.ai-dialog-more-help-table td {
  background: #ffffff;
  border: 1px solid #d4e4f4;
  font-size: 13px;
  line-height: 17px;
  padding: 3px 6px;
  vertical-align: top;
}

.ai-dialog-more-help-table tbody tr {
  height: 62px;
}

.ai-dialog-more-help-table th {
  background: #edf7ff;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: center;
}

.ai-dialog-more-help-table th:nth-child(1),
.ai-dialog-more-help-table td:nth-child(1) {
  text-align: center;
  width: var(--ai-help-row-number-width);
}

.ai-dialog-more-help-table th:nth-child(4),
.ai-dialog-more-help-table td:nth-child(4) {
  padding: 0;
  width: var(--ai-help-open-col-width);
}

.ai-dialog-more-help-table td:nth-child(4) {
  position: relative;
}

.ai-dialog-more-help-table td:nth-child(2),
.ai-dialog-more-help-table td:nth-child(3) {
  overflow: hidden;
  white-space: normal;
}

.ai-dialog-help-cell-text {
  display: -webkit-box;
  line-height: 17px;
  max-height: 51px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.ai-dialog-help-open-proposal {
  box-sizing: border-box;
  font-size: 12px;
  height: auto;
  inset: 0;
  line-height: 14px;
  min-height: 0;
  min-width: 0 !important;
  padding: 3px 4px;
  position: absolute;
  width: 100%;
}

.ai-dialog-more-help-actions {
  align-items: center;
  display: grid;
  grid-template-columns: 1fr auto;
  margin: 0;
  padding: 0;
}

.ai-dialog-more-help-actions .action-button {
  justify-self: center;
  min-width: 300px;
}

.ai-dialog-more-help-actions .secondary-button {
  min-width: 156px;
}

.ai-dialog-help-modal-form {
  background: #edf7ff;
  color: #061c3c;
  gap: 10px;
  padding: 0 12px 12px;
}

.ai-dialog-help-modal-form .context-document-titlebar {
  background: #f3f3f3;
  border-bottom: 1px solid #c7c7c7;
  margin: 0 -12px;
  padding: 0 8px;
}

.ai-dialog-help-modal-form label {
  display: grid;
  gap: 6px;
  font-weight: 400;
}

.ai-dialog-help-modal-form input,
.ai-dialog-help-modal-form select,
.ai-dialog-help-modal-form textarea {
  background: #ffffff;
  border: 1px solid #b8dcff;
  border-radius: 7px;
  box-sizing: border-box;
  color: #061c3c;
  font-family: inherit;
  font-size: 13px;
  padding: 7px 8px;
  width: 100%;
}

#ai-dialog-help-sphere-dialog {
  background: #edf7ff;
  border-color: #b8c7d6;
  border-radius: 0;
  box-shadow: 0 14px 34px rgba(0, 31, 67, 0.24);
  min-width: 520px;
  padding: 0;
  width: 520px;
}

.ai-dialog-help-sphere-form {
  gap: 10px;
  min-height: 260px;
  padding: 0 14px 14px;
  width: 100%;
}

.ai-dialog-help-sphere-form .context-document-titlebar {
  margin: 0 -14px;
}

.ai-dialog-help-scope-fieldset {
  display: grid;
  gap: 9px;
}

.ai-dialog-help-scope-caption {
  color: #061c3c;
  font-weight: 400;
  line-height: 18px;
}

.ai-dialog-help-scope-row {
  align-items: center;
  display: flex !important;
  gap: 8px !important;
  margin: 0;
  min-height: 22px;
}

.ai-dialog-help-scope-row input[type="checkbox"] {
  appearance: none;
  background: #ffffff;
  border: 1px solid #4c4c4c;
  border-radius: 0;
  height: 16px;
  margin: 0;
  padding: 0;
  position: relative;
  width: 16px;
  grid-area: box;
  justify-self: center;
}

.ai-dialog-help-scope-row input[type="checkbox"]:checked {
  background: #d7ebff;
  border-color: #2f6fb0;
}

.ai-dialog-help-scope-row input[type="checkbox"]:checked::after {
  border: solid #0067b8;
  border-width: 0 2px 2px 0;
  content: "";
  height: 9px;
  left: 5px;
  position: absolute;
  top: 1px;
  transform: rotate(45deg);
  width: 5px;
}

.ai-dialog-help-scope-title {
  flex: 0 0 auto;
  font-weight: 400;
}

.ai-dialog-help-scope-hint {
  color: #4f6f91;
  flex: 1 1 auto;
  font-size: 12px;
  line-height: 1.25;
  min-width: 0;
}

.ai-dialog-help-sphere-actions {
  justify-content: flex-end;
}

.ai-dialog-help-sphere-actions button {
  min-width: 88px;
  width: auto;
}

#ai-dialog-help-prompt-dialog {
  background: #edf7ff;
  border-color: #b8c7d6;
  border-radius: 0;
  box-shadow: 0 14px 34px rgba(0, 31, 67, 0.24);
  min-width: 760px;
  padding: 0;
  width: min(60vw, 760px);
}

.ai-dialog-help-prompt-form {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: min(60vh, 620px);
  min-height: 500px;
  width: 100%;
  min-width: 760px;
}

.ai-dialog-help-prompt-form textarea {
  border-color: #9fcfff;
  border-radius: 7px;
  line-height: 18px;
  min-height: 0;
  padding: 10px;
  resize: none;
}

.ai-dialog-help-prompt-form > label {
  background: transparent;
  border: 0;
  color: #061c3c;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  font-weight: 700;
  gap: 10px;
  padding: 0;
}

.ai-dialog-help-prompt-form > label > textarea {
  font-weight: 400;
  margin: 0;
  width: 100%;
}

.ai-dialog-help-prompt-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 0;
}

.ai-dialog-help-prompt-actions button {
  justify-self: stretch;
  min-height: 36px;
  min-width: 0;
  width: 100%;
}

.ai-dialog-help-prompt-actions button[value="cancel"] {
  grid-column: 1;
}

.ai-dialog-help-proposal-form {
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(590px, 82vh);
  width: min(780px, 94vw);
}

.ai-dialog-help-proposal-form textarea {
  border-radius: 7px;
  line-height: 18px;
  min-height: 0;
  padding: 12px;
  resize: none;
}

.ai-dialog-help-confirm-form {
  width: min(520px, 94vw);
}

.ai-dialog-help-confirm-form p {
  background: #ffffff;
  border: 1px solid #c8dff6;
  border-radius: 7px;
  line-height: 18px;
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
}

.ai-dialog-help-export-form {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: min(760px, 88vh);
  width: min(1080px, 96vw);
}

.ai-dialog-help-export-preview {
  background: #ffffff;
  border: 1px solid #c8dff6;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.ai-dialog-help-export-preview table {
  border-collapse: collapse;
  width: 100%;
}

.ai-dialog-help-export-preview th,
.ai-dialog-help-export-preview td {
  border: 1px solid #777;
  padding: 5px;
  vertical-align: top;
}

.ai-dialog-help-export-preview th {
  background: #adff9f;
  text-align: center;
}

.ai-dialog-help-export-preview td {
  background: #d8ffd5;
}

.ai-dialog-help-export-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 0;
}

.ai-dialog-help-export-actions::before {
  content: "";
  flex: 1 1 auto;
}

.ai-dialog-help-export-actions #ai-dialog-help-export-copy-button {
  min-width: 312px;
  width: auto;
}

.ai-dialog-help-export-actions #ai-dialog-help-export-pdf-button,
.ai-dialog-help-export-actions #ai-dialog-help-export-word-button {
  min-width: 138px;
  width: auto;
}

.ai-dialog-help-export-actions #ai-dialog-help-export-word-button {
  margin-right: 30px;
}

.ai-dialog-help-export-actions .secondary-button {
  min-width: 158px;
  width: auto;
}

@media print {
  body.printing-ai-help-export > * {
    visibility: hidden !important;
  }

  body.printing-ai-help-export #ai-dialog-help-export-dialog,
  body.printing-ai-help-export #ai-dialog-help-export-dialog * {
    visibility: visible !important;
  }

  body.printing-ai-help-export #ai-dialog-help-export-dialog {
    border: 0 !important;
    box-shadow: none !important;
    inset: 0 !important;
    max-height: none !important;
    max-width: none !important;
    padding: 0 !important;
    position: fixed !important;
  }

  body.printing-ai-help-export .context-document-titlebar,
  body.printing-ai-help-export #ai-dialog-help-export-dialog label,
  body.printing-ai-help-export #ai-dialog-help-export-dialog .dialog-actions {
    display: none !important;
  }

  body.printing-ai-help-export .ai-dialog-help-export-preview {
    border: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }
}

.ai-dialog-new-event-form {
  background: #eef7ff;
  color: #0b2c51;
  width: min(920px, 94vw);
  height: min(760px, 88vh);
  max-height: min(760px, 88vh);
  overflow: hidden;
  padding: 12px;
  gap: 8px;
  grid-template-rows: auto auto auto auto auto minmax(120px, 1fr) auto auto auto auto auto;
}

#ai-dialog-new-event-dialog,
#ai-dialog-new-event-doc-picker-dialog {
  background: #eef7ff;
  border: 1px solid #b8dcff;
  border-radius: 8px;
}

.ai-dialog-new-event-form h2 {
  font-size: 15px;
  margin: 0 0 4px;
}

.ai-dialog-new-event-docs-button {
  justify-self: start;
  min-width: min(430px, 100%);
  width: auto;
}

.ai-dialog-new-event-docs-panel {
  display: grid;
  gap: 4px;
}

.ai-dialog-new-event-docs-list {
  border: 1px solid #b8dcff;
  border-radius: 0;
  background: #f7fbff;
  color: #0b2c51;
  font-weight: 400;
  line-height: 1.25;
  max-height: 52px;
  min-height: 20px;
  overflow: auto;
  padding: 2px 4px;
}

.ai-dialog-new-event-label {
  display: grid;
  font-weight: 700;
  gap: 4px;
}

.ai-dialog-new-event-label textarea {
  background: #ffffff;
  border: 1px solid #b8dcff;
  border-radius: 5px;
  font-family: inherit;
  padding: 8px;
  resize: none;
}

.ai-dialog-new-event-label #ai-dialog-new-event-description {
  height: 96px;
  min-height: 96px;
}

.ai-dialog-new-event-label #ai-dialog-new-event-metadata {
  height: 86px;
  min-height: 86px;
}

.ai-dialog-new-event-label #ai-dialog-new-event-tasks {
  height: 100%;
  min-height: 130px;
}

.secondary-button.ai-dialog-new-event-personal-button {
  justify-self: start;
  max-width: 760px;
  min-width: 560px;
  width: 560px;
}

.ai-dialog-new-event-personal-button.confirmed {
  background: #e8f5e9;
  border-color: #66bb6a;
  color: #1b5e20;
  font-weight: 400;
}

.ai-dialog-new-event-form .dialog-hint {
  margin: 0;
}

.ai-dialog-new-event-form .dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.ai-dialog-new-event-form .dialog-actions button {
  min-width: 136px;
}

.ai-dialog-new-event-picker-form {
  background: #eef7ff;
  color: #0b2c51;
  width: min(860px, 92vw);
  height: min(540px, 86vh);
  max-height: min(540px, 86vh);
  overflow: hidden;
  padding: 12px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.ai-dialog-new-event-picker-form h2 {
  font-size: 15px;
  margin: 0 0 4px;
}

.ai-dialog-new-event-picker-hint {
  background: #f7fbff;
  border: 1px solid #cfe3fa;
  margin: 0;
  padding: 2px 4px;
}

.ai-dialog-new-event-doc-picker-list {
  background: #ffffff;
  border: 1px solid #d4d4d4;
  border-radius: 0;
  min-height: 0;
  overflow: auto;
}

.ai-dialog-new-event-doc-picker-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.ai-dialog-new-event-doc-picker-table th,
.ai-dialog-new-event-doc-picker-table td {
  border: 1px solid #d4d4d4;
  padding: 4px 6px;
  text-align: left;
  vertical-align: middle;
}

.ai-dialog-new-event-doc-picker-table th {
  background: #f0f7ff;
  font-weight: 400;
}

.ai-dialog-new-event-doc-picker-table td {
  background: #ffffff;
}

.ai-dialog-new-event-doc-picker-table th:nth-child(1),
.ai-dialog-new-event-doc-picker-table td:nth-child(1) {
  text-align: center;
  width: 52px;
}

.ai-dialog-new-event-doc-picker-table th:nth-child(2),
.ai-dialog-new-event-doc-picker-table td:nth-child(2) {
  width: auto;
}

.ai-dialog-new-event-doc-picker-table th:nth-child(3),
.ai-dialog-new-event-doc-picker-table td:nth-child(3) {
  width: 170px;
}

.ai-dialog-new-event-doc-picker-table th:nth-child(4),
.ai-dialog-new-event-doc-picker-table td:nth-child(4) {
  width: 78px;
}

.ai-dialog-new-event-doc-picker-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-dialog-new-event-picker-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
}

.ai-dialog-new-event-picker-actions button {
  min-width: 120px;
}

#ai-dialog-save-answer-dialog,
#saved-ai-answer-dialog {
  border: 1px solid #9fcaff;
  border-radius: 0;
  box-shadow: 0 14px 38px rgb(0 0 0 / 18%);
  height: min(82vh, 820px);
  max-height: 820px;
  max-width: 1024px;
  padding: 0;
  width: 80vw;
}

#ai-dialog-save-answer-dialog::backdrop,
#ai-dialog-save-answer-fullscreen-dialog::backdrop,
#saved-ai-answer-dialog::backdrop,
#saved-ai-answer-fullscreen-dialog::backdrop {
  background: rgb(20 45 70 / 30%);
}

.ai-dialog-save-answer-form {
  background: #eef6ff;
  box-sizing: border-box;
  gap: 9px;
  grid-template-rows: 24px 58px 110px 36px minmax(190px, 1fr) 36px 22px 40px;
  height: 100%;
  padding: 14px;
}

#saved-ai-answer-dialog.view-mode .saved-ai-answer-form {
  grid-template-rows: 24px 58px 90px 56px minmax(0, 1fr) 22px 40px;
}

.ai-dialog-save-answer-titlebar {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
}

.ai-dialog-save-answer-titlebar span,
.ai-dialog-save-answer-text-row span {
  color: #09233f;
  font-weight: 600;
}

.ai-dialog-save-answer-form .ai-dialog-save-answer-title-label,
.ai-dialog-save-answer-form .ai-dialog-save-answer-metadata-label {
  display: grid;
  gap: 6px;
  font-weight: 400;
  min-height: 0;
}

.ai-dialog-save-answer-form input,
.ai-dialog-save-answer-form textarea {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-sizing: border-box;
  color: #09233f;
  font: inherit;
  font-weight: 400;
  padding: 8px 10px;
  resize: none;
  width: 100%;
}

.ai-dialog-save-answer-form textarea {
  height: 100%;
  line-height: 1.35;
}

.ai-dialog-save-answer-title-label input {
  height: 32px;
}

.ai-dialog-save-answer-metadata-label textarea {
  min-height: 82px;
}

#ai-dialog-save-answer-content {
  min-height: 190px;
  max-height: 270px;
}

#saved-ai-answer-content {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-sizing: border-box;
  color: #09233f;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.42;
  overflow: auto;
  padding: 8px 10px;
  min-height: 190px;
  white-space: normal;
}

#saved-ai-answer-dialog.view-mode #saved-ai-answer-content {
  height: 100%;
  min-height: 0;
}

#saved-ai-answer-content[contenteditable="true"]:empty::before {
  color: #6f86a0;
  content: attr(data-placeholder);
  display: block;
  font-style: italic;
  line-height: 1.35;
  pointer-events: none;
  white-space: pre-wrap;
}

#saved-ai-answer-content:focus,
#saved-ai-answer-fullscreen-content:focus {
  border-color: #79b8ff;
  outline: none;
}

.ai-dialog-save-answer-text-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.ai-dialog-save-answer-text-row button {
  margin-left: auto;
}

.ai-dialog-save-answer-personal-button {
  justify-self: start;
  min-width: 560px;
  background: #fff8e1;
  border-color: #f9a825;
  color: #5d4037;
}

.ai-dialog-save-answer-personal-button.confirmed {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #1b5e20;
}

.ai-dialog-save-answer-status {
  margin: 0;
}

.ai-dialog-save-answer-actions {
  justify-content: flex-end;
}

.saved-ai-answer-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.saved-ai-answer-actions #saved-ai-answer-add-context-button {
  min-width: 390px;
}

#ai-dialog-save-answer-fullscreen-dialog,
#saved-ai-answer-fullscreen-dialog {
  border: 1px solid #9fcaff;
  height: 92vh;
  max-width: none;
  padding: 0;
  width: 96vw;
}

.ai-dialog-save-answer-fullscreen-form,
.saved-ai-answer-fullscreen-form {
  background: #eef6ff;
  box-sizing: border-box;
  grid-template-rows: minmax(0, 1fr) 42px;
  height: 100%;
  padding: 14px;
}

.ai-dialog-save-answer-fullscreen-form textarea,
.saved-ai-answer-fullscreen-form textarea,
#saved-ai-answer-fullscreen-content {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  box-sizing: border-box;
  color: #061c3c;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.42;
  overflow: auto;
  padding: 10px;
  resize: none;
}

.ai-dialog-saved-answer-rendered .ai-dialog-table-wrap {
  margin: 8px 0;
  max-width: 100%;
}

.ai-dialog-saved-answer-rendered .ai-dialog-markdown-table {
  font-size: 13px;
}

.ai-dialog-saved-answer-rendered.readonly {
  cursor: default;
}

.ai-dialog-save-answer-fullscreen-actions,
.saved-ai-answer-fullscreen-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.saved-ai-answer-fullscreen-actions button {
  flex: 0 1 270px;
  min-width: 220px;
}

.ai-dialog-export-preview-form {
  background: #f1f7ff;
  box-sizing: border-box;
  gap: 8px;
  grid-template-rows: 24px 34px 34px minmax(220px, 1fr) 42px;
  height: min(86vh, 820px);
  max-width: 1080px;
  padding: 12px;
  width: min(86vw, 1080px);
}

.ai-dialog-export-preview-form h2 {
  font-size: 14px;
  margin: 0;
}

.ai-dialog-export-preview-form label {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: max-content minmax(0, 1fr);
  font-weight: 400;
}

.ai-dialog-export-preview-form input,
.ai-dialog-export-preview-form select {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  box-sizing: border-box;
  color: #09233f;
  font: inherit;
  font-weight: 400;
  min-height: 32px;
  padding: 6px 10px;
}

.ai-dialog-export-preview-content {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  box-sizing: border-box;
  color: #09233f;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.35;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.ai-dialog-export-preview-content .export-section-title {
  font-weight: 700;
  margin: 10px 0 4px;
}

.ai-dialog-export-preview-content .export-footer {
  margin-top: 14px;
}

.ai-dialog-export-preview-content .service {
  font-size: inherit;
  font-style: italic;
}

.ai-dialog-message.assistant mark,
.ai-dialog-export-preview-content mark {
  background: #fff2a8;
  color: inherit;
  padding: 0 2px;
}

.ai-dialog-inline-code {
  color: #444;
  background: #eef6ff;
  border: 1px solid #c8def5;
  padding: 0 2px;
}

.dialog-actions.ai-dialog-export-preview-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 0;
  min-height: 0;
}

.dialog-actions.ai-dialog-export-preview-actions button {
  flex: 0 0 auto;
  min-height: 34px;
}

.dialog-actions.ai-dialog-export-preview-actions #copy-ai-dialog-export-preview-button {
  min-width: 280px;
}

.dialog-actions.ai-dialog-export-preview-actions #export-ai-dialog-preview-pdf-button,
.dialog-actions.ai-dialog-export-preview-actions #export-ai-dialog-preview-word-button {
  min-width: 144px;
}

.dialog-actions.ai-dialog-export-preview-actions button[value="cancel"] {
  min-width: 158px;
}

.ai-dialog-export-preview-spacer {
  flex: 1 1 38px;
}

.ai-inline-editor {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  font-size: 13px;
}

.ai-inline-editor textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #9aa7b8;
  padding: 7px;
  font-family: inherit;
}

.billing-right-frame {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.billing-filter-gap {
  height: 20px;
}

.billing-table-panel {
  max-height: calc(100vh - 305px);
  overflow: auto;
  border: 1px solid var(--panel-border);
  background: #fff;
}

.billing-table {
  width: 100%;
  min-width: 1340px;
  border-collapse: collapse;
  background: #fff;
}

.billing-table th,
.billing-table td {
  border: 1px solid var(--grid);
  padding: 7px 8px;
  vertical-align: top;
}

.billing-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6fbff;
  font-weight: 600;
}

.billing-table tbody tr:hover,
.billing-table tbody tr:focus {
  background: #e8f3ff;
}

.billing-table tbody tr.selected {
  background: #cfe7ff;
  outline: 1px solid var(--button-border);
}

.billing-summary-bar {
  margin-top: 10px;
}

.chronology-table th,
.chronology-table td {
  background: #ffffff;
  border: 1px solid var(--grid);
  box-sizing: border-box;
  max-width: 0;
  overflow-wrap: anywhere;
  padding: 4px 5px;
  vertical-align: top;
  word-break: break-word;
}

.chronology-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6fbff;
  font-weight: 700;
  text-align: center;
}

.chronology-table th[data-column-key="rowNumber"],
.chronology-table td[data-column-key="rowNumber"] {
  text-align: center;
  white-space: nowrap;
}

.chronology-table th[data-column-key="date"],
.chronology-table td[data-column-key="date"] {
  overflow-wrap: normal;
  white-space: normal;
  word-break: normal;
}

.chronology-column-header {
  cursor: grab;
  min-width: 50px;
  position: relative;
  user-select: none;
}

.chronology-column-header.dragging {
  opacity: 0.55;
}

.chronology-column-title {
  display: block;
  padding-right: 8px;
}

.chronology-column-resizer {
  bottom: 0;
  cursor: col-resize;
  position: absolute;
  right: -3px;
  top: 0;
  width: 8px;
  z-index: 2;
}

.chronology-column-resizer:hover {
  background: rgba(31, 115, 209, 0.16);
}

.column-resizing {
  cursor: col-resize;
  user-select: none;
}

.chronology-table tbody tr:hover,
.chronology-table tbody tr:focus {
  background: #e8f3ff;
}

.chronology-table tbody tr:hover td,
.chronology-table tbody tr:focus td {
  background: #e8f3ff;
}

.chronology-table tbody tr.selected {
  background: #cfe7ff;
  outline: 1px solid var(--button-border);
}

.chronology-table tbody tr.selected td {
  background: #cfe7ff;
}

.chronology-bottom-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.chronology-bottom-bar .compact-button {
  min-height: 36px;
  padding: 0 14px;
}

.chronology-side-export-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
}

.chronology-side-export-actions .action-button {
  width: 100%;
}

.chronology-spacer {
  flex: 1;
}

.zoom-button {
  width: 30px;
  height: 28px;
  border: 1px solid var(--button-border);
  border-radius: 6px;
  background: var(--button);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.zoom-value {
  min-width: 56px;
  text-align: right;
}

.project-start-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 12px;
  min-height: calc(100vh - 365px);
}

.project-start-left,
.project-start-right {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px 14px;
}

.field-label {
  min-height: 20px;
  margin: 0 0 10px;
  border: 1px solid var(--panel-border);
  background: #fff;
  font-weight: 700;
  line-height: 18px;
  padding: 0 4px;
  text-align: center;
}

.description-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 10px;
}

.description-save-box {
  display: flex;
  align-items: flex-start;
}

.project-start-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.start-analysis-hint {
  margin-top: clamp(56px, 13vh, 150px);
  border: 1px solid #b9d7f4;
  border-radius: 8px;
  background: #ffffff;
  color: #0c3865;
  font-size: 15px;
  line-height: 1.28;
  padding: 12px 14px;
}

.start-analysis-hint strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.start-analysis-hint ol {
  margin: 0;
  padding-left: 20px;
}

.start-analysis-hint li {
  margin: 5px 0;
}

#project-detail-start-description {
  width: 100%;
  border: 1px solid var(--panel-border);
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 6px 8px;
}

#project-detail-start-description {
  min-height: calc(100vh - 476px);
  resize: vertical;
  border-radius: 8px;
}

.actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding-top: 12px;
}

.action-button,
.secondary-button {
  background: var(--button);
  border: 1px solid var(--button-border);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 1px rgba(17, 60, 105, 0.12);
  color: #123d70;
  font-weight: 600;
  margin-bottom: 0;
  min-height: 36px;
  min-width: 132px;
  padding: 0 16px;
  transition: background-color 25ms linear, border-color 25ms linear, box-shadow 25ms linear, filter 25ms linear, transform 25ms linear;
  width: auto;
}

.compact-button {
  min-width: 154px;
  width: auto;
}

.secondary-button {
  background: #f8fbff;
}

.action-button:hover,
.secondary-button:hover {
  filter: brightness(0.98);
}

.action-button:active:not(:disabled),
.secondary-button:active:not(:disabled) {
  background: #a9d3f8;
  border-color: #5fa4e4;
  box-shadow: inset 0 2px 4px rgba(20, 72, 122, 0.28);
  filter: brightness(0.96);
  transform: translateY(1px);
}

.dialog-actions.ai-dialog-help-export-actions button:active:not(:disabled) {
  background: #9fcaf0;
  border-color: #4d95d6;
  box-shadow: inset 0 2px 5px rgba(10, 54, 98, 0.32);
}

.action-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.15);
  opacity: 0.55;
}

.danger {
  color: #783030;
}

.status-line,
.muted {
  color: var(--muted);
}

.status-line {
  margin-left: 4px;
}

dialog {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  min-width: 520px;
}

#chronology-event-dialog {
  width: min(70vw, 1120px);
  min-width: 760px;
  height: min(74vh, 780px);
  min-height: 700px;
  background: var(--bg);
  border-color: var(--panel-border);
  padding: 0;
}

#billing-event-dialog {
  width: min(70vw, 1120px);
  min-width: 760px;
  height: min(76vh, 820px);
  min-height: 620px;
}

#delete-chronology-event-dialog {
  width: min(420px, 90vw);
}

#delete-billing-event-dialog {
  width: min(420px, 90vw);
}

#billing-filter-dialog {
  width: min(760px, 92vw);
  min-width: 640px;
}

#final-model-add-dialog {
  background: #eef6ff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(9, 35, 63, 0.24);
  min-width: 520px;
  padding: 0;
  width: min(48vw, 620px);
}

#special-llm-model-dialog {
  background: #eef6ff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(9, 35, 63, 0.24);
  min-width: 560px;
  padding: 0;
  width: min(52vw, 700px);
}

#context-element-dialog,
#account-context-document-dialog,
#full-context-dialog {
  width: min(80vw, 1280px);
  min-width: 960px;
  height: min(94vh, 820px);
  min-height: 760px;
}

#context-element-dialog,
#account-context-document-dialog {
  background: #eef6ff;
  border: 1px solid var(--panel-border);
  border-radius: 0;
  height: min(86vh, 860px);
  min-height: 720px;
  min-width: 960px;
  padding: 0;
  width: min(80vw, 1120px);
}

#context-text-fullscreen-dialog {
  background: #eef6ff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100vh;
  margin: 0;
  max-height: 100vh;
  max-width: 100vw;
  min-height: 0;
  min-width: 0;
  padding: 0;
  width: 100vw;
}

#context-text-fullscreen-dialog::backdrop {
  background: transparent;
}

#context-source-selection-dialog {
  width: min(72vw, 860px);
  min-width: 720px;
  height: min(70vh, 560px);
  min-height: 460px;
}

#context-validation-dialog,
#context-confirmation-dialog {
  background: #eef6ff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(9, 35, 63, 0.24);
  color: var(--text);
  min-width: 420px;
  padding: 0;
  width: min(44vw, 540px);
}

#full-context-dialog {
  background: #f1f8ff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(9, 35, 63, 0.26);
  padding: 0;
}

#context-element-dialog,
#account-context-document-dialog {
  width: min(70vw, 1120px);
  min-width: 760px;
  height: min(76vh, 820px);
  min-height: 600px;
}

#context-element-dialog,
#account-context-document-dialog {
  width: min(80vw, 1120px);
  min-width: 960px;
  height: min(98vh, 952px);
  max-height: calc(100vh - 16px);
  min-height: 828px;
  overflow: hidden;
}

#context-element-dialog.context-own-tab-readonly {
  height: min(90vh, 800px);
  max-height: calc(100vh - 32px);
  min-height: 0;
}

#project-edit-dialog {
  box-sizing: border-box;
  height: fit-content;
  max-height: calc(100vh - 40px);
  min-width: min(92vw, 520px);
  min-height: 0;
  overflow: visible;
  padding: 12px 14px;
  width: min(92vw, 600px);
}

dialog::backdrop {
  background: rgba(9, 35, 63, 0.3);
}

body:has(#ai-dialog-fullscreen-dialog[open]) {
  overflow: hidden;
}

.dialog-form {
  display: grid;
  gap: 10px;
}

.final-model-add-form {
  gap: 10px;
  padding: 14px 16px 12px;
}

.final-model-add-form h2 {
  margin: 0 0 4px;
  color: #143f70;
  font-size: 20px;
  text-align: center;
}

.final-model-add-form label {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 190px minmax(0, 1fr);
}

.final-model-add-form select {
  min-height: 34px;
  border: 1px solid #cfe3fa;
  border-radius: 8px;
  background: #fff;
  color: #102f55;
  font: inherit;
  padding: 0 8px;
}

.final-model-dialog-status {
  min-height: 18px;
  margin: 0;
}

.final-model-dialog-actions {
  justify-content: flex-end;
}

.special-llm-dialog-description {
  margin: -2px 0 0;
  color: #315c89;
}

#auth-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid #abd0f5;
  border-radius: 10px;
  background: #eef6ff;
  color: var(--text);
  padding: 0;
}

.auth-dialog-form {
  gap: 12px;
  padding: 16px;
}

.auth-dialog-titlebar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.auth-dialog-titlebar h2 {
  margin: 0;
  color: #143f70;
  font-size: 22px;
  text-align: center;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.auth-mode-tab {
  min-height: 34px;
  border: 1px solid var(--button-border);
  border-radius: 8px 8px 0 0;
  background: var(--tab);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
}

.auth-mode-tab.active {
  background: var(--tab-active);
}

.auth-mode-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #c5def7;
  background: #f7fbff;
}

.auth-mode-panel label {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.auth-mode-panel input {
  min-height: 34px;
  border: 1px solid #b8d7f4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 6px 10px;
}

.password-field {
  position: relative;
  display: block;
  min-width: 0;
}

.password-field input {
  width: 100%;
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #143f70;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  border-color: #abd0f5;
  background: #dcedff;
  outline: none;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.password-toggle .eye-slash {
  display: none;
}

.password-toggle.password-visible .eye-slash {
  display: block;
}

.auth-mode-panel .action-button {
  justify-self: end;
  min-width: 190px;
}

.auth-dialog-status {
  min-height: 36px;
  margin: 0;
  font-weight: 400;
}

.dialog-local-status {
  box-sizing: border-box;
  max-height: 140px;
  min-height: 24px;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  width: 100%;
}

.dialog-local-status:empty {
  min-height: 0;
  padding: 0;
}

.dialog-local-status.pending {
  border-color: #9ec8ff;
  background: #eef7ff;
  color: #064d86;
}

.dialog-local-status.error {
  border-color: #ffb3b3;
  background: #fff2f2;
  color: #9b0000;
  font-weight: 600;
}

.chronology-dialog-form {
  background: var(--bg);
  height: 100%;
  gap: 6px;
  grid-template-rows: 31px auto minmax(180px, 1fr) auto minmax(145px, 0.85fr) 36px 22px 45px;
  padding: 0 11px 10px;
}

.chronology-dialog-titlebar {
  align-items: center;
  background: var(--tab);
  display: grid;
  gap: 6px;
  grid-template-columns: 16px minmax(0, 1fr) 34px;
  margin: 0 -11px 7px;
  min-height: 31px;
  padding: 0 4px 0 8px;
}

.chronology-dialog-titlebar h2 {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
}

.dialog-window-icon {
  width: 14px;
  height: 14px;
  border: 1px solid #9ebad8;
  background: linear-gradient(90deg, #8fc4b5 0 45%, #f8fbff 45% 100%);
}

.dialog-window-close {
  width: 28px;
  height: 26px;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  font-size: 24px;
  font-weight: 300;
  line-height: 22px;
}

.chronology-dialog-label {
  gap: 3px;
}

.chronology-dialog-comment-label {
  box-sizing: border-box;
  margin-top: 0;
  padding-top: 18px;
}

.chronology-dialog-textarea-label,
.chronology-dialog-comment-label {
  display: grid;
  grid-template-rows: 18px minmax(0, 1fr);
  align-content: stretch;
  gap: 4px;
  height: 100%;
  min-height: 0;
}

.chronology-dialog-label span {
  align-self: start;
  display: inline-block;
  width: fit-content;
  min-width: 170px;
  max-width: 260px;
  height: 18px;
  max-height: 18px;
  min-height: 18px;
  border: 0;
  background: transparent;
  font-weight: 400;
  justify-self: start;
  line-height: 16px;
  overflow: hidden;
  padding: 0;
}

.chronology-dialog-textarea-label span,
.chronology-dialog-comment-label span {
  min-width: 170px;
}

.chronology-dialog-personal-button {
  justify-self: start;
  box-sizing: border-box;
  min-height: 36px;
  width: min(520px, 100%);
  background: #fff8e1;
  border-color: #f9a825;
  color: #5d4037;
}

.chronology-dialog-personal-button.confirmed {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #1b5e20;
}

#chronology-event-dialog-status {
  margin: 0;
  color: #315a84;
  min-height: 20px;
}

.chronology-dialog-actions {
  align-self: end;
  gap: 6px;
}

.chronology-dialog-actions .action-button,
.chronology-dialog-actions .secondary-button {
  min-height: 35px;
}

.billing-dialog-form {
  height: 100%;
  grid-template-rows: auto auto auto minmax(120px, 1fr) auto auto auto minmax(90px, 0.8fr) auto auto;
}

.billing-filter-form {
  grid-template-columns: 180px minmax(0, 1fr);
}

.context-dialog-form {
  height: 100%;
  background: #eef6ff;
  gap: 10px;
  grid-template-rows: 24px 36px 22px 56px 162px 58px 24px 38px minmax(86px, 1fr) 22px 36px 24px 36px;
  padding: 14px;
}

.account-context-document-form {
  grid-template-rows: 24px 36px 22px 56px 184px 38px minmax(160px, 1fr) 22px 36px 24px 36px;
}

.context-document-titlebar {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: 14px minmax(0, 1fr) 28px;
  min-height: 24px;
}

.context-document-titlebar span {
  color: #09233f;
  font-size: 12px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-document-file-row,
.context-document-text-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.context-file-row-spacer,
.context-document-text-row span + button {
  margin-left: auto;
}

.context-document-file-row .secondary-button {
  min-height: 34px;
}

.context-dialog-status {
  border: 1px solid var(--panel-border);
  background: #fff;
  color: #235181;
  font-weight: 600;
  line-height: 20px;
  margin: 0;
  min-height: 22px;
  padding: 0 4px;
}

.context-dialog-form input::placeholder,
.context-dialog-form textarea::placeholder {
  color: #687b90;
  font-size: 13px;
  font-weight: 400;
}

.context-document-label {
  display: grid;
  gap: 10px;
  font-weight: 400;
  min-height: 0;
}

.context-document-label input,
.context-document-label textarea {
  font-weight: 400;
}

.context-metadata-textarea {
  height: 132px;
  min-height: 132px;
  resize: none;
}

.context-ai-choice-block {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-height: 0;
}

.context-ai-choice-block p {
  flex-basis: 100%;
  margin: 0;
}

.context-ai-choice-block label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.context-ai-choice-block input {
  appearance: none;
  background: #f8fbff;
  border: 1.5px solid #4aa3ec;
  border-radius: 0;
  height: 18px;
  outline: 1px solid rgba(74, 163, 236, 0.28);
  outline-offset: -2px;
  width: 18px;
}

.context-ai-choice-block input:checked {
  background: #d9efff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M4 9.2 7.2 12.4 14 5.6' fill='none' stroke='%230b5cad' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
  border-color: #4aa3ec;
  outline-color: rgba(11, 92, 173, 0.32);
}

.context-document-textarea {
  min-height: 86px;
  resize: none;
}

.context-own-tab-readonly .context-document-label input,
.context-own-tab-readonly .context-document-label textarea,
.context-own-tab-readonly .context-document-textarea {
  background: #f8fbff;
  color: #0b2748;
}

.context-own-tab-readonly .context-dialog-form {
  display: flex;
  flex-direction: column;
  grid-template-rows: none;
}

.context-own-tab-readonly .context-document-label {
  gap: 5px;
  width: 100%;
}

.context-own-tab-readonly .context-document-label:has(#context-element-title) {
  flex: 0 0 58px;
}

.context-own-tab-readonly .context-document-label:has(#context-element-source) {
  flex: 0 0 110px;
}

.context-own-tab-readonly #context-element-title {
  height: 32px;
}

.context-own-tab-readonly #context-element-source {
  height: 82px;
  min-height: 82px;
  resize: none;
}

.context-own-tab-readonly #context-element-content {
  flex: 1 1 145px;
  height: auto;
  min-height: 145px;
  resize: none;
}

.context-own-tab-readonly .context-ai-choice-block,
.context-own-tab-readonly .context-document-text-row,
.context-own-tab-readonly #context-ai-note,
.context-own-tab-readonly #context-symbol-counter,
.context-own-tab-readonly .context-document-actions {
  flex: 0 0 auto;
  width: 100%;
}

.context-own-tab-readonly-note {
  background: #fffdf3;
  border-color: #dfc66c;
  color: #5d4800;
  box-sizing: border-box;
  line-height: 18px;
  min-height: 48px;
  padding: 5px 7px;
  white-space: normal;
}

.dialog-actions.context-document-actions:has(#save-context-element-button.hidden) {
  display: flex;
  justify-content: center;
}

.dialog-actions.context-document-actions:has(#save-context-element-button.hidden) button[value="cancel"] {
  margin-left: 0;
}

.context-personal-data-button {
  justify-self: start;
  min-width: 560px;
  background: #d9efff;
  border-color: #7fb6de;
}

.context-personal-data-button.confirmed {
  background: #e8f5e9;
  border-color: #66bb6a;
  color: #1b5e20;
}

.context-personal-data-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.context-personal-data-controls .context-personal-data-button {
  min-width: 0;
}

.context-personal-data-results-form {
  width: 85vw;
  height: 85vh;
  max-width: 85vw;
  max-height: 85vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

.context-personal-data-table-wrap {
  border: 1px solid #a9cdf2;
  background: #ffffff;
  min-height: 0;
  overflow: auto;
}

.context-personal-data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.context-personal-data-table th,
.context-personal-data-table td {
  border: 1px solid #bcd8f4;
  padding: 6px 8px;
  vertical-align: top;
  word-break: break-word;
}

.context-personal-data-table th {
  background: #dcecff;
  color: #002f63;
  text-align: left;
}

.context-personal-data-table th:nth-child(1) {
  width: 150px;
}

.context-personal-data-table th:nth-child(2) {
  width: 210px;
}

.context-personal-data-table th:nth-child(4) {
  width: 180px;
}

.context-personal-data-table th:nth-child(5) {
  width: 116px;
  text-align: center;
}

.context-personal-data-table td:nth-child(5) {
  text-align: center;
}

.context-personal-data-replacement {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #9ec9f2;
  border-radius: 4px;
  padding: 4px 6px;
  font: inherit;
}

.context-personal-data-decision-buttons {
  display: grid;
  gap: 5px;
  justify-items: stretch;
}

.context-personal-data-decision {
  border: 1px solid #8dbff2;
  border-radius: 4px;
  background: #eef6ff;
  color: #003b79;
  min-height: 26px;
  padding: 3px 6px;
  font: inherit;
  cursor: pointer;
}

.context-personal-data-decision:hover {
  background: #dcecff;
}

.context-personal-data-decision.active[data-finding-decision-button="apply"] {
  background: #dff4e6;
  border-color: #5fb878;
  color: #145c2b;
}

.context-personal-data-decision.active[data-finding-decision-button="reject"] {
  background: #fff0f0;
  border-color: #d46b6b;
  color: #8a1f1f;
}

.context-document-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-start;
  width: 100%;
}

.context-document-actions button[value="cancel"] {
  margin-left: auto;
}

.context-text-fullscreen-form {
  background: #eef6ff;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto auto 48px;
  gap: 10px;
  padding: 38px 14px 14px;
}

.context-text-fullscreen-form textarea {
  background: #ffffff;
  border: 1px solid #111111;
  border-radius: 8px;
  color: #0c2749;
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.28;
  min-height: 0;
  outline: none;
  padding: 12px;
  resize: none;
  width: 100%;
}

.context-text-fullscreen-form textarea:focus {
  border-color: #111111;
  outline: none;
}

.context-source-selection-form {
  background: #eef6ff;
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.context-source-selection-form h2 {
  color: #0a3463;
  font-size: 16px;
  margin: 0;
}

.context-source-selection-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid #b8d7f4;
  background: #ffffff;
}

.context-source-selection-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.context-source-selection-table th,
.context-source-selection-table td {
  border: 1px solid #d4d4d4;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.context-source-selection-table th {
  background: #f3f8fb;
  color: #06284d;
  font-weight: 500;
}

.context-source-selection-table th:last-child,
.context-source-selection-table td:last-child {
  width: 150px;
  white-space: nowrap;
}

.context-source-selection-table tbody tr.selected {
  background: #d9efff;
}

.project-edit-form {
  grid-template-columns: 130px minmax(0, 1fr);
}

.project-edit-form h2,
.project-edit-form .dialog-hint,
.project-edit-form .dialog-local-status,
.project-edit-form .project-edit-actions {
  grid-column: 1 / -1;
}

.project-edit-row {
  display: contents;
}

.project-edit-label {
  align-self: center;
  font-weight: 600;
}

.editable-field-row {
  display: contents;
}

.editable-field-row input {
  width: 100%;
}

.dialog-hint {
  color: var(--muted);
  line-height: 1.35;
}

.full-context-form {
  background: #f1f8ff;
  height: 100%;
  gap: 10px;
  grid-template-rows: 26px minmax(300px, 1fr) 36px;
  padding: 6px 14px 14px;
}

.full-context-titlebar {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: 14px minmax(0, 1fr) 28px;
  min-height: 26px;
}

.full-context-window-icon {
  border: 1px solid #9aaec4;
  height: 12px;
  width: 12px;
  background: linear-gradient(135deg, #eef8ff 0 48%, #6fa2c5 49% 100%);
}

.full-context-titlebar span {
  color: #09233f;
  font-size: 12px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-context-titlebar-close {
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  font-size: 22px;
  line-height: 22px;
  min-height: 24px;
  padding: 0;
  width: 28px;
}

.full-context-titlebar-close:hover {
  background: var(--tab);
}

.billing-filter-form h2,
.billing-filter-form .status-line,
.billing-filter-form .dialog-actions {
  grid-column: 1 / -1;
}

.dialog-form label {
  display: grid;
  gap: 4px;
  font-weight: 600;
  min-height: 0;
}

.dialog-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialog-form .checkbox-label input {
  width: 18px;
  height: 18px;
}

.dialog-form .context-ai-choice-block label {
  align-items: center;
  display: flex;
  gap: 8px;
  height: 20px;
}

.dialog-form .context-ai-choice-block input {
  flex: 0 0 18px;
  height: 18px;
  width: 18px;
}

.dialog-form input {
  height: 32px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
}

.chronology-dialog-form input {
  background: #fff;
  border-radius: 0;
  font-weight: 400;
  height: 28px;
}

#chronology-event-source {
  height: 96px;
  line-height: 1.35;
  padding-bottom: 10px;
  padding-left: 8px;
  padding-right: 8px;
  padding-top: 10px;
  resize: none;
}

.dialog-form select {
  height: 32px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
  background: #fff;
}

.chronology-dialog-form textarea,
.billing-dialog-form textarea,
.context-dialog-form textarea,
.full-context-form textarea {
  height: 100%;
  min-height: 100px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 6px 8px;
  font: inherit;
  resize: vertical;
}

.context-dialog-form #context-element-title,
.context-dialog-form #context-element-source,
.context-dialog-form #context-element-content,
.context-dialog-form #account-context-document-title,
.context-dialog-form #account-context-document-source,
.context-dialog-form #account-context-document-content {
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400 !important;
}

.full-context-form textarea {
  border-color: var(--panel-border);
  border-radius: 4px;
  resize: none;
  background: #fff;
}

.full-context-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 0;
}

.full-context-actions .secondary-button {
  background: #d4eaff;
  border-color: #93c5f3;
  color: #0f3c6d;
  min-height: 34px;
  min-width: 0;
  padding: 0 14px;
}

.full-context-actions .secondary-button:hover {
  background: #c7e2ff;
}

#copy-full-context-button:active,
.full-context-actions .secondary-button:active {
  filter: brightness(0.94);
  transform: translateY(1px);
}

#copy-full-context-button.copied {
  background: #b8dcff;
  border-color: #6fb2ee;
  color: #0b3b6d;
}

#copy-full-context-button {
  width: 204px;
}

.full-context-actions button[value="cancel"] {
  width: 82px;
}

.chronology-dialog-form textarea {
  align-self: stretch;
  background: #fff;
  border-radius: 8px;
  display: block;
  font-weight: 400;
  height: 100%;
  min-height: 0;
  outline: none;
  resize: none;
}

.chronology-dialog-form textarea:focus,
.chronology-dialog-form input:focus {
  border-color: var(--panel-border);
  outline: none;
}

.billing-dialog-form label:has(textarea),
.context-dialog-form label:has(textarea) {
  height: 100%;
}

.context-dialog-form .context-document-label:has(textarea) {
  height: auto;
}

.context-dialog-form .context-document-label textarea {
  height: auto;
}

.delete-dialog-form p {
  margin: 0;
  color: var(--text);
}

.project-delete-form {
  width: min(92vw, 520px);
}

.danger-text {
  color: #8a1f1f;
  font-weight: 700;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.dialog-actions.full-context-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 0;
}

.dialog-actions.full-context-actions .secondary-button {
  flex: 0 0 auto;
}

.dialog-actions.context-document-actions,
.dialog-actions.context-source-selection-actions,
.dialog-actions.context-fullscreen-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 0;
}

.dialog-actions.context-document-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  justify-content: stretch;
  width: 100%;
}

.dialog-actions.context-document-actions #clear-context-element-button {
  justify-self: start;
}

.dialog-actions.context-document-actions #save-context-element-button {
  justify-self: center;
}

.dialog-actions.context-document-actions button[value="cancel"] {
  justify-self: end;
  margin-left: 0;
}

.dialog-actions.context-document-actions button,
.dialog-actions.account-context-document-actions button,
.dialog-actions.context-source-selection-actions button,
.dialog-actions.context-fullscreen-actions button {
  flex: 0 0 auto;
}

.dialog-actions.account-context-document-actions {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "clear save cancel";
  justify-content: stretch;
  margin-top: 0;
  width: 100%;
}

.dialog-actions.account-context-document-actions button {
  min-width: 0;
  white-space: nowrap;
}

.dialog-actions.account-context-document-actions #clear-account-context-document-button {
  grid-area: clear;
  justify-self: start;
  min-width: 160px;
}

.dialog-actions.account-context-document-actions #save-account-context-document-button {
  grid-area: save;
  justify-self: center;
  min-width: 170px;
}

.dialog-actions.account-context-document-actions button[value="cancel"] {
  grid-area: cancel;
  justify-self: end;
  min-width: 92px;
}

#participant-dialog {
  background: transparent;
  border: 0;
  max-height: 92vh;
  max-width: 92vw;
  padding: 0;
  width: min(620px, 92vw);
}

#participant-dialog::backdrop {
  background: rgba(20, 42, 66, 0.34);
}

.participant-dialog-form {
  background: #eaf5ff;
  border: 1px solid #b8d7f4;
  border-radius: 4px;
  box-shadow: 0 18px 36px rgba(9, 35, 63, 0.18);
  color: #0b2748;
  display: grid;
  gap: 12px;
  grid-template-rows: 24px auto 40px;
  min-height: 0;
  padding: 14px;
}

.participant-fieldset {
  background: #f7fbff;
  border: 1px solid #b8d7f4;
  border-radius: 4px;
  margin: 0;
  padding: 12px 14px 14px;
}

.participant-fieldset legend {
  color: #0a3463;
  font-weight: 700;
  padding: 0 4px;
}

.participant-fields {
  display: grid;
  gap: 0;
}

.participant-fieldset label,
.participant-grid-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 170px minmax(0, 1fr);
  margin-bottom: 10px;
}

.participant-fieldset label:last-child,
.participant-grid-row:last-child {
  margin-bottom: 0;
}

.participant-personal-data-button {
  justify-self: stretch;
  margin-top: 2px;
  min-width: 0;
  width: 100%;
}

.participant-personal-data-note {
  border: 1px solid #b8d7f4;
  color: #0a3463;
  font-size: 13px;
  margin: 2px 0 0;
  padding: 4px 6px;
}

.participant-fieldset input,
.participant-fieldset textarea {
  background: #ffffff;
  border: 1px solid #b8d7f4;
  border-radius: 4px;
  color: #0b2748;
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  font-weight: 400;
  min-height: 30px;
  padding: 5px 7px;
}

.participant-fieldset textarea {
  resize: vertical;
}

#participant-legal-full-name {
  min-height: 78px;
}

#participant-legal-full-name:required {
  border-color: #7ebbf0;
}

#participant-legal-role {
  min-height: 54px;
}

#ai-dialog-help-sphere-dialog .ai-dialog-help-scope-row input[type="checkbox"] {
  flex: 0 0 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  width: 16px;
}

#ai-dialog-help-sphere-dialog .ai-dialog-help-scope-title {
  flex: 0 0 auto;
}

#ai-dialog-help-sphere-dialog .ai-dialog-help-scope-hint {
  flex: 1 1 auto;
  min-width: 0;
}

#ai-dialog-help-sphere-dialog .ai-dialog-help-sphere-form > label {
  display: grid;
  gap: 6px;
  font-weight: 400;
}

#ai-dialog-help-sphere-dialog .ai-dialog-help-sphere-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

#ai-dialog-help-sphere-dialog .ai-dialog-help-sphere-actions button {
  flex: 0 0 auto;
  min-width: 88px;
  width: auto;
}

.participant-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 0;
}

.participant-dialog-actions button {
  min-width: 120px;
}

.dialog-actions.context-source-selection-actions,
.dialog-actions.context-fullscreen-actions {
  justify-content: flex-end;
}

.dialog-actions.context-fullscreen-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dialog-actions.context-fullscreen-actions #save-context-fullscreen-text-button,
.dialog-actions.context-fullscreen-actions #close-context-fullscreen-text-button {
  min-height: 34px;
  min-width: 250px;
  padding: 0 14px;
}

.context-text-fullscreen-form .context-personal-data-button {
  justify-self: start;
  min-width: min(560px, 100%);
}

.context-fullscreen-personal-note {
  margin: 0;
}

.context-validation-form {
  background: #eef6ff;
  gap: 14px;
  padding: 14px;
}

.context-validation-titlebar {
  align-items: center;
  color: var(--text);
  display: grid;
  font-weight: 700;
  gap: 8px;
  grid-template-columns: auto 1fr auto;
}

.context-validation-form p {
  background: #ffffff;
  border: 1px solid #b9d9fb;
  line-height: 1.35;
  margin: 0;
  padding: 12px;
}

.dialog-actions.context-validation-actions,
.dialog-actions.context-confirmation-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
}

.dialog-actions.context-validation-actions button,
.dialog-actions.context-confirmation-actions button {
  min-width: 110px;
}

.dialog-actions.ai-dialog-recent-prompts-actions,
.ai-dialog-recent-prompt-full-form .dialog-actions {
  display: flex;
  justify-content: flex-end;
}

.dialog-actions.ai-dialog-recent-prompts-actions .secondary-button {
  flex: 0 0 auto;
  min-width: 120px;
  width: auto;
}

.ai-dialog-recent-prompt-full-form .dialog-actions .action-button,
.ai-dialog-recent-prompt-full-form .dialog-actions .secondary-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  width: auto;
}

.ai-dialog-recent-prompt-full-form .dialog-actions .action-button {
  min-width: 184px;
}

.ai-dialog-recent-prompt-full-form .dialog-actions .secondary-button {
  min-width: 90px;
}

.billing-filter-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dialog-actions.ai-dialog-help-export-actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 0;
}

.dialog-actions.ai-dialog-help-export-actions::before {
  content: none;
  display: none;
}

.dialog-actions.ai-dialog-help-export-actions button {
  flex: 0 0 auto;
  min-height: 36px;
  width: auto;
}

.dialog-actions.ai-dialog-help-export-actions #ai-dialog-help-export-copy-button {
  min-width: 312px;
}

.dialog-actions.ai-dialog-help-export-actions #ai-dialog-help-export-pdf-button,
.dialog-actions.ai-dialog-help-export-actions #ai-dialog-help-export-word-button {
  min-width: 138px;
}

.dialog-actions.ai-dialog-help-export-actions #ai-dialog-help-export-word-button {
  margin-right: 30px;
}

.dialog-actions.ai-dialog-help-export-actions #ai-dialog-help-export-pdf-button {
  margin-left: auto;
}

.dialog-actions.ai-dialog-help-export-actions .secondary-button {
  min-width: 158px;
}

.dialog-actions.saved-ai-answer-actions,
.dialog-actions.saved-ai-answer-fullscreen-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 0;
}

.dialog-actions.saved-ai-answer-fullscreen-actions button {
  flex: 0 1 270px;
  min-width: 220px;
}

@media (max-width: 760px) {
  .app-topbar {
    align-items: stretch;
    flex-direction: column;
    height: auto;
  }

  .top-tabs {
    overflow-x: auto;
  }

  .user-panel {
    align-self: flex-end;
    margin: 6px 0 0;
  }

  .auth-mode-panel label {
    grid-template-columns: 1fr;
  }

  .project-top-panel,
  .project-start-body,
  .description-row {
    grid-template-columns: 1fr;
  }

  .model-select-row {
    align-items: stretch;
    flex-direction: column;
  }

  .model-select-row select {
    width: 100%;
  }

  .project-subtabs {
    gap: 4px;
  }

  .project-subtabs-row {
    flex-wrap: wrap;
  }

  .project-subtab {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

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

  .project-edit-row,
  .editable-field-row {
    display: grid;
    gap: 4px;
  }

  .actions-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .action-button,
  .secondary-button {
    width: 100%;
  }
}
