:root {
  --canva-bg: #fcfbf8;
}

body.home-canvas .app-frame {
  width: min(100vw, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--canva-bg);
}

body.home-canvas .app-topbar,
body.home-canvas .tab-bar,
body.home-canvas .home-greeting,
body.home-canvas .home-hero,
body.home-canvas .tools-section,
body.home-canvas .quick-access,
body.home-canvas .recent-panel,
body.home-canvas .home-footer {
  display: none !important;
}

body.home-canvas .app-content,
body.home-canvas .screen,
body.home-canvas #chatView,
body.home-canvas #homePanel {
  display: block;
  width: 100%;
  min-height: 100dvh;
  padding: 0;
  margin: 0;
  background: var(--canva-bg);
}

.canva-home-screen {
  position: relative;
  display: none;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
}

.desktop-approved-home {
  display: none;
}

body.home-canvas .canva-home-screen {
  display: block;
}

.canva-home-screen img {
  display: block;
  width: 100%;
  min-height: 100dvh;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.canva-hotspot {
  position: absolute;
  z-index: 2;
  border: 0;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.01);
  color: transparent;
  cursor: pointer;
}

.hotspot-menu {
  left: 5.4%;
  top: 4.8%;
  width: 13.5%;
  height: 6.2%;
  border-radius: 999px;
}

.hotspot-chat {
  left: 5.6%;
  top: 25.8%;
  width: 43%;
  height: 17.7%;
}

.hotspot-reports {
  left: 51.5%;
  top: 25.8%;
  width: 43%;
  height: 17.7%;
}

.hotspot-articles {
  left: 5.6%;
  top: 44.9%;
  width: 43%;
  height: 17.7%;
}

.hotspot-favorites {
  left: 51.5%;
  top: 44.9%;
  width: 43%;
  height: 17.7%;
}

.hotspot-faq {
  left: 5.6%;
  top: 64.2%;
  width: 43%;
  height: 17.4%;
}

.hotspot-premium {
  left: 51.5%;
  top: 64.2%;
  width: 43%;
  height: 17.4%;
}

.hotspot-user-profile {
  left: 7%;
  top: 83.2%;
  width: 42%;
  height: 10.5%;
}

.hotspot-settings {
  left: 52%;
  top: 83.2%;
  width: 42%;
  height: 10.5%;
}

body:not(.home-canvas) .canva-home-screen,
body:not(.home-canvas) .tab-bar {
  display: none !important;
}

@media (min-width: 900px) {
  body.home-canvas {
    min-height: 100dvh;
    background:
      radial-gradient(circle at 8% 10%, rgba(218, 247, 230, 0.78), transparent 30%),
      radial-gradient(circle at 92% 8%, rgba(252, 232, 121, 0.36), transparent 28%),
      linear-gradient(135deg, #f7fff9 0%, #fffdf1 48%, #ffffff 100%);
    font-family: "Nunito Sans", Nunito, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  body.home-canvas .app-frame {
    width: min(1180px, calc(100vw - 48px));
    min-height: calc(100dvh - 48px);
    height: calc(100dvh - 48px);
    margin: 24px auto;
    border-radius: 34px;
    background:
      linear-gradient(90deg, rgba(255, 244, 132, 0.24) 0, rgba(255, 255, 255, 0.96) 28%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: 0 28px 80px rgba(91, 91, 91, 0.12);
    overflow: hidden;
  }

  body.home-canvas .app-content,
  body.home-canvas .screen,
  body.home-canvas #chatView,
  body.home-canvas #homePanel {
    min-height: 0;
    height: 100%;
    background: transparent;
  }

  body.home-canvas #homePanel {
    display: grid;
    grid-template-columns: minmax(350px, 430px) minmax(320px, 0.82fr);
    align-items: center;
    justify-content: center;
    gap: clamp(36px, 6vw, 86px);
    padding: clamp(20px, 3vw, 34px);
  }

  body.home-canvas .canva-home-screen {
    display: block;
    width: auto;
    min-width: 0;
    height: min(820px, calc(100dvh - 96px));
    min-height: 0;
    aspect-ratio: 430 / 932;
    border-radius: 30px;
    background: #ffffff;
    overflow: hidden;
    box-shadow:
      0 34px 70px rgba(88, 86, 82, 0.16),
      0 0 0 1px rgba(119, 117, 100, 0.08);
  }

  body.home-canvas .canva-home-screen img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
  }

  body.home-canvas .desktop-approved-home {
    display: grid;
    align-content: center;
    min-width: 0;
    max-width: 430px;
  }

  .desktop-approved-intro {
    display: grid;
    justify-items: start;
    gap: 14px;
    max-width: 430px;
  }

  .desktop-approved-intro img {
    width: 112px;
    height: auto;
    filter: drop-shadow(0 16px 24px rgba(87, 97, 83, 0.14));
  }

  .desktop-approved-intro span {
    color: #5f5d5a;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
  }

  .desktop-approved-intro h2 {
    margin: 0;
    color: #555452;
    font-family: Nunito, "Nunito Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(2.15rem, 4vw, 3.45rem);
    font-weight: 800;
    line-height: 1.02;
  }

  .desktop-approved-intro p {
    max-width: 34ch;
    margin: 0;
    color: #77736f;
    font-size: clamp(1rem, 1.45vw, 1.2rem);
    line-height: 1.55;
  }
}

