
:root {
  --ak-ui-line: #2a3d58;
  --ak-ui-line-soft: rgba(132, 154, 190, .17);
  --ak-ui-panel: #09121e;
  --ak-ui-panel-2: #0b1624;
  --ak-ui-violet: #8066ff;
  --ak-ui-blue: #3aafff;
  --ak-ui-text: #f7f9fd;
  --ak-ui-muted: #8797ad;
}

/* Main VIDEO / IMAGE / CHAT tabs — every edge is explicit. */
html body #app #mmTabs {
  position: relative !important;
  isolation: isolate !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 0 17px !important;
  padding: 6px !important;
  overflow: visible !important;
  border: 1px solid #293b55 !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #09121e, #070d16) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 14px 34px rgba(0, 0, 0, .18) !important;
}

html body #app #mmTabs button {
  position: relative !important;
  height: 52px !important;
  min-width: 0 !important;
  padding: 0 12px !important;
  border: 1px solid #23344d !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #0b1522, #08101a) !important;
  color: #8e9db1 !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  letter-spacing: .11em !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025) !important;
  transform: none !important;
}

html body #app #mmTabs button:hover {
  border-color: #3b4f6e !important;
  color: #d9e1ed !important;
}

html body #app #mmTabs button.active {
  border-color: #8b70ff !important;
  color: #fff !important;
  background:
    radial-gradient(circle at 50% 120%, rgba(57, 176, 255, .29), transparent 63%),
    linear-gradient(135deg, #211b45, #11213a) !important;
  box-shadow:
    inset 0 0 0 1px rgba(139, 112, 255, .28),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 9px 25px rgba(80, 65, 210, .2) !important;
}

html body #app #mmTabs button.active::after {
  content: "";
  position: absolute;
  left: 23%;
  right: 23%;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #9b7bff 26%, #40bdff 74%, transparent);
  box-shadow: 0 0 13px rgba(83, 162, 255, .72);
}

/* Model-category tabs use the same border language in every mode. */
html body #app #mmVideoCats,
html body #app #mmImgCats,
html body #app #mmChatCats {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 0 14px !important;
  overflow: visible !important;
}

html body #app #mmVideoCats button,
html body #app #mmImgCats button,
html body #app #mmChatCats button {
  flex: 0 0 auto !important;
  height: 34px !important;
  min-width: 84px !important;
  padding: 0 12px !important;
  border: 1px solid #2c3f5a !important;
  border-radius: 11px !important;
  background: linear-gradient(180deg, #0b1522, #08101a) !important;
  color: #8696ab !important;
  font-size: 7.5px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  letter-spacing: .085em !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025) !important;
  transform: none !important;
  white-space: nowrap !important;
}

html body #app #mmVideoCats button.active,
html body #app #mmImgCats button.active,
html body #app #mmChatCats button.active {
  border-color: #8167f6 !important;
  color: #f2eeff !important;
  background: linear-gradient(135deg, #261d4a, #14203a) !important;
  box-shadow: inset 0 0 0 1px rgba(129, 103, 246, .22), 0 8px 22px rgba(76, 58, 190, .16) !important;
}

/* Complete panel outlines, including the edges that previously disappeared. */
html body #app .akHeroNew,
html body #app .akModelsSection,
html body #app #mmImage > .mmCard,
html body #app #mmChat > .mmCard,
html body #app #mmChat .mmChatShell {
  border: 1px solid var(--ak-ui-line) !important;
  background-clip: padding-box !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 18px 48px rgba(0, 0, 0, .17) !important;
}

html body #app .akSearchNew input,
html body #app .mmSearch,
html body #app #mmImgWork textarea,
html body #app .mmSettings select {
  border: 1px solid #30445f !important;
  background: #070e18 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02) !important;
}

html body #app .akSearchNew input:focus,
html body #app .mmSearch:focus,
html body #app #mmImgWork textarea:focus,
html body #app .mmSettings select:focus {
  border-color: #7d67ea !important;
  box-shadow: 0 0 0 3px rgba(125, 103, 234, .12) !important;
}

/* Video model library. */
html body #app #models.akModelGrid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

