:root {
  --bg: #f5f8fe;
  --bg-strong: #eef3fd;
  --panel: #ffffff;
  --panel-soft: #f4f7fd;
  --panel-accent: #edf3ff;
  --line: #dbe4f2;
  --line-strong: #cbd8ec;
  --text: #26344d;
  --muted: #7f8aa3;
  --primary: #4f83f3;
  --primary-strong: #4477e1;
  --primary-soft: #e8f0ff;
  --danger: #d86977;
  --danger-soft: #fff1f3;
  --warning: #dcaa54;
  --warning-soft: #fff7e8;
  --ok: #3f9f69;
  --ok-soft: #ecf9f1;
  --shadow-soft: 0 12px 28px rgba(88, 112, 151, 0.08);
  --shadow-panel: 0 16px 36px rgba(88, 112, 151, 0.09);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0) 58px, rgba(79, 131, 243, 0.028) 58px, rgba(79, 131, 243, 0.028) 118px, rgba(255, 255, 255, 0) 118px),
    linear-gradient(180deg, #f8fbff 0%, #f3f7fd 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.has-modal,
body.has-busy-overlay {
  overflow: hidden;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 54px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1.5 1.5L7 7L12.5 1.5' stroke='%230a243b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px 9px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(79, 131, 243, 0.55);
  box-shadow: 0 0 0 4px rgba(79, 131, 243, 0.12);
}

textarea {
  min-height: 108px;
  resize: vertical;
}

input[readonly] {
  background: var(--panel-soft);
}

input[type="file"] {
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

label {
  display: grid;
  gap: 8px;
}

label span,
.modal-field-title {
  font-size: 13px;
  color: #4d5f73;
  font-weight: 500;
}


.shell-body,
.login-body {
  min-height: 100vh;
}

.page-noise,
.login-bg-shape {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(79, 131, 243, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 131, 243, 0.028) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.25;
}

.app-shell {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 14px 18px 16px 6px;
}

.sidebar {
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 28px);
  min-height: calc(100vh - 28px);
}

.brand-card,
.chat-list-panel,
.user-card,
.panel,
.material-card,
.chat-panel,
.empty-chat,
.composer,
.login-card,
.login-hero,
.modal-card,
.status-card,
.status-tile {
  border: 1px solid rgba(219, 228, 242, 0.95);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.brand-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 184px;
  padding: 14px 14px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 255, 0.96) 100%);
  box-shadow: none;
}

.brand-topline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 10px;
}

.brand-copy {
  display: grid;
  gap: 10px;
}

.brand-kicker,
.page-kicker,
.section-title,
.message-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.brand-card h1,
.page-header h2,
.login-card h2,
.login-hero h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 48px);
  line-height: 0.96;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--text);
}

.brand-card h1 {
  max-width: 100px;
  font-size: 30px;
  line-height: 0.98;
}

.page-header h2 {
  font-size: clamp(24px, 3vw, 32px);
}

.brand-card p,
.page-header p,
.login-hero p,
.login-card p,
.empty-note,
.chat-date,
.message-time,
.status-message,
.user-role,
.material-card p,
.status-tile-label,
.material-job-message {
  color: var(--muted);
}

.brand-card p,
.page-header p,
.login-hero p,
.login-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.main-nav {
  display: grid;
  gap: 4px;
}

.main-nav a,
.chat-list-item,
.user-list-item,
.new-chat-link,
.primary-button,
.secondary-button,
.ghost-button,
.round-icon-button,
.quick-prompt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

.main-nav a {
  justify-content: flex-start;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.new-chat-link,
.primary-button,
.round-icon-button {
  border: 1px solid var(--primary);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(79, 131, 243, 0.22);
}

.new-chat-link,
.primary-button,
.secondary-button,
.ghost-button {
  padding: 0 18px;
}

.primary-button,
.secondary-button,
.figma-send-button {
  min-width: 146px;
  min-height: 48px;
  padding: 0 26px;
  font-size: 16px;
  font-weight: 600;
}

.new-chat-link {
  width: 100%;
  min-height: 40px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(79, 131, 243, 0.2);
}

.new-chat-link:hover,
.primary-button:hover,
.round-icon-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #5f90f8 0%, #477be6 100%);
}

.secondary-button,
.ghost-button {
  border: 1px solid rgba(219, 228, 242, 0.98);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.secondary-button:hover,
.ghost-button:hover,
.chat-list-item:hover,
.user-list-item:hover,
.quick-prompt:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: #ffffff;
}

.ghost-button {
  min-width: 40px;
  padding-inline: 14px;
}

.danger-text,
.quick-delete-button {
  color: var(--danger);
}

.chat-list-panel,
.user-card,
.panel,
.material-card,
.chat-panel,
.status-card,
.status-tile,
.modal-card,
.login-card,
.login-hero {
  padding: 18px;
}

.chat-list-panel {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
  box-shadow: none;
}

.section-title {
  margin-bottom: 8px;
}