@media (min-width: 900px) and (max-width: 1060px) {
  body.home-canvas #homePanel {
    grid-template-columns: minmax(300px, 380px) minmax(280px, 0.8fr);
    gap: 28px;
    padding: 28px;
  }

  body.home-canvas .canva-home-screen {
    width: auto;
    min-width: 0;
    min-height: 0;
  }

  .desktop-approved-intro img {
    width: 92px;
  }
}

.technical-access-card,
.technical-style-panel,
.technical-chat-panel,
.technical-test-panel {
  border: 1px solid rgba(117, 104, 189, 0.12);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(247, 217, 102, 0.22), transparent 32%),
    radial-gradient(circle at 0% 100%, rgba(223, 242, 233, 0.45), transparent 34%),
    rgba(255, 254, 251, 0.96);
  box-shadow: 0 22px 58px rgba(72, 68, 104, 0.09);
}

.technical-status {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(117, 104, 189, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.technical-status small {
  display: block;
  color: #717187;
}

.technical-status strong {
  display: block;
}

.technical-chat-thread {
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(117, 104, 189, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
}

.technical-message {
  width: fit-content;
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.45;
  box-shadow: 0 12px 26px rgba(72, 68, 104, 0.07);
}

.technical-message.assistant {
  align-self: flex-start;
  background: #fffefb;
  border: 1px solid rgba(117, 104, 189, 0.12);
}

.technical-message.user {
  align-self: flex-end;
  background: #dff2e9;
}

.technical-chat-form,
.technical-style-form,
.technical-test-form,
.form-grid {
  display: grid;
  gap: 14px;
}

.technical-test-answer {
  min-height: 120px;
  white-space: pre-wrap;
  padding: 14px;
  border: 1px solid rgba(117, 104, 189, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  color: #20233d;
  line-height: 1.45;
}

body.technical-responsible-mode .canva-home-screen,
body.technical-responsible-mode #chatWorkspace,
body.technical-responsible-mode .home-greeting,
body.technical-responsible-mode .home-hero,
body.technical-responsible-mode .tools-section,
body.technical-responsible-mode .quick-access,
body.technical-responsible-mode .recent-panel,
body.technical-responsible-mode .home-footer,
body.owner-approval-mode .canva-home-screen,
body.owner-approval-mode #chatWorkspace {
  display: none !important;
}

body.technical-responsible-mode #chatView,
body.owner-approval-mode #chatView {
  display: none !important;
}

body.technical-responsible-mode #knowledgeView,
body.owner-approval-mode #knowledgeView {
  display: flex !important;
}

body.technical-responsible-mode .app-topbar,
body.owner-approval-mode .app-topbar {
  display: grid !important;
}

.file-field {
  display: grid;
  gap: 8px;
}

.file-field input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 1px dashed rgba(117, 104, 189, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: #20233d;
}

.file-field small {
  color: #717187;
  line-height: 1.4;
}

body.technical-responsible-mode,
body.owner-approval-mode {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(223, 242, 233, 0.78), transparent 32%),
    radial-gradient(circle at 90% 4%, rgba(240, 239, 251, 0.82), transparent 30%),
    linear-gradient(135deg, #fffefb 0%, #f7f8fb 52%, #f3fbf6 100%);
}

body.technical-responsible-mode .splash,
body.owner-approval-mode .splash,
body.technical-responsible-mode .sidebar-scrim,
body.owner-approval-mode .sidebar-scrim,
body.technical-responsible-mode .app-sidebar,
body.owner-approval-mode .app-sidebar,
body.technical-responsible-mode .menu-button,
body.owner-approval-mode .menu-button,
body.technical-responsible-mode .global-search,
body.owner-approval-mode .global-search,
body.technical-responsible-mode .icon-button,
body.owner-approval-mode .icon-button,
body.technical-responsible-mode .avatar-button,
body.owner-approval-mode .avatar-button {
  display: none !important;
}

body.technical-responsible-mode .app-frame,
body.owner-approval-mode .app-frame {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  display: block;
  transform: none !important;
  background: transparent;
  box-shadow: none;
}

body.technical-responsible-mode .app-content,
body.owner-approval-mode .app-content {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 48px;
}

body.technical-responsible-mode .app-topbar,
body.owner-approval-mode .app-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 88px;
  padding: 22px 0 18px;
  background:
    linear-gradient(180deg, rgba(255, 254, 251, 0.94), rgba(255, 254, 251, 0.74));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(117, 104, 189, 0.12);
}

