/* AhmadGrowth dashboard system v40 */

:root {
  --app-bg: #f6f7f9;
  --app-surface: #ffffff;
  --app-surface-soft: #f9fafb;
  --app-ink: #15171a;
  --app-muted: #6d737c;
  --app-faint: #9298a2;
  --app-line: #e7e9ed;
  --app-line-strong: #d9dde3;
  --app-blue: #1769e0;
  --app-blue-soft: #eaf2ff;
  --app-violet: #7557d7;
  --app-green: #17875f;
  --app-amber: #a46708;
  --app-danger: #c83f49;
  --app-radius: 8px;
  --app-shadow: 0 8px 28px rgba(24, 31, 45, 0.07);
}

.bidder-studio *,
.admin-shell *,
.profile-modal * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.bidder-studio button,
.bidder-studio input,
.bidder-studio textarea,
.bidder-studio select,
.admin-shell button,
.admin-shell input,
.admin-shell textarea,
.admin-shell select,
.profile-modal button,
.profile-modal input,
.profile-modal textarea,
.profile-modal select {
  font: inherit;
}

.bidder-studio button,
.bidder-studio a,
.admin-shell button,
.admin-shell a {
  -webkit-tap-highlight-color: transparent;
}

.bidder-studio svg,
.admin-shell svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2;
}

.app-logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--app-ink);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 5px 15px rgba(21, 23, 26, 0.16);
}

.app-scrim,
.sidebar-close,
.mobile-menu-button,
.mobile-app-nav {
  display: none;
}

