/* ArtinAI 3.3.3 — macOS Gray / clean message presentation.
 * Loaded after all legacy chat styles. No message handlers or saved preferences changed.
 * The content and its actions are visually separate even for saved "inside" placements.
 */
.artinai-body .artin-chat .n-msg-row{
  min-width:0!important;
  margin-bottom:25px!important;
  align-items:flex-start!important;
}
.artinai-body .artin-chat .n-msg-row .n-msg-card{
  position:relative;
  min-width:0;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.artinai-body .artin-chat .n-msg-row.ai .n-msg-card{
  width:100%!important;
  max-width:100%!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:0!important;
}
.artinai-body .artin-chat .n-msg-row .n-msg{
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:0!important;
  min-width:0!important;
  margin:0!important;
  overflow:visible!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
/* Assistant responses: no giant white panel, only the readable text. */
.artinai-body .artin-chat .n-msg-row.ai .n-msg{
  width:100%!important;
  max-width:100%!important;
  padding:0!important;
  color:var(--text)!important;
}
.artinai-body .artin-chat .n-msg-row.ai .n-message-content{
  width:100%;
  min-width:0;
  box-sizing:border-box;
  padding:1px 0!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  direction:rtl;
  text-align:right;
}
/* User messages: only the text/image receives a compact, soft bubble. */
.artinai-body .artin-chat .n-msg-row.user .n-msg-card{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  max-width:min(82%,640px)!important;
  width:max-content;
}
.artinai-body .artin-chat .n-msg-row.user .n-msg{
  width:100%!important;
  max-width:100%!important;
  padding:0!important;
}
.artinai-body .artin-chat .n-msg-row.user .n-message-content:not(:empty){
  display:block;
  width:fit-content;
  max-width:100%;
  box-sizing:border-box;
  padding:10px 15px!important;
  background:var(--user,var(--hover))!important;
  border:1px solid color-mix(in srgb,var(--border) 55%,transparent)!important;
  border-radius:17px!important;
  box-shadow:none!important;
  overflow-wrap:anywhere;
  direction:rtl;
  text-align:right;
}
.artinai-body .artin-chat .n-msg-row .n-message-content:empty{display:none!important}
.artinai-body .artin-chat .n-msg-row .n-message-content p{margin:0 0 9px!important}
.artinai-body .artin-chat .n-msg-row .n-message-content p:last-child{margin-bottom:0!important}
/* Toolbars are quiet, content-width rows instead of a full-width footer. */
.artinai-body .artin-chat .n-message-toolbar,
.artinai-body .artin-chat .n-message-toolbar.n-tools-place-inside-bottom,
.artinai-body .artin-chat .n-message-toolbar.n-tools-place-inside-top,
.artinai-body .artin-chat .n-message-toolbar.n-tools-place-outside-bottom{
  box-sizing:border-box!important;
  display:flex!important;
  flex:0 0 auto!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:2px!important;
  width:fit-content!important;
  max-width:100%!important;
  min-height:0!important;
  margin:6px 0 0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  color:var(--muted)!important;
  font-size:12px!important;
  line-height:1.3!important;
}
.artinai-body .artin-chat .n-message-toolbar.n-tools-place-inside-top{
  margin:0 0 6px!important;
}
.artinai-body .artin-chat .n-message-toolbar.n-tools-align-start{align-self:flex-start!important;justify-content:flex-start!important}
.artinai-body .artin-chat .n-message-toolbar.n-tools-align-center{align-self:center!important;justify-content:center!important}
.artinai-body .artin-chat .n-message-toolbar.n-tools-align-end{align-self:flex-end!important;justify-content:flex-end!important}
.artinai-body .artin-chat .n-message-toolbar .n-msg-action,
.artinai-body .artin-chat .n-message-toolbar .n-message-more>summary{
  box-sizing:border-box!important;
  width:32px!important;
  min-width:32px!important;
  height:32px!important;
  min-height:32px!important;
  padding:0!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--muted)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  cursor:pointer!important;
  transition:background .15s ease,color .15s ease;
}
.artinai-body .artin-chat .n-message-toolbar .n-msg-action .n-svg,
.artinai-body .artin-chat .n-message-toolbar summary .n-svg{
  width:17px!important;
  height:17px!important;
}
.artinai-body .artin-chat .n-message-toolbar .n-msg-action:hover,
.artinai-body .artin-chat .n-message-toolbar .n-message-more>summary:hover,
.artinai-body .artin-chat .n-message-toolbar .n-msg-action.is-active{
  background:var(--hover)!important;
  color:var(--text)!important;
}
/* Keep existing admin icon/text/both preference working. */
.artinai-body .artin-chat .n-message-toolbar.n-tools-both .n-msg-action,
.artinai-body .artin-chat .n-message-toolbar.n-tools-both .n-message-more>summary,
.artinai-body .artin-chat .n-message-toolbar.n-tools-text .n-msg-action,
.artinai-body .artin-chat .n-message-toolbar.n-tools-text .n-message-more>summary{
  width:auto!important;
  min-width:32px!important;
  padding:0 9px!important;
}
.artinai-body .artin-chat .n-message-toolbar.n-tools-icons .n-msg-action>span,
.artinai-body .artin-chat .n-message-toolbar.n-tools-icons .n-message-more>summary>span{display:none!important}
.artinai-body .artin-chat .n-message-toolbar.n-tools-both .n-msg-action>span,
.artinai-body .artin-chat .n-message-toolbar.n-tools-both .n-message-more>summary>span,
.artinai-body .artin-chat .n-message-toolbar.n-tools-text .n-msg-action>span,
.artinai-body .artin-chat .n-message-toolbar.n-tools-text .n-message-more>summary>span{display:inline!important;font-size:11px!important}
/* 'More' opens as a small anchored menu, never stretches the reply. */
.artinai-body .artin-chat .n-message-more{position:relative!important;flex:0 0 auto!important;max-width:100%!important}
.artinai-body .artin-chat .n-message-more[open]{width:auto!important;flex-basis:auto!important}
.artinai-body .artin-chat .n-message-more-panel{
  position:absolute!important;
  z-index:30!important;
  top:calc(100% + 5px)!important;
  right:0!important;
  left:auto!important;
  width:max-content!important;
  max-width:min(300px,calc(100vw - 40px))!important;
  min-width:150px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:2px!important;
  padding:6px!important;
  border:1px solid var(--border)!important;
  border-radius:13px!important;
  background:var(--surface)!important;
  box-shadow:0 12px 35px rgba(17,32,48,.14)!important;
}
.artinai-body .artin-chat .n-message-more-panel .n-msg-action{
  width:100%!important;
  height:36px!important;
  justify-content:flex-start!important;
  gap:9px!important;
  padding:0 10px!important;
}
.artinai-body .artin-chat .n-message-more-panel .n-msg-action>span{display:inline!important;font-size:12px!important}
.artinai-body .artin-chat .n-message-toolbar :focus-visible{outline:2px solid var(--accent)!important;outline-offset:2px!important}
@media(max-width:760px){
  .artinai-body .artin-chat .n-msg-row{margin-bottom:19px!important}
  .artinai-body .artin-chat .n-msg-row.user .n-msg-card{max-width:88%!important}
  .artinai-body .artin-chat .n-msg-row.user .n-message-content:not(:empty){padding:9px 12px!important;border-radius:15px!important}
  .artinai-body .artin-chat .n-message-toolbar .n-msg-action,
  .artinai-body .artin-chat .n-message-toolbar .n-message-more>summary{width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important}
  .artinai-body .artin-chat .n-message-more-panel .n-msg-action{width:100%!important}
}
@media(prefers-reduced-motion:reduce){.artinai-body .artin-chat .n-message-toolbar *{transition:none!important}}
/* Override higher-specificity legacy light-theme shadow and user background. */
html[data-theme="light"] .artinai-body .artin-chat .n-msg-row.ai .n-msg,
[data-theme="light"] .artinai-body .artin-chat .n-msg-row.ai .n-msg{
  box-shadow:none!important;
}
.artinai-body .artin-chat .n-msg-row.user .n-msg{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  backdrop-filter:none!important;
}
/* Expanded actions always need readable labels, including icon-only mode. */
.artinai-body .artin-chat .n-message-toolbar.n-tools-icons .n-message-more-panel .n-msg-action>span,
.artinai-body .artin-chat .n-message-toolbar.n-tools-both .n-message-more-panel .n-msg-action>span,
.artinai-body .artin-chat .n-message-toolbar.n-tools-text .n-message-more-panel .n-msg-action>span{
  display:inline!important;
  font-size:12px!important;
}