body.technical-responsible-mode .app-topbar::before,
body.owner-approval-mode .app-topbar::before {
  content: "";
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #ffffff url("assets/brain-3d-clean.png") center / 42px auto no-repeat;
  box-shadow: 0 14px 32px rgba(72, 68, 104, 0.12);
}

body.technical-responsible-mode #screenTitle,
body.owner-approval-mode #screenTitle {
  display: block;
  flex: 1;
  margin: 0;
  color: #20233d;
  font-size: clamp(1.45rem, 2.4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
}

body.technical-responsible-mode #screenTitle::after {
  content: "Painel de base, estilo e teste do chat EntreMentes Pro";
  display: block;
  margin-top: 6px;
  color: #717187;
  font-size: 0.95rem;
  font-weight: 500;
}

body.owner-approval-mode #screenTitle::after {
  content: "Gerencie o acesso da responsavel tecnica";
  display: block;
  margin-top: 6px;
  color: #717187;
  font-size: 0.95rem;
  font-weight: 500;
}

body.technical-responsible-mode .screen,
body.owner-approval-mode .screen {
  width: 100%;
  min-height: auto;
  padding: 34px 0 0;
  background: transparent;
}

body.technical-responsible-mode #knowledgeView,
body.owner-approval-mode #knowledgeView {
  display: block !important;
  width: 100%;
  padding: 0;
}

body.technical-responsible-mode #technicalWorkspace,
body.owner-approval-mode #technicalWorkspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.75fr);
  gap: 22px;
  align-items: start;
}

body.technical-responsible-mode .technical-style-panel,
body.owner-approval-mode .technical-style-panel {
  grid-column: 1;
  grid-row: span 2;
}

body.technical-responsible-mode .technical-chat-panel,
body.owner-approval-mode .technical-chat-panel,
body.technical-responsible-mode .technical-test-panel,
body.owner-approval-mode .technical-test-panel,
body.technical-responsible-mode #knowledgeForm,
body.owner-approval-mode #knowledgeForm,
body.technical-responsible-mode #knowledgeList,
body.owner-approval-mode #knowledgeList {
  grid-column: auto;
}

body.technical-responsible-mode #knowledgeForm,
body.owner-approval-mode #knowledgeForm {
  grid-column: 1 / -1;
}

body.technical-responsible-mode #knowledgeList,
body.owner-approval-mode #knowledgeList {
  grid-column: 1 / -1;
}