html body #app #models .simpleModelCard {
  position: relative !important;
  isolation: isolate !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 78px !important;
  grid-template-rows: auto !important;
  gap: 13px !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 132px !important;
  margin: 0 !important;
  padding: 16px !important;
  overflow: hidden !important;
  border: 1px solid #2a3d58 !important;
  border-radius: 17px !important;
  background: linear-gradient(145deg, #0c1725, #08111c) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 11px 28px rgba(0, 0, 0, .12) !important;
  transform: none !important;
}

html body #app #models .simpleModelCard::before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  inset: 0 !important;
  pointer-events: none !important;
  background: radial-gradient(circle at 100% 0, rgba(97, 86, 224, .09), transparent 42%) !important;
}

html body #app #models .simpleModelCard:hover {
  border-color: #456181 !important;
  background: linear-gradient(145deg, #0e1b2b, #09131f) !important;
}

html body #app #models .simpleModelCard.sel {
  border-color: #8068f5 !important;
  background: linear-gradient(145deg, #15182e, #0b1929) !important;
  box-shadow: inset 0 0 0 1px rgba(128, 104, 245, .2), inset 0 1px 0 rgba(255, 255, 255, .05), 0 13px 34px rgba(72, 56, 177, .17) !important;
}

html body #app #models .simpleModelCard > .akModelMain {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

html body #app #models .simpleModelCard .akModelName {
  width: 100% !important;
  margin: 0 !important;
  color: var(--ak-ui-text) !important;
  font-size: 15px !important;
  line-height: 1.25 !important;
  letter-spacing: -.015em !important;
  overflow-wrap: break-word !important;
}

html body #app #models .simpleModelCard .akCompany {
  margin-top: 4px !important;
  color: #7e8ea4 !important;
  font-size: 8px !important;
  letter-spacing: .15em !important;
}

html body #app #models .simpleModelCard .akModelDesc {
  width: 100% !important;
  margin-top: 8px !important;
  color: #93a1b4 !important;
  font-size: 10.5px !important;
  line-height: 1.42 !important;
  -webkit-line-clamp: 2 !important;
}

html body #app #models .simpleModelCard .akModelTags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  width: 100% !important;
  margin-top: 10px !important;
}

html body #app #models .simpleModelCard .akTag {
  display: inline-flex !important;
  align-items: center !important;
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 7px !important;
  border: 1px solid #2c405a !important;
  border-radius: 999px !important;
  background: #08111c !important;
  color: #91a0b5 !important;
  font-size: 7px !important;
  line-height: 20px !important;
}

html body #app #models .simpleModelCard .akTag.cost {
  border-color: rgba(128, 104, 245, .42) !important;
  background: rgba(128, 104, 245, .1) !important;
  color: #c0b5ff !important;
}

html body #app #models .simpleModelCard > .akSelectBtn {
  position: static !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: start !important;
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border: 1px solid #3a506e !important;
  border-radius: 10px !important;
  background: #0a1421 !important;
  color: #dfe6ef !important;
  font-size: 7.5px !important;
  letter-spacing: .1em !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035) !important;
}

html body #app #models .simpleModelCard.sel > .akSelectBtn {
  border-color: transparent !important;
  background: linear-gradient(135deg, #7d63f4, #39adff) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(64, 103, 230, .22) !important;
}

/* Image model library and workspace. */
html body #app #mmImage .mmGrid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
}

html body #app #mmImage .mmModel {
  position: relative !important;
  isolation: isolate !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  min-width: 0 !important;
  min-height: 126px !important;
  padding: 16px !important;
  border: 1px solid #2a3d58 !important;
  border-radius: 17px !important;
  background: linear-gradient(145deg, #0c1725, #08111c) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 11px 28px rgba(0, 0, 0, .12) !important;
  transform: none !important;
}

html body #app #mmImage .mmModel:hover {
  border-color: #456181 !important;
}

html body #app #mmImage .mmModel.active {
  border-color: #8068f5 !important;
  background: linear-gradient(145deg, #15182e, #0b1929) !important;
  box-shadow: inset 0 0 0 1px rgba(128, 104, 245, .2), 0 13px 34px rgba(72, 56, 177, .17) !important;
}