.chat-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.chat-list-item {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

.chat-list-item.active {
  background: var(--primary-soft);
  border-color: rgba(79, 131, 243, 0.1);
}

.chat-date {
  font-size: 10px;
}

.chat-label {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.4;
}

.user-card {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 4px 2px 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
}

.user-card form {
  margin-top: 4px;
}

.user-card .ghost-button {
  justify-content: flex-start;
  min-height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.content-area {
  min-width: 0;
  padding: 6px 8px 16px 0;
}

.content-shell {
  width: min(1240px, 100%);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 8px 0 18px;
}

.page-heading {
  display: grid;
  gap: 6px;
}

.page-heading h2 {
  margin: 0;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 44px;
}

.page-actions:empty {
  display: none;
}

.flash-stack {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(540px, calc(100vw - 28px));
  transform: translateX(-50%);
  pointer-events: none;
}

.flash {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(10, 36, 59, 0.14);
  color: var(--text);
  text-align: center;
  pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms ease;
}

.flash.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.flash-success {
  border-color: rgba(63, 159, 105, 0.18);
  background: var(--ok-soft);
}

.flash-error {
  border-color: rgba(216, 105, 119, 0.18);
  background: var(--danger-soft);
}

.flash-info {
  border-color: rgba(79, 131, 243, 0.18);
  background: var(--primary-soft);
}

.stack-form,
.inline-form,
.upload-form,
.replace-form,
.password-form,
.limits-form {
  display: grid;
  gap: 14px;
}

.narrow-panel {
  max-width: 760px;
}

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.users-add-button {
  min-height: 42px;
  padding-inline: 16px;
  font-size: 13px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(219, 228, 242, 0.96);
  box-shadow: var(--shadow-soft);
}

.segmented a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  color: var(--muted);
}

.segmented a.active {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(79, 131, 243, 0.22);
}

.users-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.user-list {
  display: grid;
  gap: 8px;
}

.user-list-item {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
}

.user-list-item.active {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(79, 131, 243, 0.12);
  box-shadow: var(--shadow-soft);
}

.user-list-name {
  font-size: 14px;
  line-height: 1.4;
}

.user-list-role {
  color: var(--muted);
  font-size: 11px;
}

.user-details {
  min-height: 620px;
}

.user-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.user-field {
  display: grid;
  gap: 8px;
  align-content: start;
}

.user-field-label {
  font-size: 12px;
  color: var(--muted);
}

.user-field-value {
  min-height: 46px;
  padding-top: 12px;
  font-size: 15px;
  font-weight: 500;
}

.wide-field {
  width: 100%;
}

.user-inline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 14px;
}