body.technical-responsible-mode .technical-access-card,
body.owner-approval-mode .technical-access-card,
body.technical-responsible-mode .technical-style-panel,
body.owner-approval-mode .technical-style-panel,
body.technical-responsible-mode .technical-chat-panel,
body.owner-approval-mode .technical-chat-panel,
body.technical-responsible-mode .technical-test-panel,
body.owner-approval-mode .technical-test-panel,
body.technical-responsible-mode #knowledgeForm,
body.owner-approval-mode #knowledgeForm {
  border: 1px solid rgba(117, 104, 189, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 48px rgba(72, 68, 104, 0.08);
}

body.technical-responsible-mode .panel,
body.owner-approval-mode .panel {
  padding: 24px;
}

body.technical-responsible-mode .section-title,
body.owner-approval-mode .section-title {
  gap: 8px;
}

body.technical-responsible-mode .section-title h2,
body.owner-approval-mode .section-title h2 {
  color: #20233d;
  font-size: 1.3rem;
  font-weight: 800;
}

body.technical-responsible-mode .section-title p,
body.owner-approval-mode .section-title p {
  max-width: 62ch;
  color: #6b6f81;
  font-size: 0.98rem;
  line-height: 1.55;
}

body.technical-responsible-mode label,
body.owner-approval-mode label {
  color: #333746;
  font-size: 0.94rem;
  font-weight: 700;
}

body.technical-responsible-mode input,
body.owner-approval-mode input,
body.technical-responsible-mode select,
body.owner-approval-mode select,
body.technical-responsible-mode textarea,
body.owner-approval-mode textarea {
  min-height: 48px;
  border: 1px solid rgba(117, 104, 189, 0.16);
  border-radius: 14px;
  background: #ffffff;
  color: #20233d;
  font-size: 0.98rem;
  box-shadow: none;
}

body.technical-responsible-mode textarea,
body.owner-approval-mode textarea {
  min-height: 118px;
  line-height: 1.55;
}

body.technical-responsible-mode input:focus,
body.owner-approval-mode input:focus,
body.technical-responsible-mode select:focus,
body.owner-approval-mode select:focus,
body.technical-responsible-mode textarea:focus,
body.owner-approval-mode textarea:focus {
  outline: 3px solid rgba(109, 85, 198, 0.14);
  border-color: rgba(109, 85, 198, 0.46);
}

body.technical-responsible-mode .primary-button,
body.owner-approval-mode .primary-button {
  min-height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #5d4dbc, #7d65d3);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(93, 77, 188, 0.2);
}

body.technical-responsible-mode .secondary-button,
body.owner-approval-mode .secondary-button {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(117, 104, 189, 0.2);
  background: #ffffff;
  color: #4b437f;
  font-weight: 800;
}

body.technical-responsible-mode .technical-chat-thread,
body.owner-approval-mode .technical-chat-thread {
  max-height: 360px;
  min-height: 220px;
  background: #fbfaf8;
}

body.technical-responsible-mode .technical-test-answer,
body.owner-approval-mode .technical-test-answer,
body.technical-responsible-mode .technical-status,
body.owner-approval-mode .technical-status {
  background: #fbfaf8;
  border-color: rgba(117, 104, 189, 0.14);
}

@media (max-width: 900px) {
  body.technical-responsible-mode .app-content,
  body.owner-approval-mode .app-content {
    width: min(100% - 24px, 720px);
  }

  body.technical-responsible-mode #technicalWorkspace,
  body.owner-approval-mode #technicalWorkspace {
    grid-template-columns: 1fr;
  }

  body.technical-responsible-mode .technical-style-panel,
  body.owner-approval-mode .technical-style-panel,
  body.technical-responsible-mode #knowledgeForm,
  body.owner-approval-mode #knowledgeForm,
  body.technical-responsible-mode #knowledgeList,
  body.owner-approval-mode #knowledgeList {
    grid-column: 1;
  }
}

.technical-portal-hero {
  display: none;
}