html body #app #mmImage .mmModel > span {
  width: 100% !important;
  min-height: 92px !important;
}

html body #app #mmImage .mmModel b {
  color: var(--ak-ui-text) !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
}

html body #app #mmImage .mmModel small {
  margin-top: 4px !important;
  color: #7d8da3 !important;
  font-size: 8px !important;
}

html body #app #mmImage .mmModel em {
  margin-top: 8px !important;
  color: #93a1b4 !important;
  font-size: 10.5px !important;
  line-height: 1.42 !important;
}

html body #app #mmImage .mmModel i {
  margin-top: auto !important;
  padding-top: 11px !important;
  color: #bcaeff !important;
  font-size: 8px !important;
}

html body #app #mmImgWork .mmPrimary {
  min-height: 50px !important;
  border: 1px solid rgba(255, 255, 255, .08) !important;
  background: linear-gradient(135deg, #7b5df4, #34b7ff) !important;
  box-shadow: 0 12px 28px rgba(70, 94, 220, .22) !important;
}

html body #app #mmImgHistory video,
html body #app #mmImgHistory article:has(video) {
  display: none !important;
}

/* Chat model picker and workspace. */
html body #app #mmChat.akChatFinal {
  gap: 15px !important;
}

html body #app #mmChat.akChatFinal > .mmCard:first-child {
  padding: 20px !important;
  border: 1px solid #2a3d58 !important;
  border-radius: 22px !important;
  background: radial-gradient(circle at 96% 0, rgba(103, 79, 255, .13), transparent 39%), linear-gradient(145deg, #0c1624, #08111c) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 18px 48px rgba(0, 0, 0, .17) !important;
}

html body #app #mmChat.akChatFinal #mmNewChat {
  height: 40px !important;
  padding: 0 14px !important;
  border: 1px solid #6654a3 !important;
  border-radius: 11px !important;
  background: rgba(105, 80, 225, .08) !important;
  color: #c7b9ff !important;
  font-size: 8px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035) !important;
}

html body #app #mmChat.akChatFinal .mmChatModels {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
}

html body #app #mmChat.akChatFinal .mmChatModel {
  position: relative !important;
  display: block !important;
  min-width: 0 !important;
  min-height: 112px !important;
  padding: 15px !important;
  overflow: hidden !important;
  border: 1px solid #2b3e59 !important;
  border-radius: 16px !important;
  background: linear-gradient(145deg, #0c1725, #08111c) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 10px 25px rgba(0, 0, 0, .11) !important;
  transform: none !important;
}

html body #app #mmChat.akChatFinal .mmChatModel:hover {
  border-color: #496584 !important;
}

html body #app #mmChat.akChatFinal .mmChatModel.active {
  border-color: #8269f7 !important;
  background: linear-gradient(145deg, #171a31, #0b192a) !important;
  box-shadow: inset 0 0 0 1px rgba(130, 105, 247, .2), 0 13px 32px rgba(74, 57, 184, .17) !important;
}

html body #app #mmChat.akChatFinal .mmChatModel.active::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(151, 128, 255, .45);
  border-radius: 999px;
  background: rgba(118, 90, 238, .15);
  color: #cfc4ff;
  font-size: 9px;
  font-weight: 950;
}

html body #app #mmChat.akChatFinal .mmChatModel > span {
  min-height: 80px !important;
}

html body #app #mmChat.akChatFinal .mmChatModel b {
  padding-right: 27px !important;
  color: var(--ak-ui-text) !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  white-space: normal !important;
  overflow: visible !important;
}

html body #app #mmChat.akChatFinal .mmChatModel small {
  margin-top: 5px !important;
  color: #6fddba !important;
  font-size: 7.5px !important;
  letter-spacing: .12em !important;
}

html body #app #mmChat.akChatFinal .mmChatModel em {
  margin-top: auto !important;
  padding-top: 13px !important;
  color: #b9aaff !important;
  font-size: 7.5px !important;
  letter-spacing: .07em !important;
}

html body #app #mmChat.akChatFinal .mmChatShell {
  overflow: hidden !important;
  border: 1px solid #2b3e59 !important;
  border-radius: 22px !important;
  background: #070e18 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 20px 54px rgba(0, 0, 0, .2) !important;
}