.text-link {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.text-link:hover {
  color: var(--text);
}

.user-token-inline {
  color: var(--muted);
  font-size: 13px;
}

.user-token-inline strong {
  color: var(--text);
}

.tab-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.tab-row a {
  position: relative;
  padding: 0 0 8px;
  min-height: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.tab-row a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}

.tab-row a.active {
  color: var(--text);
}

.tab-row a.active::after {
  background: var(--primary);
}

.user-tab-content,
.tab-content {
  display: grid;
  gap: 12px;
  padding-top: 18px;
}

.data-row,
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(219, 228, 242, 0.94);
  background: rgba(244, 247, 253, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.data-row strong,
.list-row strong {
  flex: 0 0 170px;
  font-size: 13px;
}

.data-row span,
.list-row span {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.5;
  word-break: break-word;
}

.list-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.limits-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.limits-form .primary-button {
  width: fit-content;
  min-width: 160px;
}

.user-delete-row {
  margin-top: 20px;
}

.quick-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.quick-form-extended {
  grid-template-columns: minmax(0, 1fr) 240px auto;
}

.round-icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.list-panel {
  display: grid;
  gap: 10px;
}

.list-row.is-highlighted {
  background: var(--primary-soft);
  border-color: rgba(79, 131, 243, 0.12);
}

.quick-delete-button {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  padding: 0;
}

.quick-delete-button:hover {
  background: rgba(216, 105, 119, 0.08);
}

.password-form .primary-button {
  width: fit-content;
  min-width: 188px;
}

.password-field {
  gap: 10px;
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover {
  background: rgba(79, 131, 243, 0.08);
  color: var(--text);
}

.password-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.password-icon-off {
  display: none;
}

.password-toggle.is-active .password-icon-eye {
  display: none;
}

.password-toggle.is-active .password-icon-off {
  display: block;
}

.chat-layout {
  display: grid;
}

.chat-panel {
  display: grid;
  gap: 16px;
  width: min(1180px, 100%);
  min-height: calc(100vh - 170px);
}

.message-stream {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 500px;
  max-height: calc(100vh - 310px);
  overflow-y: auto;
  padding: 6px;
}

.message-card {
  max-width: min(78%, 760px);
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--panel-soft);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.message-card.user {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(79, 131, 243, 0.18);
}

.message-card.user .message-label,
.message-card.user .message-time {
  color: rgba(255, 255, 255, 0.7);
}

.message-card.assistant {
  align-self: flex-start;
}

.message-label {
  margin-bottom: 8px;
}

.message-text {
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-time {
  margin-top: 10px;
  font-size: 12px;
}

.empty-chat {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 20px;
}

.empty-chat h3,
.material-card h3,
.status-card h3,
.modal-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  color: var(--text);
}

.empty-chat p {
  margin: 0;
  max-width: 620px;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-prompt {
  padding: 0 16px;
  border: 1px solid rgba(219, 228, 242, 0.94);
  background: rgba(244, 247, 253, 0.88);
  color: var(--text);
  font-size: 13px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.composer textarea {
  min-height: 68px;
  max-height: 180px;
  resize: vertical;
}

.composer .primary-button {
  min-height: 42px;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 12px 14px;
}

.typing-indicator[data-placement="assistant"] {
  align-self: flex-start;
}

.typing-indicator[data-placement="user"] {
  align-self: flex-end;
  margin-top: -6px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(79, 131, 243, 0.78);
  animation: loader-bounce 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.12s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes loader-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.materials-page {
  display: grid;
  gap: 18px;
}

.upload-panel {
  padding: 14px;
}

.upload-form {
  gap: 12px;
}

.upload-dropzone {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 20px;
  text-align: center;
  border: 2px dashed rgba(79, 131, 243, 0.24);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(233, 240, 255, 0.78) 100%);
}

.upload-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.upload-dropzone small {
  max-width: 560px;
}

.upload-dropzone input[type="file"] {
  width: auto;
  max-width: 100%;
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.material-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 18px 16px;
}

.material-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.file-pill,
.status-pill,
.status-badge,
.token-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(219, 228, 242, 0.92);
  background: rgba(244, 247, 253, 0.92);
  font-size: 11px;
  font-weight: 600;
}

.file-pill {
  background: var(--primary-soft);
  border-color: rgba(79, 131, 243, 0.14);
  color: var(--primary);
}

.material-state {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.status-ready,
.status-ok {
  background: var(--ok-soft);
  border-color: rgba(63, 159, 105, 0.18);
  color: var(--ok);
}

.status-processing,
.status-warning {
  background: var(--warning-soft);
  border-color: rgba(220, 170, 84, 0.18);
  color: var(--warning);
}

.status-error {
  background: var(--danger-soft);
  border-color: rgba(216, 105, 119, 0.18);
  color: var(--danger);
}

.material-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.material-actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.material-actions form {
  display: grid;
  gap: 8px;
}

.replace-form input[type="file"] {
  background: var(--panel-soft);
}

.error-box {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(216, 105, 119, 0.2);
  background: var(--danger-soft);
  color: #9d3b49;
  white-space: pre-wrap;
  word-break: break-word;
}

.status-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.status-tile {
  display: grid;
  gap: 8px;
}

.status-tile-value {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.status-card {
  display: grid;
  gap: 12px;
}

.status-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.status-kv {
  display: grid;
  gap: 10px;
  margin: 0;
}

.status-kv div {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(244, 247, 253, 0.82);
  border: 1px solid rgba(219, 228, 242, 0.9);
}

.status-kv dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.status-kv dd {
  margin: 6px 0 0;
  word-break: break-word;
}

.status-subsection {
  display: grid;
  gap: 10px;
}

.status-subsection h4 {
  margin: 0;
  font-size: 14px;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.login-hero {
  display: none;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: auto;
  padding: 38px 24px;
}

.login-card .primary-button {
  width: 100%;
  min-height: 48px;
  border-color: #2e94ed;
  background: #2e94ed;
  color: #ffffff;
  box-shadow: none;
}

.login-card .primary-button:hover {
  background: #237fd1;
  border-color: #237fd1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(16, 28, 45, 0.28);
  backdrop-filter: blur(6px);
}

.modal.is-open {
  display: grid;
}

.modal-card {
  width: min(560px, 100%);
  padding: 24px 24px 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 54px rgba(10, 36, 59, 0.14);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.confirm-modal {
  width: min(362px, 100%);
  text-align: center;
}

.confirm-modal-header {
  justify-content: flex-end;
  margin-bottom: 0;
}

.modal-header .ghost-button,
.confirm-modal-header .ghost-button {
  position: relative;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: transparent;
}

.modal-header .ghost-button::before,
.confirm-modal-header .ghost-button::before {
  content: "\00d7";
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111111;
  font-size: 20px;
  line-height: 1;
}

.modal-header .ghost-button:hover,
.confirm-modal-header .ghost-button:hover {
  transform: none;
  background: transparent;
}

.modal-header .ghost-button:hover::before,
.confirm-modal-header .ghost-button:hover::before {
  color: #2e94ed;
}

.confirm-modal-copy {
  max-width: 280px;
  margin: 10px auto 0;
  font-size: 18px;
  line-height: 1.42;
  color: var(--text);
}

.confirm-modal-copy strong {
  color: var(--text);
}

.confirm-modal-email {
  display: block;
  margin-top: 4px;
}

.choice-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.choice-pill {
  position: relative;
  display: inline-flex;
}

.choice-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.choice-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(219, 228, 242, 0.98);
  background: rgba(255, 255, 255, 0.98);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  gap: 8px;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.choice-pill span i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  color: transparent;
  font-style: normal;
  font-size: 11px;
  line-height: 1;
}

.choice-pill span i::before {
  content: "";
}

.choice-pill span b {
  font-weight: 600;
}

.choice-pill input:checked + span {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(79, 131, 243, 0.2);
}

.choice-pill input:checked + span i {
  border-color: rgba(255, 255, 255, 0.92);
  color: #ffffff;
}

.choice-pill input:checked + span i::before {
  content: "✓";
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.confirm-modal .primary-button,
.confirm-modal .secondary-button {
  width: 146px;
}

.confirm-modal .secondary-button {
  border-color: rgba(10, 36, 59, 0.42);
  background: #ffffff;
  color: #111111;
  box-shadow: none;
}

.confirm-modal .secondary-button:hover {
  background: #ffffff;
  border-color: rgba(10, 36, 59, 0.62);
}

.material-job-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(245, 248, 254, 0.94);
  backdrop-filter: blur(10px);
}

.material-job-card {
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid rgba(219, 228, 242, 0.98);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-panel);
}

.material-job-card h3 {
  margin: 10px 0 12px;
  font-size: 26px;
  line-height: 1.1;
}

.material-job-message {
  margin: 0 0 18px;
}

.material-job-progress {
  height: 20px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(79, 131, 243, 0.18);
  background: var(--primary-soft);
}

.material-job-progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #78a2ff 100%);
  transition: width 180ms ease;
}

.material-job-percent {
  margin-top: 16px;
  font-size: clamp(38px, 6vw, 54px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.06em;
}

.docs-page {
  gap: 0;
}

.docs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1188px, 100%);
  margin: 8px 0 22px;
}

.docs-page-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 500;
  color: var(--text);
}

.docs-topbar-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  text-decoration: none;
}

.docs-topbar-action::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: currentColor;
}

.docs-topbar-action:hover {
  color: #2e94ed;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 170px));
  gap: 34px 12px;
  width: min(1188px, 100%);
  justify-content: start;
}

.docs-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  width: min(1188px, 100%);
  align-items: start;
}

.docs-section {
  display: grid;
  gap: 20px;
  min-height: 100%;
  padding: 26px 22px 30px;
  border: 1px solid rgba(0, 41, 77, 0.08);
  border-radius: 32px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(10, 36, 59, 0.05);
}

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

.docs-section-copy {
  display: grid;
  gap: 6px;
}

.docs-section-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
  color: var(--text);
}