body.technical-responsible-mode .app-topbar,
body.owner-approval-mode .app-topbar {
  display: none !important;
}

body.technical-responsible-mode .app-content,
body.owner-approval-mode .app-content {
  width: min(1240px, calc(100% - 56px));
  padding: 32px 0 56px;
}

body.technical-responsible-mode .screen,
body.owner-approval-mode .screen {
  padding-top: 0;
}

body.technical-responsible-mode .technical-portal-hero,
body.owner-approval-mode .technical-portal-hero {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.25fr) auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid rgba(87, 77, 150, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 48px rgba(62, 55, 105, 0.08);
}

.technical-portal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.technical-portal-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(62, 55, 105, 0.12);
}

.technical-portal-brand div {
  display: grid;
  gap: 4px;
}

.technical-portal-brand span {
  color: #746f86;
  font-size: 0.88rem;
  font-weight: 700;
}

.technical-portal-brand strong {
  color: #191d33;
  font-size: 1.12rem;
  font-weight: 850;
}

.technical-portal-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.technical-portal-copy h2 {
  margin: 0;
  color: #171a2f;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.08;
}

.technical-portal-copy p {
  max-width: 58ch;
  margin: 0;
  color: #62677b;
  font-size: 0.98rem;
  line-height: 1.55;
}

.technical-portal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.technical-portal-actions .primary-button,
.technical-portal-actions .secondary-button {
  width: auto;
  min-width: 132px;
  padding-inline: 18px;
}

.technical-portal-nav {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(87, 77, 150, 0.1);
}

.technical-portal-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(87, 77, 150, 0.13);
  border-radius: 999px;
  background: #ffffff;
  color: #403a72;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.technical-portal-nav a:hover,
.technical-portal-nav a:focus-visible {
  border-color: rgba(106, 86, 198, 0.34);
  background: #f6f2ff;
  outline: none;
}

body.technical-responsible-mode #technicalWorkspace,
body.owner-approval-mode #technicalWorkspace {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.82fr);
  gap: 18px;
}

body.technical-responsible-mode .technical-access-card,
body.owner-approval-mode .technical-access-card,
body.technical-responsible-mode .technical-style-panel,
body.owner-approval-mode .technical-style-panel,
body.technical-responsible-mode .technical-chat-panel,
body.owner-approval-mode .technical-chat-panel,
body.technical-responsible-mode .technical-test-panel,
body.owner-approval-mode .technical-test-panel,
body.technical-responsible-mode #knowledgeForm,
body.owner-approval-mode #knowledgeForm {
  border-radius: 18px;
  box-shadow: 0 14px 38px rgba(62, 55, 105, 0.07);
}

body.technical-responsible-mode .panel,
body.owner-approval-mode .panel {
  padding: 22px;
}

body.technical-responsible-mode .section-title {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

body.technical-responsible-mode .section-title h2,
body.owner-approval-mode .section-title h2 {
  font-size: 1.2rem;
  line-height: 1.18;
}

body.technical-responsible-mode .section-title p,
body.owner-approval-mode .section-title p {
  margin: 0;
  font-size: 0.96rem;
}

body.technical-responsible-mode input,
body.owner-approval-mode input,
body.technical-responsible-mode select,
body.owner-approval-mode select,
body.technical-responsible-mode textarea,
body.owner-approval-mode textarea {
  border-radius: 12px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.technical-responsible-mode .technical-chat-thread,
body.owner-approval-mode .technical-chat-thread {
  min-height: 180px;
  max-height: 280px;
}

@media (max-width: 980px) {
  body.technical-responsible-mode .technical-portal-hero,
  body.owner-approval-mode .technical-portal-hero {
    grid-template-columns: 1fr;
  }

  .technical-portal-actions {
    justify-content: flex-start;
  }

  body.technical-responsible-mode .section-title {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body.technical-responsible-mode .app-content,
  body.owner-approval-mode .app-content {
    width: min(100% - 24px, 720px);
    padding-top: 20px;
  }

  .technical-portal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .technical-portal-actions .primary-button,
  .technical-portal-actions .secondary-button {
    width: 100%;
  }
}