/* User application */
.bidder-studio {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: var(--app-bg);
  color: var(--app-ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.studio-rail {
  display: none !important;
}

.studio-sidebar {
  position: relative;
  top: auto;
  z-index: 30;
  width: 240px;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 14px 14px;
  border: 0;
  border-right: 1px solid var(--app-line);
  border-radius: 0;
  background: #fbfbfc;
  box-shadow: none;
  backdrop-filter: none;
}

.studio-brand {
  min-width: 0;
  min-height: 34px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  padding: 0 8px;
  background: transparent;
  box-shadow: none;
}

.studio-brand strong,
.studio-brand span {
  display: block;
  overflow: hidden;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-brand strong {
  color: var(--app-ink);
  font-size: 14px;
  font-weight: 760;
}

.studio-brand span {
  margin-top: 2px;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 590;
}

.new-chat-btn {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--app-radius);
  padding: 0 14px;
  background: var(--app-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 720;
  box-shadow: 0 8px 18px rgba(21, 23, 26, 0.14);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.new-chat-btn:hover {
  transform: translateY(-1px);
  background: #262a30;
  box-shadow: 0 10px 22px rgba(21, 23, 26, 0.18);
}

.new-chat-btn:active {
  transform: translateY(0) scale(0.985);
}

.studio-search,
.recent-list {
  display: none !important;
}

.studio-menu {
  min-height: 0;
  display: block;
  overflow: auto;
  padding: 1px 0;
  scrollbar-width: none;
}

.studio-menu::-webkit-scrollbar {
  display: none;
}

.menu-label {
  display: block;
  margin: 18px 10px 7px;
  color: var(--app-faint);
  font-size: 10px;
  font-weight: 720;
  text-transform: uppercase;
}

.menu-label:first-child {
  margin-top: 2px;
}

.studio-menu button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  background: transparent;
  color: #505661;
  font-size: 13px;
  font-weight: 610;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.studio-menu button svg {
  width: 17px;
  height: 17px;
  color: #737a84;
}

.studio-menu button:hover {
  background: #f0f2f5;
  color: var(--app-ink);
  box-shadow: none;
}

.studio-menu button.active {
  background: #eaf1fb;
  color: #145fca;
  box-shadow: none;
}

.studio-menu button.active svg {
  color: #1769e0;
}

.studio-user {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  padding: 8px;
  background: var(--app-surface);
  color: var(--app-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.studio-user:hover {
  border-color: var(--app-line-strong);
  box-shadow: var(--app-shadow);
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #20242a;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 780 !important;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio-user > div {
  min-width: 0;
}

.studio-user strong,
.studio-user span {
  display: block;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-user strong {
  color: var(--app-ink);
  font-size: 12px;
  font-weight: 720;
}

.studio-user span {
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 560;
}

.studio-user > svg {
  width: 15px;
  color: var(--app-faint);
}

.studio-main {
  width: 100%;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

.studio-topbar {
  position: relative;
  top: 0;
  z-index: 20;
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--app-line);
  border-radius: 0;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.workspace-select {
  min-width: 0;
}

.workspace-select span,
.workspace-select strong {
  display: block;
  overflow: hidden;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-select span {
  color: var(--app-faint);
  font-size: 10px;
  font-weight: 650;
}

.workspace-select strong {
  margin-top: 2px;
  color: var(--app-ink);
  font-size: 15px;
  font-weight: 740;
}

.studio-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-action,
.upgrade-action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 680;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.icon-action {
  border: 1px solid var(--app-line);
  background: #fff;
  color: #343940;
}

.upgrade-action {
  border: 1px solid #15171a;
  background: var(--app-ink);
  color: #fff;
}

.icon-action:hover,
.upgrade-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(24, 31, 45, 0.10);
}

.top-profile {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--app-line);
  border-radius: 50%;
  padding: 0;
  background: #20242a;
  color: #fff;
  font-size: 11px;
  font-weight: 780;
}

.top-profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio-view {
  min-height: 0;
  display: none;
  overflow: auto;
  padding: 28px;
  scrollbar-width: thin;
}

.studio-view.active {
  display: block;
  animation: viewEnter 220ms ease both;
}

@keyframes viewEnter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.studio-welcome {
  max-width: 1240px;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 22px;
  border: 1px solid #dbe7f7;
  border-radius: var(--app-radius);
  padding: 22px 24px;
  background:
    linear-gradient(100deg, rgba(234, 242, 255, 0.92), rgba(255, 255, 255, 0.96) 58%, rgba(236, 249, 244, 0.92));
  text-align: left;
}

.studio-welcome > div {
  display: block;
}

.welcome-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--app-blue);
  font-size: 11px;
  font-weight: 720;
}

.studio-welcome h1 {
  margin: 0;
  color: var(--app-ink);
  font-size: 27px;
  font-weight: 760;
  line-height: 1.15;
}

.studio-welcome p {
  margin: 5px 0 0;
  color: var(--app-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.welcome-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  background: var(--app-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 710;
  box-shadow: 0 7px 18px rgba(23, 105, 224, 0.22);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.welcome-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(23, 105, 224, 0.27);
}

.dashboard-grid {
  max-width: 1240px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto 14px;
}

.dash-stat {
  min-width: 0;
  min-height: 128px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 4px 10px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  padding: 16px;
  background: var(--app-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.stat-icon {
  grid-row: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
}

.stat-icon svg {
  width: 16px;
  height: 16px;
}

.stat-icon.blue { background: var(--app-blue-soft); color: var(--app-blue); }
.stat-icon.violet { background: #f0edff; color: var(--app-violet); }
.stat-icon.green { background: #e8f7f1; color: var(--app-green); }
.stat-icon.amber { background: #fff3dc; color: var(--app-amber); }

.dash-stat > span {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 660;
}

.dash-stat > strong {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  color: var(--app-ink);
  font-size: 30px;
  font-weight: 740;
  line-height: 1;
}

.dash-stat > small {
  grid-column: 1 / -1;
  grid-row: 3;
  color: var(--app-faint);
  font-size: 10px;
  font-weight: 560;
}

.dashboard-hidden-metric {
  display: none;
}

.quick-starts {
  max-width: 1240px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto 14px;
}

.quick-starts button {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  padding: 11px 13px;
  background: var(--app-surface);
  color: var(--app-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.quick-starts button:hover {
  border-color: #cbd9ed;
  transform: translateY(-1px);
  box-shadow: var(--app-shadow);
}

.quick-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #eef3fa;
  color: var(--app-blue);
}

.quick-starts strong,
.quick-starts small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-starts strong {
  font-size: 12px;
  font-weight: 720;
}

.quick-starts small {
  margin-top: 3px;
  color: var(--app-muted);
  font-size: 10px;
}

.quick-starts button > svg {
  width: 15px;
  color: var(--app-faint);
}

.dashboard-row {
  max-width: 1240px;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  gap: 14px;
  margin: 0 auto;
}

.usage-chart-card,
.history-card,
.history-page,
.profile-intelligence-page,
.portfolio-page {
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.output-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--app-line);
  padding: 13px 16px;
}

.output-head span {
  color: var(--app-faint);
  font-size: 10px;
  font-weight: 650;
}

.output-head h2 {
  margin: 2px 0 0;
  color: var(--app-ink);
  font-size: 17px;
  font-weight: 730;
  line-height: 1.2;
}

.output-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef7f3;
  color: var(--app-green) !important;
  font-size: 9px !important;
  white-space: nowrap;
}

.output-status svg {
  width: 13px;
  height: 13px;
}

.usage-chart {
  height: 220px;
  padding: 22px;
}

.usage-chart i {
  max-width: 34px;
  border-radius: 5px 5px 2px 2px;
  background: #75a6e8;
  box-shadow: none;
}

.history-list {
  gap: 7px;
  padding: 10px;
}

.history-item {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px;
  background: #f8f9fb;
}

.history-item:hover {
  border-color: var(--app-line-strong);
  background: #fff;
}

.history-item span,
.history-item small {
  color: var(--app-faint);
  font-size: 9px;
}

.history-item strong {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 670;
}

.history-actions {
  gap: 5px;
}

.history-item button,
.history-actions select {
  min-height: 30px;
  border: 1px solid var(--app-line);
  border-radius: 6px;
  padding: 0 9px;
  background: #fff;
  color: #4b5360;
  font-size: 9px;
  font-weight: 650;
}

.history-item button[data-delete] {
  background: #fff;
  color: var(--app-danger);
}

#view-proposal.active,
#view-followup.active,
#view-training.active {
  overflow: hidden;
  padding: 18px;
}

.bid-workspace {
  width: 100%;
  max-width: 1380px;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(480px, 1fr);
  gap: 12px;
  margin: 0 auto;
  align-items: stretch;
}

.mobile-bid-switch {
  display: none;
}

.bid-input-card,
.bid-output-card {
  min-height: 0;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.bid-input-card {
  padding: 18px;
  overflow: auto;
  scrollbar-width: thin;
}

.panel-head.compact-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}

.panel-head.compact-head h2 {
  margin: 3px 0 4px;
  color: var(--app-ink);
  font-size: 19px;
  font-weight: 740;
}

.panel-head.compact-head p {
  margin: 0;
  color: var(--app-muted);
  font-size: 11px;
  line-height: 1.4;
}

.step-label {
  color: var(--app-blue);
  font-size: 9px;
  font-weight: 720;
  text-transform: uppercase;
}

.pill {
  min-height: 26px;
  border-radius: 999px;
  padding: 6px 9px;
  background: #eef7f3;
  color: var(--app-green);
  font-size: 9px;
  font-weight: 720;
  white-space: nowrap;
}

.bid-input-card label,
.intelligence-form label,
.portfolio-upload-card label,
.profile-form label {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  color: #3b414a;
  font-size: 11px;
  font-weight: 670;
}

.optional-label {
  display: inline;
  margin-left: 3px;
  color: var(--app-faint);
  font-size: 9px;
  font-weight: 560;
}

.bid-input-card input,
.bid-input-card textarea,
.bid-input-card select,
.intelligence-form input,
.intelligence-form textarea,
.portfolio-upload-card input,
.portfolio-upload-card textarea,
.portfolio-upload-card select,
.profile-form input,
.profile-form textarea {
  width: 100%;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  padding: 11px 12px;
  background: #fff;
  color: var(--app-ink);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.bid-input-card input:focus,
.bid-input-card textarea:focus,
.bid-input-card select:focus,
.intelligence-form input:focus,
.intelligence-form textarea:focus,
.portfolio-upload-card input:focus,
.portfolio-upload-card textarea:focus,
.portfolio-upload-card select:focus,
.profile-form input:focus,
.profile-form textarea:focus {
  border-color: #75a6e8;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.10);
}

.bid-input-card textarea[name="job"] {
  min-height: 210px;
}

.attachment-drop {
  min-height: 52px;
  align-content: center;
  border: 1px dashed #cbd3de !important;
  border-radius: 7px !important;
  padding: 10px 12px !important;
  background: #fafbfd !important;
  cursor: pointer;
}

.attachment-drop > span {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin: 1px 0 0 !important;
  color: var(--app-blue) !important;
  font-size: 10px !important;
  font-weight: 620 !important;
}

.attachment-drop svg {
  width: 14px;
  height: 14px;
}

.proposal-options {
  margin: 0 0 14px;
  border: 1px solid var(--app-line);
  border-radius: 7px;
  background: #fafbfd;
}

.proposal-options summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  color: #525963;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.proposal-options summary::-webkit-details-marker {
  display: none;
}

.proposal-options summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.proposal-options summary svg {
  width: 14px;
  height: 14px;
}

.proposal-options[open] > summary > svg:last-child {
  transform: rotate(180deg);
}

.proposal-options > div {
  border-top: 1px solid var(--app-line);
  padding: 12px 12px 0;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bid-action-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
}

.secondary-bid-btn,
.generate-bid-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  padding: 0 13px;
  font-size: 11px;
  font-weight: 710;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.secondary-bid-btn {
  border: 1px solid var(--app-line-strong);
  background: #fff;
  color: #3d444e;
}

.generate-bid-btn {
  width: 100%;
  border: 1px solid var(--app-blue);
  background: var(--app-blue);
  color: #fff;
  box-shadow: 0 7px 17px rgba(23, 105, 224, 0.20);
}

.secondary-bid-btn:hover,
.generate-bid-btn:hover {
  transform: translateY(-1px);
}

.secondary-bid-btn:active,
.generate-bid-btn:active {
  transform: translateY(0) scale(0.987);
}

.bid-output-card {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
}

.proposal-intelligence {
  border: 0;
  border-bottom: 1px solid var(--app-line);
  border-radius: 0;
  background: #fbfcfe;
  box-shadow: none;
}

.proposal-intelligence summary {
  min-height: 58px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 14px;
}

.proposal-intelligence .fit-score {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.proposal-intelligence .fit-score strong {
  font-size: 15px;
}

.proposal-intelligence .fit-score span {
  font-size: 6px;
}

.psychology-summary span {
  font-size: 8px;
}

.psychology-summary strong {
  font-size: 11px;
}

.psychology-summary small {
  font-size: 9px;
}

.intelligence-toggle {
  border: 1px solid var(--app-line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  color: #56606c;
  font-size: 8px;
}

.proposal-intelligence .intelligence-expanded {
  border-top: 1px solid var(--app-line);
  padding: 11px 14px;
}

.variant-tabs {
  min-height: 48px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--app-line);
  padding: 8px 14px;
  background: #fff;
  scrollbar-width: none;
}

.variant-tabs::-webkit-scrollbar {
  display: none;
}

.variant-tabs button {
  min-height: 31px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  padding: 0 11px;
  background: transparent;
  color: #6a717c;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.variant-tabs button.active {
  background: #eef3fa;
  color: #145fca;
}

.proposal-canvas {
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 28px clamp(22px, 4vw, 64px);
  overflow: auto;
  background: #fff;
  color: #24282f;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.75;
  white-space: pre-wrap;
  scrollbar-width: thin;
}

.proposal-canvas.empty-state {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--app-faint);
  font-size: 13px;
  text-align: center;
}

.proposal-canvas.is-thinking {
  background: #fbfcfe;
}

.ai-thinking {
  width: min(100%, 470px);
  gap: 15px;
}

.thinking-orb {
  width: 72px;
  height: 72px;
  background:
    radial-gradient(circle at 34% 28%, #fff, transparent 19%),
    radial-gradient(circle at 50% 54%, #bfd6ff, #4e8ee7 58%, rgba(23, 105, 224, 0.12) 61%);
  box-shadow: 0 0 0 11px rgba(23, 105, 224, 0.06), 0 17px 44px rgba(23, 105, 224, 0.22);
}

.thinking-copy strong {
  font-size: 20px;
}

.thinking-copy p {
  font-size: 11px;
}

.thinking-steps span {
  min-height: 29px;
  border-color: var(--app-line);
  background: #fff;
  color: #626a75;
  font-size: 9px;
  box-shadow: none;
}

.thinking-scan {
  height: 5px;
  background: #e8ebef;
}

.thinking-scan i {
  background: linear-gradient(90deg, var(--app-blue), #55a778);
}

.extra-hooks {
  border-top: 1px solid var(--app-line);
  background: #fbfcfe;
}

.extra-hooks summary {
  padding: 10px 14px;
  color: #505964;
  font-size: 10px;
  font-weight: 650;
}

.extra-hooks > div {
  padding: 0 14px 12px;
}

.proposal-quality {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  border-top: 1px solid var(--app-line);
  padding: 7px 14px;
  background: #fafbfd;
  scrollbar-width: none;
}

.proposal-quality::-webkit-scrollbar {
  display: none;
}

.proposal-quality strong {
  flex: 0 0 auto;
  color: #343a43;
  font-size: 9px;
}

.proposal-quality > span {
  flex: 0 0 auto;
  display: flex;
  gap: 5px;
}

.proposal-quality i {
  border-radius: 999px;
  padding: 5px 7px;
  font-size: 8px;
  white-space: nowrap;
}

.edit-composer {
  display: none;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  border-top: 1px solid var(--app-line);
  padding: 10px 12px;
  background: #fff;
}

.edit-composer.active {
  display: grid;
}

.edit-composer textarea {
  min-height: 42px;
  max-height: 94px;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  color: var(--app-ink);
  font-size: 11px;
  outline: none;
  resize: none;
}

.edit-composer textarea:focus {
  border-color: #75a6e8;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.10);
}

.edit-composer button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  padding: 0;
  background: var(--app-blue);
  color: #fff;
  box-shadow: none;
}

.edit-composer button span {
  display: none;
}

.profile-intelligence-page,
.portfolio-page,
.history-page {
  width: min(100%, 1120px);
  min-height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}

.intelligence-form {
  max-height: calc(100dvh - 155px);
  display: grid;
  gap: 12px;
  padding: 14px;
  overflow: auto;
}

.intelligence-card,
.portfolio-upload-card,
.portfolio-library-card {
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  padding: 16px;
  background: #fff;
  box-shadow: none;
}

.primary-memory-card {
  grid-template-columns: minmax(220px, 0.66fr) minmax(0, 1.34fr);
  gap: 20px;
  background: #f8fafc;
}

.intelligence-card h3,
.portfolio-upload-card h3,
.portfolio-library-card h3 {
  margin: 3px 0 8px;
  color: var(--app-ink);
  font-size: 18px;
  line-height: 1.2;
}

.intelligence-card p,
.intelligence-section-head small {
  color: var(--app-muted);
  font-size: 10px;
  line-height: 1.5;
}

.intelligence-section-head {
  align-items: center;
  margin-bottom: 13px;
}

.profile-grid {
  gap: 10px;
}

.intelligence-actions {
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -5px 20px rgba(24, 31, 45, 0.05);
}

.portfolio-layout {
  grid-template-columns: minmax(300px, 0.74fr) minmax(0, 1.26fr);
  gap: 12px;
  padding: 14px;
}

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

.portfolio-item {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  border-color: var(--app-line);
  border-radius: 7px;
  padding: 9px;
  background: #fafbfd;
}

.portfolio-thumb {
  width: 64px;
  border-radius: 6px;
  background: #eaf0f7;
}

.profile-modal {
  z-index: 90;
}

.profile-backdrop {
  background: rgba(21, 23, 26, 0.38);
  backdrop-filter: blur(5px);
}

.profile-panel {
  top: 14px;
  right: 14px;
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
  box-shadow: 0 24px 80px rgba(24, 31, 45, 0.22);
}

.profile-panel header {
  border-bottom-color: var(--app-line);
  padding: 15px 17px;
}

.profile-panel header h2 {
  font-size: 20px;
}

.profile-panel header button {
  min-height: 34px;
  border: 1px solid var(--app-line);
  border-radius: 7px;
  background: #fff;
  color: #4f5660;
}

.profile-photo-picker {
  margin-bottom: 16px;
}

#profileAvatarPreview {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--app-ink);
  box-shadow: none;
}

/* Admin application */
.admin-body {
  margin: 0;
  overflow: hidden;
  background: var(--app-bg);
  color: var(--app-ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.admin-shell {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: var(--app-bg);
}

.admin-sidebar {
  position: relative;
  z-index: 30;
  width: 240px;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  border: 0;
  border-right: 1px solid var(--app-line);
  border-radius: 0;
  padding: 18px 14px 14px;
  background: #fbfbfc;
  box-shadow: none;
  backdrop-filter: none;
}

.admin-brand {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.admin-brand strong,
.admin-brand span {
  display: block;
  line-height: 1.2;
}

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

.admin-brand span {
  margin-top: 2px;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 560;
}

.admin-nav {
  min-height: 0;
  display: block;
  overflow: auto;
  scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar {
  display: none;
}

.admin-nav button,
.admin-logout {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  background: transparent;
  color: #505661;
  font-size: 13px;
  font-weight: 610;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.admin-nav button svg,
.admin-logout svg {
  width: 17px;
  height: 17px;
  color: #737a84;
}

.admin-nav button:hover,
.admin-logout:hover {
  background: #f0f2f5;
  color: var(--app-ink);
}

.admin-nav button.active {
  background: #eaf1fb;
  color: #145fca;
  box-shadow: none;
}

.admin-nav button.active svg {
  color: var(--app-blue);
}

.admin-side-card {
  min-height: 54px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  padding: 9px 10px;
  background: #fff;
}

.system-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #27a879;
  box-shadow: 0 0 0 4px rgba(39, 168, 121, 0.11);
}

.admin-side-card strong,
.admin-side-card small {
  display: block;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-side-card strong {
  color: var(--app-ink);
  font-size: 11px;
}

.admin-side-card small {
  color: var(--app-muted);
  font-size: 9px;
}

.admin-logout {
  color: #68707b;
}

.admin-main {
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

.admin-topbar {
  position: relative;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-bottom: 1px solid var(--app-line);
  border-radius: 0;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.admin-topbar .eyebrow {
  color: var(--app-faint);
  font-size: 10px;
  font-weight: 640;
}

.admin-topbar h1 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 740;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-view {
  min-height: 0;
  display: none;
  overflow: auto;
  padding: 28px;
  scrollbar-width: thin;
}

.admin-view.active {
  display: block;
  animation: viewEnter 220ms ease both;
}

.admin-hero,
.admin-stats,
.admin-grid,
.admin-view > .admin-panel,
.admin-view > form.admin-panel {
  width: min(100%, 1280px);
  margin-left: auto;
  margin-right: auto;
}

.admin-hero {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #dbe7f7;
  border-radius: var(--app-radius);
  padding: 22px 24px;
  background: linear-gradient(100deg, #eaf2ff, #fff 58%, #ecf8f3);
  box-shadow: none;
}

.admin-hero span {
  color: var(--app-blue);
  font-size: 10px;
  font-weight: 700;
}

.admin-hero h2 {
  max-width: 680px;
  margin: 5px 0 4px;
  color: var(--app-ink);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.2;
}

.admin-hero p {
  margin: 0;
  color: var(--app-muted);
  font-size: 11px;
}

.admin-hero .live-system {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #cfe9dd;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: var(--app-green);
  font-size: 9px;
  white-space: nowrap;
}

.live-system i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #27a879;
}

.admin-orb {
  display: none;
}

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

.admin-stats article,
.admin-panel {
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.admin-stats article {
  min-width: 0;
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
}

.admin-stats span {
  overflow: hidden;
  color: var(--app-muted);
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-stats strong {
  overflow: hidden;
  color: var(--app-ink);
  font-size: 26px;
  font-weight: 740;
  line-height: 1;
  text-overflow: ellipsis;
}

.admin-stats small {
  overflow: hidden;
  color: var(--app-faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 12px;
}

.admin-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid .span-2 {
  grid-column: auto;
}

.admin-grid .span-3 {
  grid-column: 1 / -1;
}

.admin-panel {
  min-width: 0;
  overflow: hidden;
}

.admin-panel-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--app-line);
  padding: 12px 15px;
}

.admin-panel-head span {
  color: var(--app-faint);
  font-size: 9px;
  font-weight: 650;
}

.admin-panel-head h2 {
  margin: 2px 0 0;
  color: var(--app-ink);
  font-size: 15px;
  font-weight: 730;
}

.admin-panel-head input {
  width: min(260px, 46%);
  min-height: 36px;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  font-size: 11px;
}

.admin-chart {
  height: 250px;
  gap: 7px;
  padding: 20px 16px 14px;
}

.admin-chart i {
  border-radius: 4px 4px 1px 1px;
  background: #75a6e8;
  box-shadow: none;
}

.admin-chart span,
.plan-bar span,
.admin-list-item span,
.admin-list-item small,
.admin-user-row span {
  color: var(--app-faint);
  font-size: 9px;
}

.plan-bars,
.admin-list,
.admin-table,
.library-list,
.admin-form-grid {
  padding: 13px;
}

.plan-bar i,
.insight-bar i {
  border-radius: 999px;
  background: #edf0f4;
}

.plan-bar i b,
.insight-bar i b {
  background: #75a6e8;
}

.admin-list-item,
.admin-user-row,
.memory-card,
.plan-editor-card {
  border: 1px solid var(--app-line);
  border-radius: 7px;
  background: #fafbfd;
  box-shadow: none;
}

.admin-list-item {
  padding: 11px;
}

.admin-list-item strong,
.admin-user-row strong {
  font-size: 11px;
  font-weight: 690;
}

.admin-list-item pre {
  border: 1px solid var(--app-line);
  border-radius: 6px;
  background: #fff;
  font-size: 10px;
  line-height: 1.55;
}

.admin-user-row {
  grid-template-columns: minmax(170px, 1.3fr) 110px 100px 76px 76px auto auto;
  gap: 7px;
  padding: 9px;
}

.admin-user-row input,
.admin-user-row select,
.admin-user-row button,
.admin-panel input,
.admin-panel textarea,
.admin-panel select {
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  background: #fff;
  font-size: 10px;
}

.admin-user-row button {
  min-height: 34px;
  padding: 0 10px;
  background: var(--app-blue);
  color: #fff;
}

.admin-user-row button[data-reset-user] {
  border-color: var(--app-line-strong);
  background: #fff;
  color: #555d68;
}

.admin-form-grid {
  gap: 10px;
}

.admin-form-grid label,
.plan-editor-card label {
  gap: 6px;
  color: #444b55;
  font-size: 10px;
  font-weight: 650;
}

.admin-panel input,
.admin-panel textarea,
.admin-panel select {
  padding: 10px 11px;
  outline: none;
}

.admin-panel input:focus,
.admin-panel textarea:focus,
.admin-panel select:focus {
  border-color: #75a6e8;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.10);
}

.admin-note,
.admin-output {
  border: 1px solid var(--app-line);
  border-radius: 7px;
  background: #f8fafc;
  color: #626a75;
}

.plans-editor {
  gap: 10px;
  padding: 13px;
}

.plan-editor-card {
  padding: 13px;
}

.plan-editor-card h3 {
  font-size: 15px;
  text-transform: capitalize;
}

.analytics-grid .admin-panel {
  min-height: 270px;
}

.insight-bars {
  gap: 12px;
  padding: 15px;
}

.insight-bar strong {
  font-size: 10px;
}

.insight-bar span {
  font-size: 9px;
}

@media (max-width: 1220px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-user-row {
    grid-template-columns: minmax(180px, 1fr) 110px 100px 76px 76px;
  }

  .admin-user-row button {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .bidder-studio,
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-sidebar,
  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(286px, calc(100vw - 46px));
    transform: translateX(-102%);
    border-right: 1px solid var(--app-line);
    box-shadow: 18px 0 55px rgba(24, 31, 45, 0.16);
    transition: transform 220ms ease;
  }

  .user-nav-open .studio-sidebar,
  .admin-nav-open .admin-sidebar {
    transform: translateX(0);
  }

  .app-scrim {
    position: fixed;
    inset: 0;
    z-index: 65;
    border: 0;
    background: rgba(21, 23, 26, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .user-nav-open #userNavScrim,
  .admin-nav-open #adminNavScrim {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: #f0f2f5;
    color: #5a626d;
  }

  .sidebar-close svg {
    width: 16px;
  }

  .mobile-menu-button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--app-line);
    border-radius: 7px;
    padding: 0;
    background: #fff;
    color: #3b414a;
  }

  .studio-topbar,
  .admin-topbar {
    padding: 0 16px;
  }

  .studio-topbar > .workspace-select,
  .admin-topbar > div:first-of-type {
    margin-right: auto;
  }

  .dashboard-row,
  .admin-grid,
  .admin-grid.two {
    grid-template-columns: 1fr;
  }

  .admin-grid .span-3 {
    grid-column: auto;
  }

  .quick-starts {
    grid-template-columns: 1fr;
  }

  .bid-workspace {
    grid-template-columns: minmax(300px, 350px) minmax(430px, 1fr);
  }
}

.bid-brain-console {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(20, 24, 34, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 16px 42px rgba(37, 43, 62, 0.07);
  backdrop-filter: blur(20px);
}

.brain-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.brain-console-head h2 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: 0;
}

.brain-console-head button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(20, 24, 34, 0.1);
  border-radius: 7px;
  background: #11131a;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.brain-console-head button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(17, 19, 26, 0.18);
}

.brain-console-head svg {
  width: 14px;
}

.brain-metrics,
.eval-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.brain-metrics article,
.eval-metrics article {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(20, 24, 34, 0.07);
  border-radius: 7px;
  background: rgba(247, 248, 252, 0.82);
}

.brain-metrics span,
.eval-metrics span {
  display: block;
  color: #777d8c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.brain-metrics strong,
.eval-metrics strong {
  display: block;
  margin: 5px 0 3px;
  color: #11131a;
  font-size: 23px;
}

.brain-metrics small {
  display: block;
  color: #858b98;
  font-size: 10px;
  line-height: 1.35;
}

.truth-readiness-banner {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin: 14px 0;
  padding: 17px;
  border: 1px solid rgba(20, 24, 34, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 44px rgba(51, 61, 86, 0.07);
}

.truth-ring {
  --truth-score: 0%;
  display: grid;
  place-items: center;
  width: 82px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#6c4cf5 var(--truth-score), #e8eaf0 0);
  position: relative;
}

.truth-ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  background: #fff;
}

.truth-ring strong,
.truth-ring span {
  position: relative;
  z-index: 1;
  text-align: center;
}

.truth-ring strong {
  align-self: end;
  font-size: 24px;
}

.truth-ring span {
  align-self: start;
  color: #818695;
  font-size: 9px;
  font-weight: 800;
}

.truth-readiness-banner h3 {
  margin: 5px 0;
  font-size: 18px;
}

.truth-readiness-banner p {
  margin: 0;
  max-width: 680px;
  color: #737987;
  font-size: 12px;
  line-height: 1.55;
}

.truth-mini-stats {
  display: grid;
  gap: 7px;
  min-width: 155px;
}

.truth-mini-stats span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #777d8c;
  font-size: 11px;
}

.truth-mini-stats b {
  color: #12141b;
}

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

.roi-strip span {
  padding: 9px;
  border-radius: 6px;
  background: #f4f5f8;
  color: #757b89;
  font-size: 10px;
}

.roi-strip b {
  display: block;
  margin-bottom: 2px;
  color: #151821;
  font-size: 13px;
}

.roi-strip .risk-low b { color: #13835f; }
.roi-strip .risk-medium b { color: #a66b05; }
.roi-strip .risk-high b { color: #c64343; }

.signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.portfolio-tags i {
  padding: 4px 7px;
  border-radius: 5px;
  background: #eef0f6;
  color: #626978;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.portfolio-item em {
  display: block;
  margin-top: 7px;
  color: #17805f;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.eval-lab {
  margin-top: 12px;
}

.eval-lab .eval-metrics {
  padding: 15px;
}

@media (max-width: 760px) {
  .studio-main,
  .admin-main {
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .studio-topbar,
  .admin-topbar {
    top: 0;
    min-height: 58px;
    padding: 0 12px;
  }

  .workspace-select span,
  .admin-topbar .eyebrow,
  .studio-actions .upgrade-action,
  .admin-top-actions .upgrade-action,
  .icon-action span {
    display: none;
  }

  .icon-action {
    width: 36px;
    padding: 0;
  }

  .studio-actions,
  .admin-top-actions {
    gap: 6px;
  }

  .studio-view,
  .admin-view {
    padding: 14px 12px 82px;
  }

  .studio-welcome {
    min-height: 0;
    display: block;
    margin-bottom: 12px;
    padding: 17px;
  }

  .studio-welcome h1 {
    font-size: 23px;
  }

  .studio-welcome p {
    font-size: 12px;
  }

  .welcome-action {
    width: 100%;
    margin-top: 14px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .dash-stat {
    min-height: 112px;
    padding: 12px;
  }

  .dash-stat > strong {
    font-size: 25px;
  }

  .quick-starts {
    gap: 8px;
    margin-bottom: 10px;
  }

  .dashboard-row {
    gap: 10px;
  }

  .usage-chart {
    height: 190px;
    padding: 16px 12px;
  }

  .mobile-app-nav {
    position: fixed;
    z-index: 60;
    right: 10px;
    bottom: 10px;
    left: 10px;
    height: 62px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid rgba(217, 221, 227, 0.92);
    border-radius: 12px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 36px rgba(24, 31, 45, 0.15);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .mobile-app-nav button {
    min-width: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #737a84;
    font-size: 9px;
    font-weight: 650;
  }

  .mobile-app-nav button svg {
    width: 18px;
    height: 18px;
  }

  .mobile-app-nav button.active {
    background: #eaf1fb;
    color: #145fca;
  }

  #view-proposal.active,
  #view-followup.active,
  #view-training.active {
    overflow: auto;
    padding: 10px 10px 82px;
  }

  .bid-workspace {
    height: auto;
    display: block;
  }

  .mobile-bid-switch {
    position: sticky;
    top: 0;
    z-index: 15;
    width: 100%;
    height: 42px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin: 0 0 8px;
    border: 1px solid var(--app-line);
    border-radius: 9px;
    padding: 3px;
    background: rgba(246, 247, 249, 0.94);
    backdrop-filter: blur(14px);
  }

  .mobile-bid-switch button {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--app-muted);
    font-size: 10px;
    font-weight: 680;
  }

  .mobile-bid-switch button.active {
    background: #fff;
    color: var(--app-ink);
    box-shadow: 0 2px 8px rgba(24, 31, 45, 0.08);
  }

  .bid-workspace[data-mobile-pane="input"] .bid-output-card {
    display: none;
  }

  .bid-workspace[data-mobile-pane="output"] .bid-input-card {
    display: none;
  }

  .bid-input-card,
  .bid-output-card {
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 194px);
  }

  #view-proposal .bid-output-card {
    height: auto;
    min-height: calc(100dvh - 194px);
  }

  .bid-input-card {
    padding: 15px;
    overflow: visible;
  }

  .bid-input-card textarea[name="job"] {
    min-height: 230px;
  }

  .split,
  .bid-action-row,
  .profile-grid,
  .primary-memory-card,
  .portfolio-layout,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .bid-action-row {
    display: grid;
  }

  .secondary-bid-btn,
  .generate-bid-btn {
    min-height: 46px;
  }

  .bid-output-card {
    display: grid;
    grid-template-rows: auto auto auto minmax(360px, 1fr) auto auto auto;
    overflow: hidden;
  }

  .proposal-canvas {
    padding: 22px 18px;
    font-size: 13px;
    line-height: 1.7;
  }

  .proposal-intelligence summary {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .intelligence-toggle {
    grid-column: 2;
    justify-self: start;
  }

  .proposal-quality {
    display: flex;
  }

  .edit-composer {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .profile-intelligence-page,
  .portfolio-page,
  .history-page {
    min-height: auto;
  }

  .intelligence-form {
    max-height: none;
    overflow: visible;
  }

  .intelligence-section-head {
    display: block;
  }

  .intelligence-section-head small {
    display: block;
    margin-top: 5px;
  }

  .portfolio-layout {
    height: auto;
    overflow: visible;
  }

  .history-item,
  .history-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-hero {
    min-height: 0;
    display: block;
    padding: 17px;
  }

  .admin-hero h2 {
    font-size: 19px;
  }

  .admin-hero .live-system {
    margin-top: 14px;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .admin-stats article {
    min-height: 102px;
    padding: 12px;
  }

  .admin-stats strong {
    font-size: 23px;
  }

  .admin-grid,
  .admin-grid.two {
    gap: 10px;
  }

  .admin-panel-head {
    min-height: 58px;
    padding: 11px 12px;
  }

  .admin-panel-head input {
    width: 46%;
  }

  .admin-chart {
    height: 220px;
  }

  .admin-user-row {
    grid-template-columns: 1fr 1fr;
  }

  .admin-user-row > div:first-child {
    grid-column: 1 / -1;
  }

  .admin-user-row button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .workspace-select strong,
  .admin-topbar h1 {
    font-size: 14px;
  }

  .studio-actions .icon-action {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-stat {
    min-height: 105px;
  }

  .stat-icon {
    width: 27px;
    height: 27px;
  }

  .admin-top-actions .icon-action {
    width: 34px;
  }

  .admin-panel-head {
    align-items: flex-start;
  }

  .admin-panel-head input {
    width: 48%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .studio-view.active,
  .admin-view.active,
  .new-chat-btn,
  .welcome-action,
  .quick-starts button,
  .secondary-bid-btn,
  .generate-bid-btn,
  .studio-sidebar,
  .admin-sidebar,
  .app-scrim {
    animation: none;
    transition: none;
  }
}

@media (max-width: 760px) {
  .bid-brain-console {
    padding: 14px;
  }

  .brain-console-head {
    align-items: flex-start;
  }

  .brain-console-head h2 {
    font-size: 15px;
  }

  .brain-console-head button {
    flex: 0 0 auto;
    min-height: 36px;
    padding-inline: 10px;
  }

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

  .brain-metrics article,
  .eval-metrics article {
    padding: 12px;
  }

  .truth-readiness-banner {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 13px;
    padding: 14px;
  }

  .truth-ring {
    width: 68px;
  }

  .truth-ring strong {
    font-size: 20px;
  }

  .truth-readiness-banner h3 {
    font-size: 15px;
  }

  .truth-mini-stats {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .truth-mini-stats span {
    display: grid;
    justify-content: start;
    gap: 2px;
  }

  .roi-strip {
    grid-template-columns: 1fr;
  }

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

/* Benchmark and self-improving bidder model */
.benchmark-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.benchmark-head {
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 0 2px;
}

.benchmark-head p {
  max-width: 680px;
  margin: 5px 0 0;
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.benchmark-scoreboard article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 28px rgba(29, 37, 55, 0.05);
}

.benchmark-scoreboard span,
.benchmark-scoreboard small {
  display: block;
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 750;
}

.benchmark-scoreboard span {
  text-transform: uppercase;
}

.benchmark-scoreboard strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 28px;
  line-height: 1;
}

.benchmark-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 12px;
}

.benchmark-form,
.benchmark-intelligence,
.benchmark-history-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--app-shadow);
}

.benchmark-form {
  display: grid;
  gap: 12px;
}

.benchmark-form label {
  display: grid;
  gap: 6px;
  color: #333842;
  font-size: 11px;
  font-weight: 800;
}

.benchmark-form input,
.benchmark-form textarea,
.benchmark-form select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--app-ink);
  padding: 11px 12px;
  outline: none;
  resize: vertical;
}

.benchmark-form input:focus,
.benchmark-form textarea:focus,
.benchmark-form select:focus {
  border-color: rgba(23, 105, 224, 0.56);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.09);
}

.benchmark-intelligence {
  display: grid;
  align-content: start;
  gap: 12px;
}

.model-status-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.5fr);
  align-items: end;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--app-line);
}

.model-status-card h3 {
  margin: 5px 0;
  font-size: 20px;
}

.model-status-card p {
  margin: 0;
  color: var(--app-muted);
  font-size: 11px;
  line-height: 1.55;
}

.model-progress {
  display: grid;
  gap: 7px;
}

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

.model-progress i b {
  display: block;
  width: 2%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1769e0, #7255d9, #17875f);
  transition: width 500ms ease;
}

.model-progress span {
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 750;
}

.pattern-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pattern-columns > article {
  min-width: 0;
  padding: 2px 0;
}

.pattern-columns header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #343943;
  font-size: 12px;
}

.pattern-columns header svg {
  width: 15px;
  height: 15px;
}

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

.pattern-list > p {
  margin: 0;
  padding: 14px 0;
  color: var(--app-muted);
  font-size: 11px;
}

.pattern-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 10px;
  border: 1px solid var(--app-line);
  border-left: 3px solid var(--app-green);
  border-radius: 7px;
  background: #fbfcfd;
}

.pattern-item.suppress {
  border-left-color: var(--app-danger);
}

.pattern-item div {
  min-width: 0;
}

.pattern-item strong,
.pattern-item span,
.pattern-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pattern-item strong {
  font-size: 11px;
}

.pattern-item span,
.pattern-item small {
  color: var(--app-muted);
  font-size: 9px;
}

.pattern-item b {
  align-self: center;
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--app-green);
  font-size: 12px;
}

.pattern-item.suppress b {
  color: var(--app-danger);
}

.pattern-item small {
  grid-column: 1 / -1;
  margin-top: 3px;
}

.calibration-card,
.calibration-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.calibration-card {
  padding-top: 14px;
  border-top: 1px solid var(--app-line);
}

.calibration-card div,
.calibration-comparison div {
  padding: 10px;
  border-radius: 7px;
  background: var(--app-surface-soft);
}

.calibration-card span,
.calibration-comparison span {
  display: block;
  color: var(--app-muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.calibration-card strong,
.calibration-comparison b {
  display: block;
  margin-top: 5px;
  font-size: 19px;
}

.calibration-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--app-muted);
  font-size: 10px;
  line-height: 1.5;
}

.benchmark-history-card {
  margin-top: 12px;
}

.benchmark-entry-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.benchmark-entry-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--app-line);
}

.benchmark-entry-list article:last-child {
  border-bottom: 0;
}

.benchmark-entry-list span,
.benchmark-entry-list small,
.benchmark-entry-list strong {
  display: block;
}

.benchmark-entry-list span,
.benchmark-entry-list small {
  color: var(--app-muted);
  font-size: 10px;
}

.benchmark-entry-list strong {
  margin: 3px 0;
  font-size: 12px;
}

.benchmark-entry-list button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--app-line);
  border-radius: 7px;
  background: #fff;
  color: var(--app-muted);
  cursor: pointer;
}

.benchmark-outcome {
  padding: 5px 8px;
  border-radius: 6px;
  background: #eef0f4;
  color: #555c68;
  font-size: 9px;
  text-transform: uppercase;
}

.benchmark-outcome.won,
.benchmark-outcome.replied {
  background: #e8f6f0;
  color: var(--app-green);
}

.benchmark-outcome.ignored,
.benchmark-outcome.rejected {
  background: #fcecee;
  color: var(--app-danger);
}

.benchmark-admin-grid {
  margin-top: 12px;
}

.benchmark-versus-card .admin-panel-head > strong,
.calibration-admin-card .admin-panel-head > strong,
.model-rules-admin .admin-panel-head > strong {
  color: var(--app-blue);
  font-size: 11px;
}

.versus-rates {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.versus-rates > div {
  padding: 13px;
  border-radius: 7px;
  background: var(--app-surface-soft);
}

.versus-rates > b {
  color: var(--app-faint);
  font-size: 10px;
}

.versus-rates span,
.versus-rates small {
  display: block;
  color: var(--app-muted);
  font-size: 9px;
}

.versus-rates strong {
  display: block;
  margin: 5px 0;
  font-size: 25px;
}

.uplift-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--app-muted);
  font-size: 11px;
}

.uplift-line strong {
  color: var(--app-ink);
  font-size: 16px;
}

.calibration-comparison {
  margin: 14px 0 10px;
}

.compact-bars {
  margin-top: 12px;
}

.model-rules-admin .pattern-columns {
  margin-top: 12px;
}

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

  .benchmark-scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .benchmark-page {
    padding: 12px;
  }

  .benchmark-head {
    gap: 10px;
  }

  .benchmark-head p {
    font-size: 11px;
  }

  .benchmark-scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .benchmark-scoreboard article,
  .benchmark-form,
  .benchmark-intelligence,
  .benchmark-history-card {
    padding: 13px;
  }

  .benchmark-scoreboard strong {
    font-size: 22px;
  }

  .model-status-card,
  .pattern-columns {
    grid-template-columns: 1fr;
  }

  .benchmark-entry-list article {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .benchmark-entry-list button {
    grid-column: 2;
  }
}

@media (max-width: 430px) {
  .benchmark-scoreboard {
    grid-template-columns: 1fr;
  }

  .benchmark-head .output-status {
    display: none;
  }

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