.docs-section-copy p {
  margin: 0;
  max-width: 340px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.docs-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eef4fb;
  color: #2e94ed;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.docs-section-grid {
  width: 100%;
  gap: 28px 12px;
}

.docs-section-empty {
  width: 100%;
  margin: 0;
}

.docs-card {
  display: grid;
  align-content: start;
  width: 170px;
}

.docs-card-trigger {
  display: grid;
  gap: 9px;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  box-shadow: none;
}

.docs-card-trigger:hover .docs-thumb {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(10, 36, 59, 0.08);
}

.docs-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 170px;
  height: 170px;
  border-radius: 28px;
  background: #eaf2f8;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.docs-card.is-archived .docs-thumb {
  background: #f9f9f9;
}

.docs-thumb-type {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: #2e94ed;
}

.docs-card.is-archived .docs-thumb-type {
  color: rgba(0, 0, 0, 0.4);
}

.docs-delete-form {
  position: absolute;
  top: 14px;
  right: 14px;
}

.docs-delete-button {
  position: relative;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: transparent;
  box-shadow: none;
}

.docs-delete-button::before {
  content: "+";
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 110, 110, 0.7);
  font-size: 24px;
  line-height: 1;
  transform: rotate(45deg);
}

.docs-delete-button:hover::before {
  color: rgba(245, 57, 80, 0.92);
}

.docs-card-name {
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
  word-break: break-word;
}

.docs-card-meta,
.docs-note {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.docs-card-meta-compact {
  color: #66758f;
}

.docs-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.docs-actions {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.docs-action-form {
  display: grid;
}

.docs-card-button {
  width: 100%;
  min-width: 146px;
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
}

.docs-replace-form {
  display: grid;
  gap: 8px;
}

.docs-file-field {
  gap: 6px;
}

.docs-file-field span {
  color: #4d5f73;
  font-size: 12px;
}

.docs-file-field input[type="file"] {
  padding: 7px 10px;
  border-radius: 14px;
  background: #f7f9fc;
  border: 1px solid rgba(10, 36, 59, 0.18);
}

.docs-empty-state {
  width: min(420px, 100%);
}

.material-detail-modal {
  width: min(860px, 100%);
  padding: 22px 22px 24px;
  border-radius: 28px;
}

.material-detail-header {
  align-items: center;
  margin-bottom: 18px;
}

.material-detail-header h3 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
}

.material-detail-body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.material-detail-preview .docs-thumb {
  box-shadow: none;
}

.material-detail-info {
  display: grid;
  gap: 16px;
}

.material-detail-meta {
  display: grid;
  gap: 10px;
}

.material-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(10, 36, 59, 0.1);
}

.material-detail-row span {
  color: var(--muted);
  font-size: 14px;
}

.material-detail-row strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.material-detail-badges {
  margin-top: -2px;
}

.material-detail-actions {
  display: grid;
  gap: 10px;
}

.material-delete-row {
  margin-top: 8px;
}

.materials-upload-modal-card {
  width: min(540px, 100%);
}

.materials-upload-form {
  gap: 18px;
}

.materials-upload-dropzone {
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px dashed rgba(10, 36, 59, 0.24);
  border-radius: 24px;
  background: #f7f9fc;
  text-align: center;
}

.materials-upload-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
}

.materials-upload-dropzone small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.materials-upload-dropzone input[type="file"] {
  border: none;
  padding: 0;
  background: transparent;
}

.fast-page {
  display: grid;
  gap: 18px;
  width: min(1188px, 100%);
}

.fast-page-title {
  margin: 8px 0 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 500;
  color: var(--text);
}

.fast-form {
  display: grid;
  gap: 14px;
}

.fast-input-shell {
  position: relative;
}

.fast-input-shell input {
  height: 52px;
  padding: 0 72px 0 18px;
  background: #ffffff;
  border: 1px solid rgba(10, 36, 59, 0.35);
  border-radius: 28px;
  box-shadow: none;
}

.fast-input-shell input:focus {
  border-color: #2e94ed;
  box-shadow: 0 0 0 2px rgba(46, 148, 237, 0.12);
}

.fast-submit-button {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #2e94ed;
  color: #ffffff;
  box-shadow: none;
}

.fast-submit-button:hover {
  background: #237fd1;
}

.fast-submit-button svg {
  width: 16px;
  height: 16px;
}

.fast-audience-pills {
  margin-top: 0;
}

.fast-audience-pills .choice-pill span {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 18px;
  box-shadow: none;
}

.fast-audience-pills .choice-pill span i {
  width: 18px;
  height: 18px;
  border-width: 1.6px;
  border-color: rgba(10, 36, 59, 0.38);
  background: #ffffff;
  color: transparent;
  flex: 0 0 18px;
}

.fast-audience-pills .choice-pill input:checked + span i {
  border-color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
}

.fast-list-panel {
  display: grid;
  gap: 0;
  padding: 20px 12px;
  border-radius: 20px;
  background: #eaf2f8;
}

.fast-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 10px;
}

.fast-list-row + .fast-list-row {
  border-top: 1px solid rgba(10, 36, 59, 0.14);
}

.fast-list-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.fast-list-text {
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}

.fast-list-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.fast-delete-form {
  display: inline-flex;
}

.fast-delete-button {
  position: relative;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: transparent;
  box-shadow: none;
}

.fast-delete-button::before {
  content: "+";
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 110, 110, 0.7);
  font-size: 24px;
  line-height: 1;
  transform: rotate(45deg);
}

.fast-delete-button:hover::before {
  color: rgba(245, 57, 80, 0.92);
}