html body #app #mmChat.akChatFinal #akChatBar {
  padding: 15px 18px !important;
  border-bottom: 1px solid #263851 !important;
  background: linear-gradient(180deg, #0b1522, #09111c) !important;
}

html body #app #mmChat.akChatFinal #mmMessages {
  background: radial-gradient(circle at 50% 10%, rgba(89, 72, 183, .055), transparent 38%), #070e18 !important;
}

html body #app #mmChat.akChatFinal .mmChatShell footer {
  border-top: 1px solid #263851 !important;
  background: #09121d !important;
}

html body #app #mmChat.akChatFinal #mmChatInput {
  border: 1px solid #334862 !important;
  background: #070e18 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025) !important;
}

html body #app #mmChat.akChatFinal #mmChatInput:focus {
  border-color: #7f68ed !important;
  box-shadow: 0 0 0 3px rgba(127, 104, 237, .12) !important;
}

html body #app #mmChat.akChatFinal #mmChatSend {
  border: 1px solid rgba(255, 255, 255, .09) !important;
  background: linear-gradient(135deg, #7b5df4, #34b7ff) !important;
  box-shadow: 0 10px 24px rgba(68, 97, 222, .23) !important;
}

@media (max-width: 760px) {
  html body #app #mmTabs {
    gap: 6px !important;
    padding: 5px !important;
    border-radius: 16px !important;
  }

  html body #app #mmTabs button {
    height: 48px !important;
    padding: 0 7px !important;
    border-radius: 11px !important;
    font-size: 9px !important;
    letter-spacing: .085em !important;
  }

  html body #app #mmVideoCats,
  html body #app #mmImgCats,
  html body #app #mmChatCats {
    flex-wrap: nowrap !important;
    gap: 6px !important;
    padding: 1px 1px 12px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scroll-padding-inline: 1px !important;
    scrollbar-width: none !important;
  }

  html body #app #mmVideoCats::-webkit-scrollbar,
  html body #app #mmImgCats::-webkit-scrollbar,
  html body #app #mmChatCats::-webkit-scrollbar {
    display: none !important;
  }

  html body #app #mmVideoCats button,
  html body #app #mmImgCats button,
  html body #app #mmChatCats button {
    height: 32px !important;
    min-width: max-content !important;
    padding: 0 11px !important;
    border-radius: 10px !important;
    font-size: 7px !important;
  }

  html body #app #models.akModelGrid,
  html body #app #mmImage .mmGrid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px !important;
  }

  html body #app #models .simpleModelCard {
    grid-template-columns: minmax(0, 1fr) 70px !important;
    min-height: 124px !important;
    padding: 14px !important;
    border-radius: 16px !important;
  }

  html body #app #models .simpleModelCard > .akSelectBtn {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    height: 35px !important;
    min-height: 35px !important;
  }

  html body #app #models .simpleModelCard .akModelName {
    font-size: 14px !important;
  }

  html body #app #models .simpleModelCard .akModelDesc {
    font-size: 10px !important;
  }

  html body #app #mmImage .mmModel {
    min-height: 120px !important;
    padding: 14px !important;
    border-radius: 16px !important;
  }

  html body #app #mmChat.akChatFinal > .mmCard:first-child {
    padding: 16px !important;
    border-radius: 19px !important;
  }

  html body #app #mmChat.akChatFinal .mmChatModels {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  html body #app #mmChat.akChatFinal .mmChatModel {
    min-height: 108px !important;
    padding: 13px !important;
    border-radius: 15px !important;
  }

  html body #app #mmChat.akChatFinal .mmChatModel b {
    font-size: 12px !important;
  }

  html body #app #mmChat.akChatFinal #akChatBar {
    padding: 14px !important;
  }

  html body #app #mmChat.akChatFinal .mmChatShell footer {
    grid-template-columns: minmax(0, 1fr) 70px !important;
    padding: 10px !important;
  }

  html body #app #mmChat.akChatFinal #mmChatSend {
    width: 70px !important;
  }
}

@media (max-width: 360px) {
  html body #app #mmTabs button {
    font-size: 8px !important;
  }

  html body #app #mmChat.akChatFinal .mmChatModels {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