@media (max-width: 900px) {
  .material-detail-body {
    grid-template-columns: 1fr;
  }

  .material-detail-preview {
    display: flex;
    justify-content: center;
  }

  .fast-list-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.empty-note {
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 1380px) {
  .app-shell {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
    padding-right: 14px;
  }

  .content-shell {
    width: 100%;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .sidebar {
    position: static;
    min-height: 0;
    max-height: none;
  }

  .main-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .new-chat-link {
    width: fit-content;
    min-width: 170px;
  }

  .chat-list {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .users-layout,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .user-meta-grid {
    grid-template-columns: 1fr;
  }

  .message-stream {
    max-height: none;
    min-height: 380px;
  }
}

@media (max-width: 900px) {
  .content-area {
    padding-right: 0;
  }

  .page-header,
  .users-toolbar,
  .user-inline-bar,
  .status-card-head,
  .material-topline {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .limits-form,
  .status-grid,
  .status-summary {
    grid-template-columns: 1fr;
  }

  .material-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell,
  .login-body {
    padding: 12px;
  }

  .content-area {
    padding: 0;
  }

  .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .new-chat-link,
  .main-nav a,
  .users-add-button {
    width: 100%;
  }

  .chat-list {
    grid-template-columns: 1fr;
  }

  .user-list {
    grid-template-columns: 1fr;
  }

  .data-row,
  .list-row,
  .composer,
  .quick-form,
  .modal-footer {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .data-row strong,
  .list-row strong {
    flex: 1 1 auto;
  }

  .message-card {
    max-width: 100%;
  }

  .chat-panel {
    min-height: auto;
  }

  .panel,
  .chat-panel,
  .status-card,
  .status-tile,
  .modal-card,
  .login-card,
  .login-hero,
  .brand-card,
  .chat-list-panel,
  .user-card,
  .material-card {
    padding: 16px;
  }

  .empty-chat {
    padding: 16px;
  }

  .login-hero {
    min-height: 240px;
    align-content: start;
  }

  .tab-row {
    overflow-x: auto;
    padding-bottom: 14px;
  }
}

@media (max-width: 540px) {
  .main-nav {
    grid-template-columns: 1fr;
  }

  .message-stream {
    min-height: 300px;
  }

  .composer textarea {
    min-height: 88px;
  }

  .material-job-overlay,
  .modal {
    padding: 12px;
  }

  .material-job-card,
  .modal-card {
    padding: 18px;
  }
}

@media (max-width: 900px) {
  .quick-form-extended {
    grid-template-columns: 1fr;
  }
}

/* Figma shell overrides */
:root {
  --bg: #ffffff;
  --bg-strong: #f9fbff;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --panel-accent: #f3f7ff;
  --line: rgba(0, 41, 77, 0.14);
  --line-strong: rgba(0, 41, 77, 0.22);
  --text: #0a243b;
  --muted: #8f8f8f;
  --primary: #3c6ac3;
  --primary-strong: #3159a8;
  --primary-soft: #f3f7ff;
  --danger: #d86977;
  --warning: #c58a2f;
  --ok: #2f8f62;
  --shadow-soft: 0 12px 34px rgba(10, 36, 59, 0.06);
  --shadow-panel: 0 18px 42px rgba(10, 36, 59, 0.08);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

body {
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

.page-noise,
.login-bg-shape {
  background-image: none;
  opacity: 0;
}

.app-shell {
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
  padding: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  gap: 0;
  min-height: 100vh;
  max-height: none;
  padding: 0;
  background: #f9f9f9;
  border-right: 1px solid rgba(0, 41, 77, 0.14);
}

.sidebar-frame {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 18px 18px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 58px;
  margin: 0 -18px 6px;
  padding-left: 18px;
}

.sidebar-logo-image {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
}

.brand-card,
.new-chat-link,
.user-card {
  display: none !important;
}

.main-nav {
  display: grid;
  gap: 0;
  margin: 0 -18px 26px;
}

.main-nav a {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  font-size: 14px;
  font-weight: 400;
}

.main-nav a span:last-child {
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.35;
}

.main-nav a:hover,
.main-nav a.active {
  transform: none;
  border-color: transparent;
  background: #f3f3f3;
  color: var(--text);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: currentColor;
  flex: 0 0 18px;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.chat-list-panel {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 0 14px;
  border: none;
  border-bottom: 1px solid rgba(10, 36, 59, 0.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.section-title {
  padding: 0 12px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.chat-list {
  gap: 12px;
  overflow: auto;
}

.chat-list-item {
  display: block;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-list-item:hover,
.chat-list-item.active {
  transform: none;
  border: none;
  background: transparent;
}

.chat-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
  font-size: 13px;
  color: var(--muted);
}

.chat-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.chat-label {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  margin-bottom: 16px;
  padding-top: 22px;
}

.sidebar-user-link {
  width: 100%;
  text-decoration: none;
  border: 1px solid rgba(10, 36, 59, 0.12);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(10, 36, 59, 0.04);
}

.sidebar-user-link:hover .sidebar-user-name {
  color: var(--primary);
}

.sidebar-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  flex: 0 0 24px;
}

.sidebar-user-copy {
  min-width: 0;
}

.sidebar-user-name {
  overflow: visible;
  white-space: normal;
  overflow-wrap: break-word;
  font-size: 14px;
  color: var(--text);
}

.sidebar-user-role {
  font-size: 12px;
  color: var(--muted);
}

.sidebar-logout {
  margin-top: 10px;
}

.sidebar-logout .ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  min-height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: #d84d4d;
}

.sidebar-logout .ghost-button:hover {
  transform: none;
  background: transparent;
  color: #b93b3b;
}

.logout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.logout-icon svg {
  width: 16px;
  height: 16px;
}

.content-area {
  padding: 0;
  background: #ffffff;
}

.content-shell {
  width: 100%;
  max-width: none;
  padding: 36px 42px 30px 46px;
}

.content-area-chat .content-shell-chat {
  min-height: 100vh;
  padding: 12px 42px 24px 46px;
}

.page-header {
  margin: 0 0 28px;
  padding-top: 10px;
}

.page-kicker {
  font-size: 12px;
  letter-spacing: 0.12em;
}

.page-heading h2 {
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.page-heading p {
  max-width: 720px;
}

.page-actions {
  min-height: 40px;
}

.panel,
.material-card,
.chat-panel,
.empty-chat,
.composer,
.login-card,
.login-hero,
.modal-card,
.status-card,
.status-tile {
  border: 1px solid rgba(0, 41, 77, 0.08);
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(10, 36, 59, 0.05);
}

.secondary-button,
.ghost-button {
  border-color: rgba(0, 41, 77, 0.12);
  background: #ffffff;
  box-shadow: none;
}

.primary-button {
  border-color: #2e94ed;
  background: #2e94ed;
  box-shadow: none;
  color: #ffffff;
}

.primary-button:hover {
  background: #237fd1;
  border-color: #237fd1;
}

.new-chat-link,
.round-icon-button {
  border-color: #2e94ed;
  background: #2e94ed;
  color: #ffffff;
  box-shadow: none;
}

.new-chat-link:hover,
.round-icon-button:hover {
  background: #237fd1;
  border-color: #237fd1;
}

.flash {
  border-radius: 16px;
}

.figma-chat-layout {
  min-height: calc(100vh - 24px);
}

.figma-chat-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 20px;
  width: 100%;
  min-height: calc(100vh - 24px);
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.figma-message-stream {
  min-height: 0;
  max-height: none;
  padding: 74px 0 10px;
  gap: 20px;
  overflow-y: auto;
}

.figma-empty-chat {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: calc(100vh - 220px);
  gap: 54px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.empty-chat-hero {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.empty-chat-hero h3 {
  font-size: clamp(38px, 4.4vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-weight: 600;
}

.empty-chat-hero p {
  max-width: 540px;
  font-size: 16px;
}

.figma-quick-prompts {
  display: grid;
  gap: 12px;
  width: min(720px, 100%);
}

.figma-quick-prompt {
  width: 100%;
  justify-content: space-between;
  min-height: 53px;
  padding: 0 20px;
  border: 1px solid rgba(0, 41, 77, 0.08);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 0 60px 9px rgba(0, 0, 0, 0.06);
}

.figma-quick-prompt:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 41, 77, 0.14);
  background: #ffffff;
}

.figma-quick-prompt-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  color: var(--text);
}

.figma-quick-prompt-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  flex: 0 0 26px;
}

.figma-quick-prompt-arrow svg {
  width: 16px;
  height: 16px;
}

.message-card {
  max-width: min(760px, 74%);
  padding: 16px 18px;
  border: 1px solid rgba(0, 41, 77, 0.08);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(10, 36, 59, 0.05);
}

.message-card.user {
  background: #eff4fd;
  border-color: rgba(60, 106, 195, 0.14);
  color: var(--text);
  box-shadow: none;
}

.message-card.user .message-label,
.message-card.user .message-time {
  color: var(--muted);
}

.message-text {
  font-size: 15px;
  line-height: 1.7;
}

.figma-composer {
  position: sticky;
  bottom: 18px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.figma-composer-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(1060px, 100%);
  min-height: 51px;
  padding: 0 18px;
  border: 1px solid rgba(10, 36, 59, 0.2);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: none;
}

.figma-composer textarea {
  min-height: 42px;
  max-height: 140px;
  padding: 14px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  overflow-y: auto;
  font-size: 16px;
}

.figma-composer textarea:focus {
  border: none;
  box-shadow: none;
}

.figma-send-button {
  min-height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: #2e94ed;
  color: #ffffff;
  font: inherit;
}

.figma-send-button:hover {
  background: #237fd1;
}

.typing-indicator {
  box-shadow: 0 12px 28px rgba(10, 36, 59, 0.05);
}

.typing-indicator span {
  background: rgba(10, 36, 59, 0.7);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid rgba(0, 41, 77, 0.14);
  }

  .sidebar-frame {
    min-height: 0;
    padding-bottom: 16px;
  }

  .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 18px;
  }

  .main-nav a {
    min-height: 42px;
    border: 1px solid rgba(0, 41, 77, 0.08);
    border-radius: 16px;
    padding: 0 14px;
  }

  .content-shell,
  .content-area-chat .content-shell-chat {
    padding: 22px 20px 24px;
  }
}

@media (max-width: 760px) {
  .main-nav {
    grid-template-columns: 1fr;
  }

  .figma-message-stream {
    padding-top: 34px;
  }

  .figma-empty-chat {
    min-height: 420px;
    gap: 28px;
  }

  .figma-quick-prompts {
    width: 100%;
  }

  .figma-composer-shell {
    width: 100%;
    align-items: flex-end;
    padding: 10px 14px;
  }

  .figma-composer textarea {
    min-height: 52px;
  }

  .figma-send-button {
    align-self: center;
  }

  .message-card {
    max-width: 100%;
  }
}

.required-mark {
  display: inline-block;
  margin-left: 4px;
  color: #ef5a67;
  font-weight: 700;
}

.optional-mark {
  color: #6d7b8c;
  font-size: 12px;
  font-weight: 500;
}

.field-error {
  min-height: 18px;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: #ef5a67;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: rgba(239, 90, 103, 0.55);
  box-shadow: 0 0 0 4px rgba(239, 90, 103, 0.1);
}

.chat-list {
  gap: 8px;
}

.chat-list-item {
  padding: 10px 12px;
  border-radius: 14px;
  transition: background-color 160ms ease;
}

.chat-list-item:hover,
.chat-list-item.active {
  background: #f3f3f3;
}

.sidebar-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-bottom: 4px;
}

.sidebar-pagination-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(10, 36, 59, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.sidebar-pagination-button.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.sidebar-pagination-status {
  font-size: 13px;
  color: var(--muted);
}

.chat-list-panel.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.sidebar-user-link {
  border-radius: 16px;
  padding: 8px 10px;
}

.sidebar-user-link:hover {
  background: #f3f3f3;
}

.sidebar-user-link:hover .sidebar-user-name {
  color: var(--text);
}

.figma-chat-panel {
  grid-template-rows: auto auto;
  min-height: 0;
}

.figma-message-stream {
  padding: 74px 0 0;
  overflow: visible;
}

.message-card.user {
  align-self: flex-end;
  margin-left: auto;
}

.figma-composer {
  position: static;
  margin-top: 14px;
}

.figma-composer-shell {
  width: 100%;
}

.figma-composer textarea {
  padding-left: 0;
}

.admin-inline-link.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-inline-link.with-icon::before {
  content: "?";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}

.docs-topbar-action,
.docs-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  text-decoration: none;
}

.docs-detail-topbar {
  align-items: flex-start;
}

.docs-page-copy {
  margin-top: 8px;
  color: var(--muted);
}

.docs-detail-card {
  width: min(1188px, 100%);
  padding: 28px 30px;
  border-radius: 28px;
  background: #ffffff;
  border: 1px solid rgba(0, 41, 77, 0.08);
  box-shadow: 0 18px 42px rgba(10, 36, 59, 0.05);
}

.docs-edit-form {
  max-width: 720px;
}

.docs-file-field-block input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 20px;
  background: #f7f9fc;
}

.docs-file-field-block input[type="file"]::file-selector-button {
  min-width: 128px;
  padding: 11px 14px;
  border-radius: 10px;
}

.docs-replace-form .admin-save-row,
.docs-edit-form .admin-save-row {
  margin-top: 10px;
}

.material-detail-actions {
  display: grid;
  gap: 18px;
}

.material-detail-row strong {
  text-align: right;
}

.material-detail-badges {
  margin-top: 8px;
}

.docs-card-trigger {
  text-decoration: none;
}

.create-user-modal-card .field-error {
  min-height: 16px;
}

.create-user-submit,
.password-save-button,
.admin-save-row .primary-button,
.docs-card-button,
.docs-topbar-action,
.fast-submit-button,
.figma-send-button {
  min-width: 120px;
}

.admin-save-row {
  display: flex;
  justify-content: center;
}

.admin-delete-row {
  display: flex;
  justify-content: center;
}

.fast-form-error {
  padding-left: 4px;
}

select,
.admin-limits-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 54px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1.5 1.5L7 7L12.5 1.5' stroke='%230a243b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px 9px;
}

.users-admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1188px, 100%);
  margin: 8px 0 18px;
  padding: 14px 24px;
  border-radius: 28px;
  background: #f9f9f9;
}

.docs-admin-topbar {
  margin-top: 8px;
}

.users-segmented {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.users-segmented a {
  min-height: 39px;
  padding: 0 16px;
  border-radius: 20px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
}

.users-segmented a.active {
  background: #2e94ed;
  color: #ffffff;
  box-shadow: none;
}

.users-topbar-divider {
  width: 1px;
  height: 27px;
  background: rgba(10, 36, 59, 0.22);
}

.users-topbar-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  text-decoration: none;
}

.users-topbar-action::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: currentColor;
}

.users-topbar-action:hover {
  color: #2e94ed;
}

.docs-topbar-segmented {
  gap: 14px;
}

.docs-topbar-action-inline {
  white-space: nowrap;
  text-decoration: none;
}

.material-audience-pills {
  margin-top: 12px;
}

.material-audience-hint {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.material-audience-pills .choice-pill span {
  min-height: 36px;
  padding: 0 14px;
  gap: 7px;
  border-radius: 999px;
  border-color: #c7d2e1;
  background: #f3f6fa;
  color: #6f8097;
  box-shadow: none;
}

.material-audience-pills .choice-pill input:not(:checked) + span {
  border-color: #c7d2e1;
  background: #f3f6fa;
  color: #6f8097;
}

.material-audience-pills .choice-pill input:checked + span {
  border-color: #2e94ed;
  background: #2e94ed;
  color: #ffffff;
  box-shadow: none;
}

.material-audience-pills .choice-pill span i {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
  border-color: #9fb0c3;
  color: transparent;
}

.material-audience-pills .choice-pill input:not(:checked) + span i {
  border-color: #9fb0c3;
  color: transparent;
}

.material-audience-pills .choice-pill input:checked + span i {
  border-color: rgba(255, 255, 255, 0.92);
}

.admins-layout {
  width: min(1188px, 100%);
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.admin-directory {
  display: grid;
  gap: 22px;
  padding: 22px 18px;
  border-radius: 28px;
  background: #eaf2f8;
}

.docs-grid .docs-card .status-pill,
.docs-grid .docs-card .file-pill,
.docs-grid .docs-card .status-badge,
.docs-grid .docs-card .token-badge,
.docs-grid .docs-card .docs-card-button,
.docs-grid .docs-card .primary-button,
.docs-grid .docs-card .secondary-button,
.docs-grid .docs-card .ghost-button {
  display: none !important;
}

.admin-directory-group {
  display: grid;
  gap: 10px;
}

.admin-directory-group + .admin-directory-group {
  padding-top: 10px;
  border-top: 1px solid rgba(10, 36, 59, 0.14);
}

.admin-directory-group-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.admin-directory-link {
  display: block;
  padding: 2px 0;
  text-decoration: none;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

.admin-directory-link.active {
  color: #2e94ed;
}

.admin-profile {
  min-width: 0;
}

.admin-profile-card {
  position: relative;
  width: 100%;
  padding: 24px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 3px 49px 9px rgba(0, 0, 0, 0.06);
}

.admin-profile-star {
  position: absolute;
  top: 16px;
  right: 18px;
  color: #f53950;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.admin-profile-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.admin-profile-field {
  display: grid;
  gap: 8px;
}

.admin-profile-label {
  font-size: 16px;
  line-height: 1.2;
  color: var(--text);
}

.admin-profile-value {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: #f7f9fc;
  border: 1px solid rgba(10, 36, 59, 0.45);
  border-radius: 28px;
  color: var(--text);
  font-size: 16px;
}

.admin-profile-field input {
  height: 52px;
  padding: 0 18px;
  background: #f7f9fc;
  border-color: rgba(10, 36, 59, 0.45);
  border-radius: 28px;
  box-shadow: none;
}

.admin-limits-form input,
.admin-limits-form select {
  height: 52px;
  padding: 0 18px;
  background-color: #f7f9fc;
  border-color: rgba(10, 36, 59, 0.45);
  border-radius: 28px;
  box-shadow: none;
}

.admin-limits-form select {
  padding-right: 54px;
}

.admin-profile-field input:focus,
.admin-limits-form input:focus,
.admin-limits-form select:focus {
  border-color: rgba(10, 36, 59, 0.6);
  box-shadow: none;
}

.admin-profile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
}

.admin-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eaf2f8;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.admin-token-inline {
  font-size: 16px;
  color: var(--text);
}

.admin-profile-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.admin-profile-actions .admin-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-profile-actions .admin-inline-link::before {
  content: "?";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.admin-inline-link {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.admin-inline-link:hover {
  color: #2e94ed;
}

.admin-tab-pills {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.admin-tab-pills a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 20px;
  text-decoration: none;
  color: #000000;
  box-shadow: 0 0 60px 9px rgba(0, 0, 0, 0.06);
}

.admin-tab-pills a.active {
  background: #eaf2f8;
  color: var(--text);
  font-weight: 700;
}

.admin-tab-content {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.admin-log-row {
  display: grid;
  grid-template-columns: 18px 190px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(10, 36, 59, 0.14);
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.admin-log-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  color: var(--text);
  font-size: 13px;
}

.admin-limits-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  margin-top: 12px;
}

.admin-delete-row {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.admin-delete-row form {
  display: flex;
  justify-content: center;
  width: 100%;
}

.admin-delete-row .admin-inline-link {
  color: #f53950;
  font-weight: 500;
}

.admin-delete-row .admin-inline-link:hover {
  color: #cf2740;
}

.admin-save-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.admin-save-row .primary-button {
  width: min(380px, 100%);
  min-width: 146px;
  min-height: 52px;
  border-radius: 32px;
}

.create-user-modal-card {
  width: min(484px, 100%);
  padding: 18px 18px 26px;
  border-radius: 24px;
}

.create-user-modal-card .modal-header {
  align-items: center;
  margin-bottom: 10px;
}

.create-user-modal-card .modal-header h3 {
  width: 100%;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
}

.create-user-form {
  gap: 18px;
}

.create-user-form label {
  gap: 10px;
}

.create-user-form label span,
.create-user-form .modal-field-title {
  font-size: 16px;
  line-height: 1.2;
  color: var(--text);
}

.create-user-form input {
  height: 52px;
  padding: 0 18px;
  background: #f7f9fc;
  border-color: rgba(10, 36, 59, 0.45);
  border-radius: 28px;
  box-shadow: none;
}

.create-user-form input:focus {
  border-color: rgba(10, 36, 59, 0.6);
  box-shadow: none;
}

.role-choice-pills {
  margin-top: 12px;
}

.role-choice-pills .choice-pill span {
  min-height: 32px;
  padding: 0 14px;
  gap: 6px;
  border-radius: 6px;
  border-color: rgba(10, 36, 59, 0.2);
  background: #2e94ed;
  color: #ffffff;
  box-shadow: none;
}

.role-choice-pills .choice-pill span i {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
  border-color: rgba(255, 255, 255, 0.88);
}

.role-choice-pills .choice-pill input:not(:checked) + span {
  background: #0a243b;
  border-color: #0a243b;
}

.role-choice-pills .choice-pill input:checked + span {
  background: #2e94ed;
  border-color: #2e94ed;
}

.create-user-submit {
  width: 100%;
  margin-top: 10px;
}

.mail-settings-page {
  display: grid;
}

.mail-settings-card {
  width: min(860px, 100%);
  padding: 34px 36px 38px;
  border-radius: 32px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(17, 42, 64, 0.08);
}

.mail-settings-copy {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.mail-settings-form {
  margin-top: 28px;
  gap: 22px;
}

.mail-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

.mail-settings-grid .form-field {
  align-self: start;
  min-width: 0;
}

.mail-settings-form input,
.mail-settings-form select {
  width: 100%;
  min-height: 58px;
}

.mail-settings-wide {
  grid-column: 1 / -1;
}

.mail-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #2e94ed;
  flex: 0 0 18px;
}

.checkbox-field-inline {
  margin-top: -2px;
}

.mail-settings-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.mail-settings-actions .primary-button,
.mail-settings-actions .secondary-button {
  width: min(240px, 100%);
  min-width: 146px;
  min-height: 52px;
  border-radius: 32px;
}

.mail-test-status {
  min-height: 22px;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
}

.mail-test-status.is-success {
  color: #1e8e55;
}

.mail-test-status.is-error {
  color: #d84d4d;
}

.mail-test-status.is-warning {
  color: #b67e14;
}

@media (max-width: 1200px) {
  .users-admin-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admins-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .admin-profile-top {
    grid-template-columns: 1fr;
  }

  .mail-settings-grid {
    grid-template-columns: 1fr;
  }

  .mail-event-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .docs-section {
    padding: 22px 18px 24px;
    border-radius: 28px;
  }

  .docs-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .docs-section-title {
    font-size: 22px;
  }

  .users-segmented {
    gap: 8px;
    flex-wrap: wrap;
  }

  .docs-topbar-segmented {
    width: 100%;
    justify-content: flex-start;
  }

  .users-topbar-divider {
    display: none;
  }

  .admin-profile-meta,
  .admin-profile-actions,
  .admin-tab-pills {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-limits-form {
    grid-template-columns: 1fr;
  }

  .admin-log-row {
    grid-template-columns: 18px 1fr;
    gap: 8px 12px;
    padding: 12px 0;
  }

  .admin-log-row span:last-child {
    grid-column: 2;
  }
}
